Thursday, August 30, 2012

Introduction to servlet

Download Tomacat from

http://tomcat.apache.org/download-55.cgi



Extract the .gz file then its new folder with the name : apache-tomcat-5.5.35 o



Open the tomcat folder then go the tomcat-user.xml




Create new user  in tomcat-user.xml



           

           

           

           

       

       

       

        



Save the tomcat-user.xml



By default tomcat takes the port number 8080, if port number already busy with some other server you can change the tomcat port number in server.xml

Please replace the port 8080 to 8088 (some other port number)




Save the file, to start you tomcat server go the console

Change directory to : /opt/apache-tomcat-5.5.35/bin/startup.sh



When you enter the server gets started.


Open the browser type the url :http://localhost:8088, then it gives server welcome page.



When on Tomcat Manager it ask user name and password, please enter your tomcat use rname and password.



Then it display all the projects which you deploy in the server.




To create hello world example first create the java project in the eclipse




Click on finish, Then right click on your project create new folder with name
 WEB-INF
           |
           | ----classes(folder)
           |
           | ----lib(folder)
           |       |------ servlet-api.jar
           |
           |---- web.xml

Change source folder bin to classes and set the your servlet-api.jar in the class path

Right click on your project then go the properties



Then to the Build path



Change the default output folder to the  helloworld/WEB-INF/classes


Setting servlet-api.jar in the classpath

Click on libraries tab, then select add jar



Open the xml file, copy the existing web.xml doc type and paste in the xml file


web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-              app_2_4.xsd"  version="2.4">

    <display-name>welcome servlet</display-name>

    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>

</web-app>



Create html file with the name index.html


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="hello">Click Here</a>
</body>
</html>


Create servlet WelcomeServlet.java


package com.jsl.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WelcomeServlet extends HttpServlet {

private static final long serialVersionUID = 1L;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

resp.setContentType("text/html");
PrintWriter out=resp.getWriter();

out.print("<html>");
out.print("<head><title>Welcome to servlet world</title></head>");
out.print("<body>");
        out.print("<h3>Welcome to Servlet world! Today date is :"+new Date()+"</h3>");
out.print("</body>");
out.print("</html>");
}
}



Configure the servlet int the web.xml (deployment descriptor)



 <servlet>
    <servlet-name>welcome</servlet-name>
    <servlet-class>com.jsl.servlet.WelcomeServlet</servlet-class>
   </servlet>
 
    <servlet-mapping>
    <servlet-name>welcome</servlet-name>
    <url-pattern>/hello</url-pattern>
    </servlet-mapping>



Now everything is ready, We need to deploy the project into server

Go to the : /opt/apache-tomcat-5.5.35/conf/Catalina/localhost

and create  somename.xml [welcome.xml]

open the .xml file

 <Context docBase="/home/miani/Desktop/servlet/helloworld" reloadable="true"/>


 Start the server : http://localhost:8088/manager/html

Your project will be display on Tomcat web application Manager



 Select your project and click then it opens the welcome page



Click on hyper link it show the servlet output on the browser



Example with the Httpservlet


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Registration Form</title>
</head>
<body>
<form action="registration" method="post">
<pre>
username:<input type="text" name="userName">
emailid :<input type="text" name="email">
password:<input type="password" name="password">
Gander: <input type="radio" name="sex" value="Male" />Male<input type="radio" name="sex" value="Female" />Female
<input type="checkbox" name="lang" value="en" checked />English<input type="checkbox" name="lang" value="noen" /><span>Non English</span>
<input type="submit" value="submit">
</pre>
</form>
</body>
</html>



RegistrationServlet.java



package com.jsl.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.catalina.tribes.util.Arrays;

 public class RegistrationServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String name=req.getParameter("userName");
String email=req.getParameter("email");
String password=req.getParameter("password");
String sex=req.getParameter("sex");
String arr[]=req.getParameterValues("lang");
PrintWriter out=resp.getWriter();
resp.setContentType("text/html");

                        out.println("<html>");
out.print("<head><title>Welcome page</title></head>");
out.print("<body>");
out.print("<h3> Welcome ! "+name+"</h3>");
out.print("<table border='2'>");
out.print("<tr><td>Name:</td><td>"+name+"</td></tr>");
out.print("<tr><td>Email:</td><td>"+email+"</td></tr>");
out.print("<tr><td>Password:</td><td>"+password+"</td></tr>");
out.print("<tr><td>Sex:</td><td>"+sex+"</td></tr>");
out.print("<tr><td>Language:</td><td>"+Arrays.toString(arr)+"</td></tr>");
out.print("</table>");
out.print("</body>");
out.print("</html>");
}
}

