Briefly summarize:
Method= "Get",
String Output=new string (name.getbytes ("iso-8859-1"), "UTF-8");
%>
Method= "Post",
String name=request.getparameter ("name");
Here's how it works:
First, talk about the role of several encodings in Jsp/servlet.
JSP is essentially a servlet,jsp compile is a "class servlet"
When a JSP server compiles a JSP page, it first writes a servlet to parse the JSP page content, using to turn it into a servlet, a Java class
To access the JSP by file name, where the
Multiple annotations found at this line:
-The superclass "Javax.servlet.http.HttpServlet" is not found on the java
build Path
new JSP page old hint:
multiple annotations found at this line:
-The superclass " Javax.servlet.http.HttpServlet
Basis:
One. Introduction to JSP 1. Understanding: Java server page; Embed Java scripting language in HTML2. Compare servlet and JSP1 The servlet is suitable for business processing, and JSP is suitable for interface display2 The JSP file will
Attach GitHub address with Script circle part of the area, used to store the template Note 1, to have ID 2, type is text/html 3, {{Each list as value I}} Circle traversal range 4, {{value.xxx}}} to take value
Call Method: Template ("id",
Date issue
1. Get server-side current date:
[Copy to Clipboard] [ - ] CODE:
Date mydate = new Date ();
%>
2, to obtain the current year, month, day:
[Copy to Clipboard] [ - ] CODE:
Date mydate = new Date ();
int thisyear = mydate.getyear () + 1
Colleagues have developed a Firefox plugin, used to read card information contactless card, but the page will not call, after the data found in fact quite simple, that is, more pits.
Testing
embed is the loading of Plug-ins, Getcard () is
JSP has the following 9 built-in objects:
Request : represents the HttpServletRequest object, client requests. It contains information about browser requests and provides several useful methods for obtaining cookies, headers, and session
The C tag we use in web development is the core library in Jstl, providing common support for everyday tasks
: Setting variable values and Object properties
: Display variable contents in page
No label body:
Has the label body:
label Body
js| Display | online | online number/**
* Write the following Sessioncounter.java
* and compiled to Sessiioncounter.class
* Then put it on the classpath of your website
* Sessioncount (build this directory yourself) below
*/
Package
js| Solution | problem | show | Chinese
These two days under the Win98 apache1.3.9 plus Jserv and gnujsp1.0,jdk1.2.2,jsdk2.0Found that Chinese can not display correctly. Either garbled or wrong.After the Netizen reminds, summed up the following
js| problem I think JSP has a problem (next)
(Author: Small Longting main Blueski compiled December 22, 2000 14:22)
(Continuation of the article)
Problem #3: Simple work is still tiring
Even simple work, such as header and footer, is still
js| Compiling | The problem is the easiest way to do JSP precompilation so far (the "flick-a-switch" approach), and he has many points to the point where there are no meaningful flaws. If an error occurs during the compilation of a JSP or when it is
Principle: Add the runtime container, such as Tomcat.1, Project Right-click "Build Path", "Configure Build Path ..."2. Add the Tomcat runtime3, if found that the version of the JRE is not correct, can also be updated, as follows, I changed to jre8.0.
This article mainly introduces how to use sysdeo eclipse Tomcat launcher plugin to edit and debug JSP and Servlet. It is best to first refer to my previous article "Illustration using eclipse3.0.1 + lomboz3.0.1 + tomcat5.0.28 to develop jsp" series,
This article aims to correct some incorrect articles on the Internet!
Development steps:
First, create a class:
Inherit bodytagsupport
Then set the field generation Set Method
Class:
Package Org. pan. tags; import Java. io. ioexception; import Java.
implementation methods
Generally, two types of tags are used: the body part and the body part.
-- To implement tags without the body part, you must inherit the tagsupport class and implement the dostarttag () and doendtag () methods.
-- To customize
Cookie. jsp
cookie hello, visitors. Welcome to join us for the first time! enter the name: welcome to [ ! the registration time is:
Deal. jsp
used to write registration information to a cookie
Enter. jsp
guest name:
Doenter. jsp
Online. jsp
hello, the number of online users is: exit
Doout. jsp
Constents. Java
Package entity; public class constents {// static integer variable, used to save the number of online
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