1. When declaring a variable: (generate the variable into a member variable of the servlet class, multiple clients share one copy) and when using (only a local variable in a method, each client has one), try to avoid declaring a variable as a
Page jumps can be achieved in two ways: forward and sendRedirect.Forward: it can be used in JSP pages and implemented in Servlet.Use On the jsp page. For example, to jump to userlist. jsp, you can write:Copy codeThe Code is as follows: Use the
Using custom tags in JSP can achieve this purpose. In fact, all the frameworks we know are basically implemented in the form of custom tags.By using custom tags, We can display complex logic on pages with simple tags. Next we will implement a very
Dynamically set read-only/read-write for a component on the pageDocument. getElementById ("custName"). readOnly = false;Document. getElementById ("custName"). readOnly = true;Dynamically hide/display a widget on the pageTdid. style. display = "block"
1. RequestDispatcher. forward () Is used on the server. When forward () is used, the Servlet engine transmits the HTTP request from the current Servlet or JSP to another Servlet, JSP or common HTML file, that is, your form is submitted to. jsp, in.
If the following content exists, it indicates Servlet 2.3/JSP 1.2."-// Sun Microsystems, Inc. // DTD Web Application 2.3 // EN"Http://java.sun.com/dtd/web-app_2_3.dtd>By default, Servlet 2.3/JSP 1.2 does not support EL expressions, whereas Servlet 2.
Tree creation is not complex, but we usually do two or three layers. Such data generally comes from multiple tables, such as departments and employees.However, this self-join table does not have a definite hierarchy and may be an infinite
Copy codeThe Code is as follows:/*** The intercepted string len is a byte length.* @ Param str* @ Param len* @ Return* @ Throws UnsupportedEncodingException*/Public static String getLimitLengthString (String str, int len ){Try {Int
Introduction:Let's compare two large websites:51job and Zhaopin (first, I declare that I am not making advertisements for them. I only use them as an example for technical comparison)51job uses a relatively "advanced" php technology, while Zhaopin
Eclipse is an open-source and Java-based scalable development platform. In itself, it is only a framework and a set of services, used to build a development environment through plug-in components. Fortunately, Eclipse comes with a standard plug-in
1. Create a report style in Word or Excel.The Row Height and column width in Excel cannot be expressed in mm or cm.Computing required. In 1024*768, 1CM is about 38 pixels.Based on this, you can calculate and control the row and column positions of
1. Set errorPage: errorPage. jspCopy codeThe Code is as follows: JSP Page Error ~! 2. ApplicationCopy codeThe Code is as follows: // go JSP Page Boolean tf = true;If (tf ){String info = getServletInfo ();Throw new Exception ("Exception in:" + info );
Meta is used to simulate HTTP Response Header packets in HTML documents. Meta Tags are used in and 1. describes generation tools (such as Microsoft FrontPage 4.0;2. describe KEYWords Of Your webpage to search engines;3. tell the search engine
Method 1: the simplest and most commonly used method Or here, you can use gb2312 or gbk, which is only a string of many characters supported by gbk than gb2312.This method is used to display Chinese characters on the jsp page.Method 2: Use a filter
1. First, you need to put the jar packages and configuration files used by Hibernate on the classpath path that Weblogic can search. Many people are confused about this step. In fact, let's take a closer look at the startup script files
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.