web.xml



 <servlet>
  <servlet-name>registrationInfo</servlet-name>
  <servlet-class>com.jsl.servlet.RegistrationServlet</servlet-class>
  </servlet>
  <servlet-mapping>
  <servlet-name>registrationInfo</servlet-name>
  <url-pattern>/registration</url-pattern>
  </servlet-mapping>

Wednesday, August 22, 2012

Reading file using FileReader

package com.jsl.core.io;
import java.io.BufferedReader;
import java.io.FileReader;
public class ReadingFile {
  public static void main(String[] args) {
   try{
    FileReader fr=new FileReader("info.txt");
    BufferedReader br=new BufferedReader(fr);
    String data=null;
    while((data=br.readLine())!=null){
     System.out.println(data);
    }
    br.close();
    fr.close();
   }catch(Exception e){
    e.printStackTrace();
   }
   
  }
}

Program to count the occurrence of word in the given file 


package com.jsl.core.io;

import java.io.BufferedReader;
import java.io.FileReader;

public class ReadingFile {
  public static void main(String[] args) {
   try{
    FileReader fr=new FileReader("info.txt");
    BufferedReader br=new BufferedReader(fr);
    String data=null;
    int count=0;
    while((data=br.readLine())!=null){
     String words[]=data.split(" ");
     for(String word:words){
      if(word.toLowerCase().contains("java"))
       count++;
     }
    }
    System.out.println("The count is :"+count);
    br.close();
    fr.close();
   }catch(Exception e){
    e.printStackTrace();
   }
   
  }
}

Creating and writing content into the file java 1.7 example 


package com.jsl.core.io;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class CreatingFileByWriter {

  public static void main(String[] args)  {
   String message="Welcome to core java world";
   try(FileWriter writer=new FileWriter("myfile.txt")){
     BufferedWriter bf=new BufferedWriter(writer); 
     bf.write(message);
     bf.close();
     System.out.println("DONE");
   } catch(IOException  e){
    System.out.println(e);
   }
  }
}

Serialization example


package com.jsl.core.io;

import java.io.Serializable;

public class Product implements Serializable {
  private int id;
  private String name;
  private double price;
  public Product(int id, String name, double price) {
   super();
   this.id = id;
   this.name = name;
   this.price = price;
  }
  @Override
  public String toString() {
   return id+" "+name+" "+price;
  }
}



package com.jsl.core.io;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.Scanner;

public class Manager {
  public static void main(String[] args) {
   FileOutputStream fis=null;
   ObjectOutputStream ois=null;
   
   try{
    fis=new FileOutputStream("product.txt");
    ois=new ObjectOutputStream(fis);
    for(;;){
     Scanner sc=new Scanner(System.in);
     System.out.println("Enter the pid");
     int id=sc.nextInt();
     System.out.println("Enter the price");
     double price=sc.nextDouble();
     System.out.println("Enter the name ");
     String name=sc.next();
     
     Product p=new Product(id, name, price);
     ois.writeObject(p);
     
     System.out.println("Do u want to continue.... yes /no");
     String ch=sc.next();
     if(ch.equals("no"))
      break;
    }
    
   }catch(Exception e){
    e.printStackTrace();
   }finally{
    try{
     ois.close();
     fis.close();
    }catch(Exception e){
     System.out.println("While closing :"+e);
    }
    
   }
   
  }
}


Reading the object from the file:



package com.jsl.core.io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class ReadingObjects {
  public static void main(String[] args) {
   FileInputStream fis=null;
   ObjectInputStream ois=null;
   try{
    fis=new FileInputStream("product.txt");
    ois=new ObjectInputStream(fis);
    Product p;
    while((p=(Product)ois.readObject())!=null){
     System.out.println(p);
    }
   }catch(Exception e){
    System.out.println("End of File");
   }
   
  }
}

Emplouyee.java

package com.jsl.core.io;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

