Tomcat, Jeus, WepSphere
WAS (Wep Application Server)
Servlet
서버 어플리케이션의 조각들
환경변수 설정
JAVA_HOME = jdk 설치 위치
TOMCAT의 WEB-INF의 파일에는 직접 접근이 불가
-> 따라서 사용자는 Mapping & Annotation 되어 있는 /hello를 통해서 Nana.class에 접근
// Mapping
<servlet>
<servlet-name>na</servlet-name>
<servlet-class>Nana</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>na</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
// Annotation
@WebServlet("/hello")
public class Nana extends HttpServlet{
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter out = resp.getWriter();
out.println("Hello~~~~~~~~~");
}
}
|
cs |
'JAVA > Servlet & JSP' 카테고리의 다른 글
[JAVA] 정리 (0) | 2021.03.15 |
---|---|
[Servlet & JSP] 상태유지 (0) | 2021.03.13 |
[Servlet & JSP] GET 요청 + 쿼리 스트링 (0) | 2021.03.12 |
[Servlet & JSP] 한글 출력하기 + HTML 출력하기 (0) | 2021.03.12 |
[Servlet & JSP] 정의, 관계 (0) | 2021.02.07 |