원하는대로

관심분야에 대해 원하는 모든 것을 발행하는 곳

미정 자세히보기

공부 스걱스걱/웹

[웹프로그래밍] Servlet

ohsoou 2020. 12. 14. 15:45

eclipse 화면에서 perspective을 설정할 수 있다.

- 레이아웃을 설정하는 것이라고 보면됨

- java EE는 웹을 개발할 때 편리하게 짜놓은 레이아웃


다이나믹 웹을 하나 만들고, 웹어플리케이션 파일, 디렉토리 확인


servlet: url 요청을 처리하는 프로그램

url Mapping - http://localhost:8080/{프로젝트이름}/{URL Mapping값}


servlet 3.0 이상은 어노테이션으로 java 에서 작성 @WebServlet("/{url Mapping 값}")

servlet 3.0 미만은 web.xml에서 수정

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>exam25</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description></description>
    <display-name>TenServlet</display-name>
    <servlet-name>TenServlet</servlet-name>
    <servlet-class>exam.TenServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>TenServlet</servlet-name>
    <url-pattern>/ten</url-pattern>
  </servlet-mapping>
</web-app>

수강완료

'공부 스걱스걱 > ' 카테고리의 다른 글

[웹디자인] 첫 웹디자인  (0) 2020.12.17
[웹디자인] 와이어프레임 만드는 사이트  (0) 2020.12.17
[CSS] 태그 안보이게 하기  (0) 2020.12.17
[CSS] float 해제  (0) 2020.12.17
[CSS] 태그 속성 초기화  (0) 2020.12.17