There isJSPThe header Declaration of the page is like this. Pageencoding = "GBK" %> Now I want to introduce something in another package. I need to add one more sentence.ImportStatement: But run thisJSPError: Generated servlet error: Syntax
Recently, I learned JSP and encountered Chinese display problems like most beginners. There are two Chinese problems:
(1) The Chinese characters that appear on the page itself. The solution is to add
Or
You can also change the above gb2312 to GBK,
When I was a beginner in JSP, I was dizzy with the value transfer problem. After I checked some information, I finally got quite open. It turned out to be so simple.
To sum up, in. JSP click to open a new window B. JSP, and pass the value of a
Java has gradually warmed up in recent years. With the introduction of Java SE 5 and Java SE 6, the future of Java is even more brilliant. However, Java-based JSP has been unable to lift the header before Java SE 5 was launched. The most important
If you want to test your JSP Application
Program Performance, then you can use jmeter, which is open by the Apache Software Foundation.
Source code . Jmeter allows you to develop test solutions to test accessible HTTP, FTP, and JDBC database
Project Environment:
From traditional operating systems to simplified operating systems. The tiles layout definition file contains dynamic files and static files.
Problem:
In the simplified operating system, the static file is displayed normally
JSP directly generates HTML files
The Touch version is defined as follows:
News. Template
untitled document
author: & nbsp; Release Date:
A class that generates HTML:
Import java. Io .*;
Public class writehtml
{
Document directory
HTML tags and JavaScript tutorial
HTML tags and JavaScript tutorial
Operations on files in JSP
JSPFile Operations
JSPFile operations are very important. To describe the attributes of a file, you must useFileClass, its
Dynamic include
Usage:
Note: It always checks the changes in the contained files. It is suitable for inclusion of dynamic pages and can contain parameters. It can be compiled before processing.
Cause: 1. The static include result is to introduce
Introduction to JSP sessions
Abstract: Although the session mechanism has been adopted in Web applications for a long time, many people still do not know the nature of the session mechanism, and even cannot correctly apply this
This is the test file I used to connect to MySQL. It is for reference only;
dbjsp. jsp // Start with tryTry{Connection con;Statement stmt;Resultset RS;// Load the driver. The following code loads the MySQL driver.Class. forname ("com. MySQL. JDBC.
During web development, we often encounter functional requirements for information modification. In this case, we provide a JSP page for users to display the current information and allow users to reset new values. On this page, the drop-down list
1. First, let's see how to get the current time and display the Code:
------------------------------------------------
Java. Text. simpledateformat formatter = newjava. Text. simpledateformat ("yyyy-mm-dd hh: mm: SS ");
Java. util. Date currenttime
It's okay to write a small probe to play, because it can only be embedded in the blog and so on, so this is just to get the user information, and I will write a powerful probe later.
The Code is as follows:
self-developed JSP probe mini edition:
This is simple and practical. I will share it with you here.Package page;Import java. util. List;Import java. util. vector;Public class pagination {Private int sumpagenumber;Private int sumitemnumber;Private int pagenumber;Private int showitemnumber;
I. jsp file: auto. jsp// Set the format and Character Set of output informationResponse. setcontenttype ("text/XML; charset = UTF-8 ");Response. setheader ("cache-control", "No-Cache ");Out. println (" ");For (INT I = 0; I Out. println ("" + (INT)
1. Request object
The request information of the client is encapsulated in the request object, so that the client can understand the customer's requirements and then respond. It is an instance of the httpservletrequest class.
Serial number method
I. servlet
We may often need to handle some Path Problems in the servlet, for example, to obtain the physical path of a file in the current application, or to know the specific path of a request, these methods are required.
1: Obtain the physical
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.