JSP was first introduced in the past two days, and many things were hard to understand. The value of textarea cannot be obtained from JSP. For example, the Code of the JSP page is as follows:
remarks
Then use
String beizhu =
JS obtains Java variables.Method ①: var A = ""Method 2:Control HTML nodes through JS, such as document. getelementbyid ("name"), $ ("# name"). Val (), etc.
Java JS Value
Generally, a hidden form element is used in the form, and then the JS
JSP tutorial -- Application
In the previous article, we talked about using sessions in JSP to store private information of each user. However, sometimes the server needs to manage parameters for the entire application, this allows each customer to
// First: include command: When JSP is converted to servlet, the specified file is introduced // type 2: action element: introduce the specified file when the JSP page is requested // The second method can easily use to pass
Resources: Use Ajax pages (send and respond), one processing server page, and one reusable net. js.1. html 1.html pick a region Eastern Western Northern Southern
Doublecomboxml. XML (defines the XML response format and can be deleted after
One of the most important new functions of servlet API 2.3 is the ability to define filters for servlet and JSP pages. Filters provide a powerful and standard alternative to non-standard servlet links supported by some early servers.
A filter is a
Taglib. jsp
JSP tag paging code
select * from EMP, position where EMP. emp_position = position. position_id; select * from EMP, position where EMP. emp_position = position. position_id; = selectempall. rowcount}
There are three methods for passing parameters in the Action receiving form in struts2:
For example, the login form login. jsp:
Username:
Password:
1. Define form attributes in the action class. The two
First, let's introduce my news system: the basic information of news stored in the database, such as the title, publisher, release time, and name of the main news file. The news subject is a static page in HTML format (the first is to increase the
Because Ajax brings us too many benefits, we will give priority to this technology in many applications, so I am also attracted to it. I will share with you the next simple example.Regist. jsp file: a simple registration page
%> registration page
The first thing I want to talk about is that AJAX cannot upload files. I can think about how AJAX can transfer files through passing strings to communicate with the background? In fact, JS cannot operate files for security reasons. Therefore, it is
The following describes how to pass parameters between pages in JSP.
1. Add directly after URL request
For example, directly passing parameters
When using response. sendredirect for page redirection, you can also use the following code:
Response.
It is used to include static and dynamic resources on the current page. Once the contained page is executed, request processing continues on the call page. the contained page cannot change the response status code or set the header, which prevents
Before actual development, it is necessary to understand some basic theories of web development.1. url, urn, UriURL: Uniform Resource LocatorURN: Uniform Resource NameUri: Uniform Resource IdentifierURL: describes how to obtain Internet Resources in
TagThis label is used to access the "property" of the current file or its parent folder. "properties" are set in the "properties" dialog box in the "Browse" view of opencms.
Label description
Name
Description
Required
Name
I have found one for many websites and it is easy to use:
String queryresult = ...;
Response. setcontenttype ("application/CSV ");
Response. setheader ("content-disposition", "inline; filename =" result.csv "");
Printwriter out = new printwriter
The code in action is as follows:
Code highlighting produced by actipro codehighlighter (freeware)
Http://www.CodeHighlighter.com/
--> List alluser = This. getloginserviceimpl (). Find ();Request. setattribute ("user", alluser );Return Mapping.
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