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 ()
Idea: Use filter to intercept servlet or JSP page content, such as content substitution, and then show users the modified pageThis can happen if you use normal filter to intercept page content
As you can see from the entry, the output does not go
We all know that there are two kinds of situations in JSP including the
The former is the instruction element and the latter is the action element. Exactly where they will be used. How to use and what difference they make. This should be a topic
JSP is Java server PAGE,J2EE is Java 2 Enterprise eidtion, they are the sun company built in the Java language of a server-side programming technology, in simple terms, it is used to dynamically generate web pages of a technology, Now the main
One, the JSP implied object1,jsp suppressed objects are instances of a set of classes that are managed by a JSP container load.
* JSP suppressed objects are defined in the _jspservice method, so they can only be used in expressions, scriptlet.2,jsp
Implied object of the JSP:
A set of objects that can be used directly without the need for new.
Tomcat is created automatically and can only be used in expression script and normal script .
1, request "key"
Type:
In the actual use of Struts2, CSS and JavaScript are often introduced into the JSP view page, which involves reference path issues. There are two types of paths, one is the relative path and the other is an absolute path. Let's talk about their
I. Introduction of Labels
In fact, we have used a few tags in the JSP, such as , , these tags are predefined, if we need to customize the label, we need to learn the label programming.
The advantage of label programming is flexibility +
1, with database software (such as: MySQL) to create a database, the database registered with the database name is just the data created
Library, if it is a data source name, ODBC configuration is required.
2, the driver will be placed in the
This garbled problem plagued me for half a month, has been too lazy to repair him, also does not affect the function, nothing more than the need to open their own notepad.
After a long time, found that no matter what type I use, utf-8 GBK gbk2312,
Code that connects an Access database in a Java Web that you just wrote. These days talking about database operations, but my book is XP Home version, install SQL Server is more cumbersome, simply get access to demonstrate it. Sometimes small
The use of empty in El expression
${list.time}${list.contenxt} Temporary no logistics information!
${key} or All Output key value when key is not empty. When key is empty, the output "all" rule: 1 if the key is null, returns True 2 if the key is
First, JSP action
Action is a special tag that enables the effect of multiple lines of Java code implementation through an action tag. You can insert files dynamically, Reuse JavaBean components, guide another page, and so on.
The action element
1. Client upload file
Client through a JSP page, upload files to the server, the JSP page must contain a file class form, and the form must be set enctype= "Multipart/form-data". An input stream is obtained by Request,request.getinputstream () the
Plugins: Ajaxfileupload.js
Jsp:
1, the introduction of the JS
2, write an input. For example
3, write the upload JS
Page Upload JS complete, now is the background
Next to my background part of the business, every day uploaded pictures are
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
At first I thought it was my SQL statement has a problem, after many experiments, in the Navicat test can pass, indicating that the SQL is not a problem.
Later the interrupt point found that the value returned is a JSP page error.
The
The three major scope objects of the servlet:
Request (HttpServletRequest)
Session (HttpSession):
Application (ServletContext): Tomcat was created when it was started, destroyed when Tomcat was shut down, and the entire Web lifecycle was only one
Through the browser's developer tools to view the Web page source code found that the path of resources such as css,js,img error, the path to the front of a more than one controller path, similar to:
http://localhost:8080/Project root/Controller
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