4. jsp will eventually be converted to servlet for execution.5. jsp declaration format: , script segment format: , when the server converts JSP to servlet, will convert the Declaration in JSP to the classMember variable, and the script segment is
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 =
Package com. longweir;// An After paginationImport java. SQL .*;Import com. longweir. util .*;Public class pagebean {Private int pagesize = 5; // The number of records displayed per page is 5Private int currentpage = 1; // current page numberPrivate
Encoding settings in JSP:
1. pageencoding:
JSP page code: Code of the JSP file
2. contenttype:
Code displayed on the web page: the code displayed in the browser for the JSP output stream
3. html page charset:
Web page input encoding: font
When Using JSP, you will inevitably encounter Java Chinese garbled characters. There are different solutions for different situations. The following are the garbled issues I encountered and some solutions.
I. Garbled text caused by inconsistent
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
First case: Read and Write images in Java.
I wanted to find some code to test the method for accessing images in SQL Server. After the results were searched, I found that the process was too complicated, not based on the application in JSP. Today, I
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
Servlet-based Ajax
This is a common UI. When you select Zhejiang in the first selection box, Zhejiang city appears in the second selection box. When you select Jiangsu in the first selection box, the second option box shows the city of
When I deployed a test environment for the test group for the first time, I encountered a lot of problems. Almost all the pages could not be opened. The result showed that WebLogic was very strict with JSP verification, an error is reported when an
Level 3 in total. Select Department Division through the department and speciality through the department.
Rs = mydao.exe cquery ("select * from Department ");I = 0;For (Rs. Next ();! Rs. isafterlast (); RS. Next (), I ++) {%>">
After
1. How to access implicit object through ElEl can be used in two locations:A. template textB. attribute settings for standard and custom tags
Implicit objectRelated to the value range: applicationscope, sessionscope, requestscope, pagescopeRelated
Sun first proposed the servlet system, which allows Java programmers to develop Web applications based on B/S architecture, use the servlet class to encapsulate HTTP requests and responses in the standard Java class to implement various web
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.
I used to use eclipse in the past. I tried myeclipse this weekend, but I encountered a problem when I used it.
Tomcat can be started normally, and the index. jsp that comes with the new project can be displayed normally, but other JSP pages cannot
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
1. Request object
The request information of the client is encapsulated in the request object, so that the client can understand the customer's requirements and then respond. It is an instance of the httpservletrequest class.
Serial number method
JSP: Include include the output of other pages (Dynamic inclusion) during the North request of the Home Page)
The include command is different from the previous one. JSP code is inserted (static inclusion) before the main page is converted to
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