javaweb--jsp

Source: Internet
Author: User
Tags java web

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.