public class Employee implements Externalizable {
 private int empno;
 private String email;
 private String password;
 public Employee() {
  // TODO Auto-generated constructor stub
 }
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(empno);
  out.writeObject(email);
 }

 @Override
 public void readExternal(ObjectInput in) throws IOException,
   ClassNotFoundException {
   this.empno=(in.readInt());
   this.email=((String)in.readObject());
  
 }

 public String getEmail() {
  return email;
 }

 public void setEmail(String email) {
  this.email = email;
 }

 public String getPassword() {
  return password;
 }

 public void setPassword(String password) {
  this.password = password;
 }

 public int getEmpno() {
  return empno;
 }

 public void setEmpno(int empno) {
  this.empno = empno;
 }
  
}


package com.jsl.core.io;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class EmpManager {
  public static void main(String[] args) {
   FileOutputStream fis=null;
   ObjectOutputStream ois=null;
   
   try{
    fis=new FileOutputStream("employee.txt");
    ois=new ObjectOutputStream(fis);
    Employee e=new Employee();
    e.setEmpno(1001);
    e.setEmail("lakshman@jsltech.com");
    e.setPassword("xyxabc");
    
    Employee e1=new Employee();
    e1.setEmpno(1002);
    e1.setEmail("hari@jsltech.com");
    e1.setPassword("abcxyz");
    
    ois.writeObject(e1);
    ois.writeObject(e);
    
    
   }catch(Exception e){
    e.printStackTrace();
   }finally{
    try{
     ois.close();
     fis.close();
    }catch(Exception e){
     System.out.println("While closing :"+e);
    }
    
   }
   
  }
}


package com.jsl.core.io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class ReadingObjects {
  public static void main(String[] args) {
   FileInputStream fis=null;
   ObjectInputStream ois=null;
   try{
    fis=new FileInputStream("employee.txt");
    ois=new ObjectInputStream(fis);
    Employee emp;
    while((emp=(Employee)ois.readObject())!=null){
     System.out.println(emp.getEmpno());
     System.out.println(emp.getEmail());
     System.out.println(emp.getPassword());
    }
   }catch(Exception e){
     System.out.println("End of File");
   }
   
  }
}

Files and I/O Examples


  1. Creating the file using FileOutputStream
  2. Reading the file
  3. Reading and Writing file
  4. Reading Multiple files data using SequenceInputStream 
  5. Reading file using FileReader

     

           

          The java.io package contains nearly every class you might ever need to perform input and output (I/O) in Java. All these streams represent an input source and an output destination. The stream in the java.io package supports many data such as primitives, Object, localized characters etc.

           A stream can be defined as a sequence of data. The InputStream is used to read data from a source and the OutputStream is used for writing data to a destination.

Questions

What is the output?

package com.jsl.core.basic;
public class Welcome{
  static int a=printMessage();
  static{
   System.out.println("Static block :" +a);
  }
  public static void main(String miani[]) {
   System.out.println("Main Method");
  }
  private static int printMessage() {
    System.out.println("The print message method :"+a);
    return 100;
  }
}
What is output?

package com.jsl.core.basic;
public class Welcome{
  static{
   System.out.println("Static block 2" );
  }
  public static void main(String miani[]) {
   System.out.println("Main Method");
  }
  static{
   System.out.println("Static block 1");
  }
}
What happens when you compile and execute the program ?

package com.jsl.core.basic;

public class Welcome{
  int a=100;
  static{
    a=a++ + a++;
  }
  public static void main(String miani[]) {
    System.out.println("Main Method "+a++);
  }
  static{
   System.out.println("Static block "+a);
  }
}

What happens when you compile and execute the program?

package com.jsl.core.basic;
 public class Welcome{
    int a=100;
    static{
     int a;
     a=a++ + a++;
     System.out.println("The value of a is : "+a);
    }
    public static void main(String miani[]) {
     System.out.println("Main Method ");
    }
    static{
     System.out.println("Static block ");
    }
 }
What happens when you compile and execute the program?

package com.jsl.core.basic;
public class Welcome{
    int a=100;
    static{
      int a;
      a=a++ + a++;
      System.out.println("The value of a is : "+a);
    }
    public static void main(String miani[]) {
     System.out.println("Main Method ");
    }
    static{
     System.out.println("Static block ");
    }
}

Tuesday, August 21, 2012

Reading Multiple files data using SequenceInputStream Object


package com.jsl.io;

import java.io.FileInputStream;
import java.io.SequenceInputStream;
import java.util.Vector;

