1. 종류 지시자 <%@ %> 페이지 속성 주석 <%– –%> HTML 주석 : F12에서 보임 JSP 주석 : 서버에서 실행되므로 안 보임 선언 <%! %> 변수(전역), 메소드 선언 표현식 <%= %> 결과값 출력 스크립트릿 <% %> JAVA 코드 액션태그 <jsp:action> </jsp:action> JAVAbin 연결
Category: JSP
Mapping Servlet
Plan 1. Modify web.xml <servlet-name> ; Can set any name <servlet-class> ; servlet path <url-pattern> ; url path <?xml version=”1.0″ encoding=”UTF-8″?> <web-app xmlns=”http://xmlns.jcp.org/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd” version=”4.0″> <servlet> <servlet-name>HelloServlet</servlet-name> <servlet-class>com.waterhouse.sample.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloServlet</servlet-name> <url-pattern>/testPath</url-pattern> </servlet-mapping> </web-app> Plan 2. Write in Servlet(java file) @WebServlet(name = “HelloServlet”, urlPatterns = {“/testPath”, “path2”}) name ; Servlet name urlPattenrs […]
How to make Servlet on IntelliJ
1. How to make Servlet? 1.1. Make Project on IntelliJ “Java Enterprise” – “Wep Application” – Next – Done 1.2. Make package Project – src – Right Click – New – Package 1.3. Make Servlet Project – src – ‘package(you make 1.2.)’ – Right Click – Servlet Set Name – ‘OK’ 1.4. Set urlPatterns The […]
Setup tomcat server on IntelliJ
1. Get Tomcat http://tomcat.apache.org/ 2. Set Tomcat on IntelliJ 2.1. New Project – Java Enterprise – Web Application Application Server : Set path to Tomcat Directory 2.2. Setup detail Tomcat Server When complete make new Project [Run] – Edit Configurations… You can modify HTTP Port, etc environment. 2.3. Run Tomcat Run – Run ‘Tomcat’ […]