The session is a global variable and is the proxy of the browser thread on the server side. As soon as the Web service program is open, the session will exist, and when you first visit, the session will automatically assign you one session ID, so
Javax.servlet.jsp.PageContext cannot is resolved to a type
javax.servlet.jsp.JspException cannot is resolved to a type
When I first learned jsp,servlet, I knew exactly when to add Servlet-api.jar and Jsp-api.jar,
Now with the Eclipse tool The
A. Method for event handling:
function Setreadonly (obj) {if (obj) {Obj.onbeforeactivate=function () {return false;};Obj.onfocus = function () {Obj.blur ();};Obj.onmouseover = function () {obj.setcapture ();};Obj.onmouseout = function ()
form.jsp
fckeditor application in form
showform.jsp
The application of fckeditor in form below two ways show, but request.setcharacterencoding ("Utf-8"); is used to solve Chinese
Servlet: Of course, in the servlet, the general jump occurs in Doget, Dopost and other methods.1) Redirect WayResponse.sendredirect ("/a.jsp");The path to the page is the relative path. Sendredirect can jump to any page, not necessarily limited to
Method One: It only works for a single stringString name=request.getparameter ("name");Name=new String (name.getbytes ("iso-8859-1"), "Utf-8");
method Two: Valid for the current pageRequest.setcharacterencoding ("GBK");String
1. Simple Label Introduction
Because the traditional label uses three label interface to complete the different function, appears too cumbersome, is not advantageous to the label technology promotion, the sun Company to reduce the label technology
Example of displaying dates by custom labels
(i) no text tag implementation
(1): Define label Processing class
Import java.io.IOException;Import Java.util.Date;Import Javax.servlet.http.HttpServletRequest;Import javax.servlet.jsp.JspException;Import
Declare the DOCTYPE that suit your needs.
Looking at the original code, you can see that the first line is:
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
Open some of the standard sites, such as the famous web design software developer
Sometimes there is a need for local refresh in web development, and the advantage of this is that it overcomes the situation that the overall refresh of the page is limited to the speed of the network.
The 1.MySQL datasheet is as follows (simple
Turn from: http://cantellow.javaeye.com/blog/372941
About the difference between the two I don't have to say, a lot of search, probably is:
Redirect is client jump, forwarding is server-side jump
The following statements are invoked in the servlet
The servlet can access objects such as Servletcontext,servletrequest and Servletresponse provided by the servlet container.
So how do you access these objects in the JSP ? For JSPs, these objects are called built-in objects or suppressed objects,
Eight, Simpletagsupport class
After JSP2.0, in order to simplify the difficulty of label development, you can use simpletagsupport for development;
1. Developing generic labels
Note the point:
(1) need to inherit Simpletagsupport class;
(2)
Search the Internet a lot of information, finally found a way to understand.
Because Tomcat is ISO8859-1 encoded by default. So he changed him into a GB2312 in the web.xml.
In the JSP, you need to put the charset=gb2312
Like what:
In JSP writing often in the page using variable direct output (eg.), sometimes to display information, sometimes as a JS parameter provided, and sometimes used to assemble the URL. Because of the existence of an escape character of the HTML language
1. Custom Label class:
javax.servlet.jsp.tagext.bodytagsupport--Import this Package
public class Subnodestag extends Bodytagsupport {/****/Private static final long serialversionuid = 1396571704883585147L;Private Bbsmessage bbsmessage;Private String
Scenario one, the interceptor adds no filtering for static resources (involving Spring-mvc.xml) Scenario two, using the default static resource handling servlet to handle static resources (involving Spring-mvc.xml, Web. xml)To enable
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