In the previous article, tofu once said a JDBC-ODBC bridge to connect the database of the article a JavaBean (can be called in the Jsp), because the efficiency of this connection to the database is very low, so everyone actually in the use of the
(iv) Tomcat
1, with WinZip, such as decompression software to Tomcat.zip to a directory, I unzipped it to C:\, it will automatically
Create Tomcat subdirectories, so that in the C disk more than a directory c:/tomcat, I use $tomcat logo;
2, open
On a classic web site, visitors can browse through several pages and perform some interactive behavior. If you are writing such a website, it is very useful to use some data from each user. For this purpose, we can use the "sessions" in the
For example, from the Blazix server's logo library in your system environment can not be used, so do not use the logo library to achieve similar functions? This tutorial is proposed for this issue. This problem can be solved, but the code should be
In the previous tutorial we have used "out" variables to produce HTML output in a scriptlet. For more complex HTML, we lose many of the advantages of JSP programming if we still use the "out" variable. In fact, we can simply implement scriptlets and
There are two things that are passed between the servlet and the JSP: the JSP-> servlet, the servlet-> jsp.
The pass value is completed through object request and session (regardless of application).
First, JSP-> servlet
JSP page There are 3 ways
1. Descending jump per second
Copy Code code as follows:
2. Using the Response.setheader function
Copy Code code as follows:
3. Using META tags
Copy Code code as follows:
Do you want to create a mail delivery collection tool in your JSP? The following is an introduction to the JSP to create a mail delivery collection tool. In this article you can learn some of the key points of the JavaMail API and how to use it in a
Directory structure: JSP import jquery file, always do not work, because:
Copy Code code as follows:
It cannot access files in the/web-inf/directory, so it is necessary to place the loaded JS file in the WebApp
See a very good article, "in the sky Cat, what is the front end?" ", there are days in the cat PHP to determine the mobile device (personal guess), feel very good, so decided to migrate to the JSP inside.
The JSP file name is index.jsp, actually
Question: JSP wants to output the Chinese to be shown as "? ”
Workaround: Search for JSP in eclipse-windows-preferences, encoding option to select Chinese. This creates a new JSP file that will support Chinese display.
The existing JSP files are
First, File uploadUploading files is a feature that is often used in web development: for example, uploading photos in the HR information Management system based on B/s, uploading pictures in the news release system and so on. To implement the file
Code fragment in action
Copy Code code as follows:
private string epid;//global variable gets a comma-delimited string
Public String Getepid () {
return epid;
}
public void Setepid (String epid) {This.epid = Epid;}
Public
Action Code Fragment
Copy Code code as follows:
Public String execute () {
String ret = Super.execute ();
if (Return_list.equals (ret)) {return list ();} else {return ret;}}
Public String list () {String show = This.getrequest ().
With the development of Web technology, Web content is from static pages to content-rich dynamic pages. Dynamic page generation is a challenge for the vast majority of web developers. There are many ways to try to solve this problem, such as plug-in
JSON has been described in detail in the previous article, and JSON is straightforward and fast. And it blends well with JavaScript.
The JSP paging problem can be done well without the need to add a jar.
The following is a detailed description of
HttpServletLet's review the class structure diagram mentioned in the previous section:
As you can see, HttpServlet inherits Genericservlet, but it is also an abstract class that cannot be used directly and can only be inherited.
There are two
You can set the redirect page with a filter when the session expires
Copy Code code as follows:
public class Actionfilter extends HttpServlet implements Filter {
Private Filterconfig Filterconfig;
public void init (filterconfig config)
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.