About the JSP syntax of the small tip__js

Source: Internet
Author: User
Declaring an expression <%! in a JSP int a = 3; Global variables are defined in the%>.


<% int b = 3 in the JSP script segment; The variable declared by%> is a local variable.


The servlet is a single example. So the variables defined by declaring an expression have only one copy and are shared by the user client.


******************

When using the JSP's <%@ include file= "*.jsp"%> the statement containing the other page;
Cannot include in the included page:
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://"
+ request.getservername () + ":" + request.getserverport ()
+ path + "/";
%>

This java script segment. Otherwise it will fail.

*********************************

<jsp:forward > For a page to turn, the statements after that statement are not executed.


***********************************


<jsp:include > can also pass parameters to the included page when it is included. And <%@ include file= ""%> this thing is not to be done.



*********************************************************************************************************

The Request.getparameter () method and the Request.getattrbute () method are not the same. The data for the GetParameter () method is taken from the client, and
The data for getattribute () is set up on the server side itself. The setattribute () method generally appears in pairs with the GetAttribute () method.
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.