js| Package | data | database
Using beans in JSP to encapsulate the common features of a database
1. Create a Bean
Package guestbook; import java.sql.*; public class Sql_data { String sdbdriver= "Sun.jdbc.odbc.JdbcOdbcDriver"; String sconnstr=
JSP gets the session value problem from the action there are several ways:
For example, I have a session in action ("SessionID", "Sessionvalue")
First, use the struts tag to obtain:
Second, session is also one of the built-in objects, you can
one, JSP built-in objects (9 JSP built-in objects)The type of the JSP's built-in object reference nameRequest HttpServletRequestResponse HttpServletResponseSession HttpSession (with a switch: The value of the session property of the page instruction)
We all know that there are two forms of include in JSP, namely
The former is the instruction element and the latter is the behavioral element. Where exactly will they be used? How to use and what is the difference between them? This should be a
js| Error | Error handling
Error-handling page error.jspWeb applications typically have one or more unified error-handling JSP pages that provide a friendly form of feedback to the user in the event of a functional JSP page error. A friendly and
js| syntax
OverviewJava Server Pages (JSP) allows us to detach the static HTML and dynamic portions of the page. HTML can be written in any commonly used Web authoring tool and written in the same way as the original, where the code for the dynamic
Apache|js
Install j2sdk Either way, you must complete the J2SDK installation before installing and configuring the JSP engine. 1, install J2SDK under Windows, run the downloaded J2sdk-1_4_1_01-windows-i586.exe file directly, install to a directory
js| variable
To simplify the code in JSP expressions and scriptlets, there are 8 types of automatically defined variables, sometimes called implicit objects (intrinsic objects). They are: request,response,out,session,application,config,pagecontext,
js| Syntax Taglib instruction
Defines a tag library and its prefix for a custom label.
JSP syntax
Example
.
.
Describe
directive declares that the JSP file uses a custom label, references the tag library, and also specifies the prefix
js| syntax
Sets the value of the property in the bean.
JSP syntax
Name= "Beaninstancename"
{
property= "*" |
property= "PropertyName" [param= "ParameterName"] |
Property= "PropertyName" value= "{string | }"
}
/>
Example
Describe
js| Tutorials | Getting Started Tutorial JavaServer pages (JSP) is a java-based technology for creating dynamic Web pages that support Cross-platform and cross Web servers.
JSP is comparable to Microsoft's active Server Pages (ASP), but the JSP
js|servlet| email I'm here with version 1.2, add the related package (jar file) to the Classpath
Second: The program is very simple, do not need us to consider a lot of strata of things, because the API to help us do these things, the following is
Js|servlet| page | Auto Jump JSP has a directive that defines the JSP's error page and jumps to the page output error when this JSP page goes wrong
Log. Examples of the following:
The errorpage.jsp code looks like this:
.....
....
Output error Log
1. Find the binary data of the picture from the database, set the found data into the sessionRequest.getsession (). SetAttribute ("img", binary data of the picture);2. Write the data into the stream1 PackageCn.jbit.auction.web.servlet;2 3
Built-in objects: You can use them in script code and expressions without having to declare them in advance, with the following characteristics1. Provided by the JSP specification without being instantiated by the creator2. Provide Web container
jsp Technology Demo This is home Button btn = New button ("test Guide package");Date d = new Date ();SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-mm-dd HH:mm:ss");Out.println (sdf.format (d)); Local variables---in JSP are valid within the
Environment mysql + tomcat: create the following table in mysql and insert the image.The mysql. SQL file is as follows:Create table photo (Photo_no int (6) unsigned not null auto_increment,Image blob,Primary key ('photo _ no ')) place show. jsp in
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