달력

5

« 2020/5 »

  •  
  •  
  •  
  •  
  •  
  • 1
  • 2
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  
  •  
  •  
  •  
  •  


 

 

접속 경로

·       @WebServlet으로 서블릿 매핑한 경우

·       web.xml 서블릿 매핑한 경우

 

@WebServlet으로 서블릿 매핑한 경우

http://localhost:8080/프로젝트명/@WebServelt어노테이션명

http://localhost:8080/ServletMain/ServletInitParamEx01

 

서블릿 파일

@WebServlet("/ServletInitParamEx01")

 

 

 

 

web.xml 서블릿 매핑한 경우

http://localhost:8080/프로젝트명/url-pattern

http://localhost:8080/ServletMain/InitParamEx01

 

/ServletMain/WebContent/WEB-INF/web.xml

<servlet>

<servlet-name>ServletInitParamEx01</servlet-name>

<servlet-class>com.ch05object.ServletInitParamEx01</servlet-class>

<init-param>

<param-name>id</param-name>

<param-value>codedragon</param-value>

</init-param>

<init-param>

<param-name>pw</param-name>

<param-value>abcdefg12345</param-value>

</init-param>

<init-param>

<param-name>path</param-name>

<param-value>C:\\CodeLab\\workspace</param-value>

</init-param>

</servlet>

<servlet-mapping>

<servlet-name>ServletInitParamEx01</servlet-name>

<url-pattern>/InitParamEx01</url-pattern>

</servlet-mapping>

 

 

 

 

 


Posted by codedragon codedragon

댓글을 달아 주세요