1. Prerequisites
Web-inf directory:
1. Web-inf is a secure directory for Java WEB applications. The so-called security is the client cannot access, only the server can access the directory
2. Web. XML: Project Deployment File
3, Classs folder, you can place *.class file
4, Lib folder, for storing the required jar package
2. Basic JSP syntax
JSP page Element composition: declaration, comment, static content, instruction, expression, small script
JSP directives:
1, page directive: usually at the top of the JSP page, the same page can have multiple page directives.
Import= "Contenttype=" "%>
2. include directive: Embed an external file into the current JSP file and parse the JSP statements in this page
<%@ include file= "URL"%>
Include Action:
<jsp:include page= "URL" flush= "True|false"/>
Difference:
<jsp:forward page= "URL"/>
Equivalent to
Request.getrequestdispatcher ("/url"). ForWord (Request,response);
<jsp:param name= "parameter name" value= "argument value"/>
Used with the forward action as a sub-label for the forward action
3. taglib directive: Use tag Library to define new custom tags and enable custom behavior in JSP pages
JSP declaration: <%! Java code (variables and methods)%>
JSP Comment: <%--comment content--%>
JSP script: <%jsp script%>
JSP expression: <%= expression%>
javaweb--jsp