JSP Study Notes

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

Difference between forward and sendRedirect for pages in jsp

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

Jsp enables instant display of uploaded images

Copy codeThe Code is as follows:

Access servlet sharing in Struts2

I. access or add request/session/application attributes Copy codeThe Code is as follows:Public String scope () throws Exception { ActionContext ctx = ActionContext. getContext (); Ctx. getApplication (). put ("app", "Application Scope"); // Add the

Code for implementing user login Interaction Using j2e-j2ee

Server code:LoginServlet:Package com;Copy codeThe Code is as follows:Import java. io. ByteArrayOutputStream;Import java. io. DataOutputStream;Import java. io. IOException;Import java. io. OutputStream;Import javax. servlet. ServletException;Import

A simple example of a JSP custom tag

tld

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

JSP bean obtains various parameters

1. Package:Copy codeThe Code is as follows:Package beanpackage;/**** @ Author lucifer*/Public class SystemProperties {Public String getRuntimeEnvironmentVersion (){Return System. getProperty ("java. version ");}Public String

Jsp page display usage

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"

Five JSP page Jump Methods

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.

Jsp does not support EL expressions. Solution

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.

Create unlimited Tree Code with pure jsp

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

Summary of hibernate data update Methods

Copy codeThe Code is as follows:Usertable user = null;Session session = HibernateSessionFactory. getSession ();String SQL = "from Usertable as user where user. username =? ";Query q = session. createQuery (SQL );Q. setString (0, username );List l =

Java intercepts strings (determining Chinese characters)

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

JSP static page generation practices and design ideas

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

What does eclipse mean?

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

A simple solution for JSP RePort Printing

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

JSP errorPage setting method

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 );

Introduction to response. setHeader parameters and usage

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

Three methods for displaying Chinese Characters in Web programs in JSP development

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

Configure Hibernate as JNDI on Weblogic

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

Total Pages: 1800 1 .... 808 809 810 811 812 .... 1800 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.