For example:
Copy Code code as follows:
Hibernatetest.java
Import onlyfun.caterpillar.*;
Import net.sf.hibernate.*;
Import net.sf.hibernate.cfg.*;
Import java.util.*;
public class Hibernatetest {
public static void Main (string[]
JSP Tags:
Implementation Request Forwarding to add parameters to the above
El expression:
1. Get Variable data
Hello, ${name}
2. Get Array data
Hello, ${names[0]}
3. Get Collection data
names=new
Many JSP programmers have encountered such a situation, JSP page pass parameters to the servlet, as long as the parameters have Chinese is garbled, and most are?????? Garbled, tried the online more common methods are not good, and finally added a
Separate form from Action page
Button press, click or onclick event to trigger
Pass a unique parameter to the child page JSP,
Sub pages, responsible for querying and judging logic,
Jsp:forward tried, directly to the error
Copy Code code as
As long as in the JSP page if the following code on the line
=0 && new Date (). GetHours ()
Good Morning
Good afternoon
application Example:
Time Type: =0 && new Date (). GetHours ()
Data: [{
' label ': ' Morning ', '
value ': 1,
'
Sendredirect
Response.sendredirect ();
According to the logic, the server sends a status code, tells the browser to request a new address again, generally speaking, the browser will use all the parameters just requested again, so the
1. Use of beans
In order to use Benas in the JSP page, we must use the JSP action tag: Usebean
Usebean format:
When a JSP page containing a Usebean action tag is loaded on the server, the JSP engine first finds in a synchronized block, based on the
What is included:
In the development of the page, some code will inevitably have repeated use of the situation, such as a page has a section of code a,b page and C page can use a this code, then the B and C pages include a page, the natural A This
This content is also prepared according to the requirements of the business students. In fact, this small project is just graduated from the time to do, many times we want to perform the following sql/hql and then get an HTML table output:
Input:
String agent = Request.getheader ("user-agent");
StringTokenizer st = new StringTokenizer (agent, ";");
St.nexttoken ();
Get the user's browser name
String userbrowser = St.nexttoken ();
Get the user's operating system name
String Useros =
On the server side to determine whether the form is repeated, the main consideration in the page through the session to share the flag variable method to achieve, that is, in the client page set session in the flag variable, and then in the server
Many JSP beginners in learning simple JSP programming, often stay in the JSP inside the SQL statement to tune a JavaBean database connection stage, stalled.
This simple tutorial is expected to help beginners learn to use OOP ideas for JSP
1. This example mainly tells us how to use JSP actions in JSP code, such as
2. This example requires four files: login. Jsp,test. Jsp,ok.htm,no.htm
3. First look at login. Jsp
username password 4. test.JSP代码如下: String username=request.
1. Introduction
database applications, especially web-based database applications, often involve the storage and display of picture information.
Usually we use the method is to display the picture in a specific directory, in the database to save
In JEE6, the El expression in the JSP supports method calls with parameters. You can call it like this:
${foo.bar (Baz)}.
The latest implementation is Juel, you can download a trial. The following code is the test of how to use:
Have you ever wanted to send a dynamically generated image from a JSP page (or servlet)? This tip tells you how to do it. To run the code here, you need a tomcat or other Web server that supports JSP 1.1.
When a MIME type of a Web page with
Source code, a.jsp to b.jsp value:
a.jsp Page Content:
name:
b.jsp Page Content:
String name=request.getParameter("name"); %>
Phenomenon: Chinese garbled, such as "?????? ”
The workaround is as follows:
Method One:
1. In b.jsp,
Application is an instance of the Javax.servlet.ServletContext interface, which actually represents the context of the entire servlet.
Common methods for application objects:
The above method is application, of course, in addition to the above
When this page appears, the controller must be found, just trying to parse the Viewresolver parsing attempt failed, for two reasons1. The resource hello.jsp file is not actually placed in the Web-inf directory2, the resource file is placed in the
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