public class ReadingData {
 public static void main(String[] args) {
  FileInputStream fis1 = null;
  FileInputStream fis2 = null;
  SequenceInputStream seq = null;
  try {
   fis1 = new FileInputStream("One.txt");
   fis2 = new FileInputStream("one.txt");
   Vector vector = new Vector();
   vector.add(fis1);
   vector.add(fis2);
   seq = new SequenceInputStream(vector.elements());
   int ch;
   while ((ch = seq.read()) != -1) {
    System.out.print((char) ch);
   }
  } catch (Exception e) {
   e.printStackTrace();
  } finally {
   try {
    seq.close();
    fis1.close();
    fis2.close();
   } catch (Exception e) {
    e.printStackTrace();
   }
  }
 }
}

Reading file and writing into another file


package com.jsl.io;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class ReadingFileContent {
  public static void main(String[] args) {
    FileInputStream fis=null;
    BufferedInputStream bis=null;
    FileOutputStream fos=null;
    BufferedOutputStream bos=null;

    try {
       fis=new FileInputStream("One.txt");
       bis=new BufferedInputStream(fis);
       try{
         fos=new FileOutputStream("Two.txt");
         bos=new BufferedOutputStream(fos);
         int ch;
         while((ch=bis.read())!=-1){
           fos.write((char)ch);
         }
       }catch(Exception e){
          System.out.println("While opening new file :"+e);
       }
    } catch (Exception e) {
        System.out.println("While reading the file");
    }finally{
         try {
           bis.close();
           fis.close();
           bos.close();
           fos.close();
         } catch (IOException e) {
           e.printStackTrace();
         }
    }
  }
}

Reading the file content




package com.jsl.io;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class ReadingFileContent {
  public static void main(String[] args) {
    FileInputStream fis=null;
    BufferedInputStream bis=null;

    try {
      fis=new FileInputStream("One.txt");
      bis=new BufferedInputStream(fis);
      int ch;

      while((ch=bis.read())!=-1){
         System.out.print((char)ch);
      }
    } catch (Exception e) { 
       e.printStackTrace();
    }finally{
         try {
            bis.close();
            fis.close();
         } catch (IOException e) {
            e.printStackTrace();
         }
    }
  }
}

Creating the file using FileOutputStream



package com.jsl.io;

import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.FileOutputStream;

public class FileCreation {
  public static void main(String[] args) {
    FileOutputStream fos = null;
    BufferedOutputStream bos = null;
    
    try {
      fos = new FileOutputStream("One.txt", true);
      System.out.println("Enter the text");
      bos = new BufferedOutputStream(fos, 512);
      DataInputStream dis = new DataInputStream(System.in);
      char ch;
      while ((ch = (char) dis.read()) != '@') {
        int a = 1 / 0;
        bos.write(ch);
      }
   } catch (Exception e) {
      e.printStackTrace();
   } finally {
          try {
             bos.close();
             fos.close();
          } catch (Exception e) {
             System.out.println("While closing the file :" + e);
          }
   }
   System.out.println("End of main method");
 }
}



Inner classes in Java

A class inside another class inner or nested class
1. Nested class
2. Method local inner class
3. static inner class
4. Anonymous inner class


Nested Class


public class Outer {
  private String message="welcome to java inner classes";
  private class Inner{
    private String greetings="Hi! how are you?";
    public void display(){
      System.out.println(message);
    }
  }
  public void show(){
    System.out.println(message);
    System.out.println(new Inner().greetings);
  }
}
 
public class Outer {
  private String message="welcome to java inner classes";
  public class Inner{
    private String greetings="Hi! how are you?";
    public void display(){
      System.out.println(message);
    }
  }
  public void show(){
    System.out.println(message);
    System.out.println(new Inner().greetings);
  }
}
 
public class Manager {
  public static void main(String[] args) {
    Outer obj=new Outer();
    obj.show();
    /* Creation of the inner class object */
    Outer.Inner inner=obj.new Inner();
    /* Another way of creation of the inner class */
    Outer.Inner inn=new Outer().new Inner();
    inn.display();
  }
}
 
public interface Game {
  void play();
}
 
public class Car {
  public Game getGame(){
  return new MyGame();
  }

  private class MyGame implements Game{
    @Override
    public void play() {
      System.out.println("The Game is started");
    }
  }
}
 
public class GameMain {
  public static void main(String[] args) {
    Car c=new Car();
    Game g=c.getGame();
    g.play();
  }
}

 

Method local inner classes

class Example{
  public void printMessage(){
    final String greetings="Hi! how are you?";
    class User{
      private String message="Welcome to method local inner class";
      void print(){
        System.out.println(message+" "+greetings);
      }
    }
    User obj=new User();
    obj.print();
  }
}


