tag
This label is used to create a correct link for the internal VFS resources. With this label, you can manually add the Web Name and Servlet name in the URL. In addition, if static export is set for a page, the URL with is automatically replaced
Three methods for page Jump in JSP and their differences
Redirection can be used to achieve the jump. After the jump, the page address becomes the address after the jump.
We already know there are two jump methods. Java
Code
The first
How to deploy Servlet and JSP1> use the J2EE/home/default-web-app directoryPlace all servlets in the J2EE/home/default-web-APP/WEB-INF/classes directoryYou can use this to access:Http: // : 8888/servlet/For example:Put servlet class my. helloservlet
Nine objects:
Built-in object (also called implicit object, with nine built-in objects ):CodeAnd can be used freely in expressions.
1-out:
Javax. servlet. jsp. jspwriter type, representing the object of the output stream. Scope: page (page
Escape encoding in JSP pageWhen I passed parameters in Chinese today, I was unable to pass the live encoding, so I thought of using escape.Request. getparameter could not receive the parameter, so he thought about how to receive the parameter.Tested
Before using JSP tags in opencms, you must declare tags in the JSP file and add the following content at the beginning of the JSP file:
@ Taglib prefix
=
"
CMS
"
Uri
=
"
Http://www.opencms.org/taglib/cms
"
%> label
This
JavaBeans is a reusable software component. In fact, JavaBeans are a Java class. By encapsulating attributes and methods, they become objects with certain functions or processing services, or beans for short.
A JSP page is composed of common HTML
Log4j is often used for log output during web development. The log level is frequently adjusted during software test run.
If you modify log4j. xml once and restart the web application, it is very troublesome.
The following program can implement
1. Javascript. Set a variable and submit it only once.
2 or Javascript: Set the submit button or image to disable 3 solve the problem of repeated submission in Web applications by using the struts synchronization token mechanism and the
After careful consideration, we found that when we entered hi.csdn.net/##in csdn, there was not a jsp PHP page, but it was directed to another place. Here ** the user name can be used to hide the address and pass parameters. Assign a path to each
4.4.3 bound attributes
The bound Property indicates that when the value of this property changes, the propertychange event is automatically triggered to notify other objects that the property has changed. The event encapsulates the attribute name,
In the past two days, I created a project JSP + hibernate + MySQL. During the query, the Chinese language was normal, but the Chinese data was inserted with garbled characters. So I found a filter on the Internet to solve the problem, in JSP, gb2312
1. Create a bean
Package guestbook;Import java. SQL .*;/*** Title: connect to the database with JavaBean* Description: encapsulate common database functions with bean and declare the bean in JSP.* Copyright: Copyright (c) 2001* Company: Speed
Private string projectname = "sz_pro"; // name of your project
// Obtain the absolute path of the current projectPublic String getporjectpath (){String nowpath; // The current Tomcat bin directory path, for example, D:/Java/software/Apache-Tomcat-6.
Response is an implicit object in the JSP page. Therefore, you can use response. sendredirect () in the JSP page to directly relocate the object.
Note:
(1) When response. sendredirect is used, no HTML output is available.
This is not absolute. The
Hello everyone, this is my first blog. Sorry for the poor writing.
I have been asking questions about the number of online users and the number of online users today. I have found many online users, but they are not very good. They have many
How to Set and obtain initialization parameters in JSP
Get init parameter in JSP page
By reawer 2008-8-13Initparamter access method 1 (built-in object ):
I. By servletconfig:Parameter1: {config. getinitparameter ("p1 ")}Parameter2: {config.
Image. jsp
Color getrandcolor (int fc, int BC ){Random random = new random ();If (FC> 255) fc = 255;If (BC> 255) BC = 255;Int r = FC + random. nextint (BC-Fc );Int G = FC + random. nextint (BC-Fc );Int B = FC + random. nextint (BC-Fc );Return new
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.