public class MethodLocalInner {
  public static void main(String[] args) {
    Example obj=new Example();
    obj.printMessage();
  }
}

Static inner classes


class StOuter{
  static class StInner{
    void print(){
      System.out.println("Hello");
    }
  }
}

public class StaticInnerDemo {
  public static void main(String[] args) {
    StOuter.StInner obj=new StOuter.StInner();
    obj.print();
  }
}

Anonymous Inner Classes

interface One{
  void show();
}

public class AnonymousDemo {
  public static void main(String[] args) {
    
    One obj=new One() {
        @Override
        public void show() {
          System.out.println("Welcom to Bangalore");
        }
    };
    obj.show();
  }
}

Thursday, August 16, 2012

Struts 2 hello world example


Open the Eclipse


Creating new dynamic web project


Give some name for the project. And set the target run time server


 Select the check box to  auto generate web.xml



Welcome.java

package com.jsl.struts2;
public class Welcome {
            private String username;
             public String execute(){
                                    return "success";
             }
            public String getUsername() {
                        return username;
            }
            public void setUsername(String username) {
                        this.username = username;
            }
}

Web.xml



  welcome

  
      index.jsp
   

  
      struts2
      org.apache.struts2.dispatcher.FilterDispatcher
  

  
      struts2
      /*
  


index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
                        <s:form action="hello">
                                    <s:textfield name="username" label="Enter User Name"/>
                                    <br>
                                    <s:submit value="Enter"/>
                        </s:form>
</body>
</html>

welcome.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
                        <h1>Hi! welcome to struts2world : <s:property value="username"/> </h1>
</body>
</html>





Wednesday, August 15, 2012

Factory Method Design pattern

A factory method pattern is a creational pattern. It is used to instantiate an object from one among a set of classes based on a logic.






package com.jsl.core;
interface Instrument{
  public void play();
}

class Guitor implements Instrument{
  @Override
  public void play() {
   System.out.println("TIN TIN TIN TIN TIN TIN ......");
  }
}

class Piano implements Instrument{
  @Override
  public void play() {
   System.out.println("PPPPPPPEEE PEEEE PEEE .....");                  
  }
}

class InstrumentFacoty{
 public Instrument getInstrument(String name){
     Instrument obj=null;
     if(name.equalsIgnoreCase("Guitor"))
      obj=new Guitor();
     else if(name.equalsIgnoreCase("Piano"))
      obj=new Piano();
     return obj;
   }
}

public class FactoryMethod {
  public static void main(String[] args) {
   InstrumentFacoty obj=new InstrumentFacoty();
   Instrument ins=obj.getInstrument("piano");
   ins.play();
  }
}

Singleton Design Pattern

Singleton Design Pattern:

The singleton pattern is one of the simplest design patterns. it involves only one class which is responsible to instantiate itself, to make sure it creates not more than one instance; in the same time it provides a global point of access to that instance. in this case the same instance can be used from everywhere, being impossible to invoke directly the constructor each time.


Example:

package com.jsl.core;
import java.io.Serializable;
 
public class Singleton implements Serializable{
 
   private static final long serialVersionUID = 1L;
   private static Singleton obj;
 
   private Singleton() {
   }
 
   public static Singleton getObject() {
      if (obj == null) {
        synchronized (Singleton.class) {
          if (obj == null)
              obj = new Singleton();
        }
      }
      return obj;
   }
   @Override
   protected Object clone() throws CloneNotSupportedException {
    
     throw new CloneNotSupportedException("Object can't be created by using clone method");
                        
   }
}

Creating immutable object



Creating immutable object:


             String object are immutable objects, We can also create  immutable object in the following way...

package com.jsl.core;

final class Example{
 private final int count;
 
 public Example() {
  count=5;
 }

 public Example(int count){
  this.count=count;
 }

 public Example increment(int incrementVal){
  return new Example(this.count+incrementVal);
 }

 @Override
 public String toString() {
  return " "+count;
 }

}
public class ImmutableDemo {

  public static void main(String[] args) {

   Example e=new Example();
   System.out.println(e);
   System.out.println(e.increment(10));
   System.out.println(e);
  }
}

output:

5
15
5

Spring Boot 3 : JWT with SecurityFilterChain, AuthorizeHttpRequests, RequestMatchers

pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"...