I. File Upload
Uploading files is a frequently used function in Web development. For example, uploading photos in the B/S-based personnel information management system and uploading images in the news publishing system ..... To implement the file
Code:
Code:
1. A. jsp
certificate code input page
the verification code generated by the system:
enter the above verification code:
2. image. jsp
Color getrandcolor
JSP generate WORD Documents[Date: 2006-12-18]
Source: http://www.gs008.com/blog/blogview.asp? Logid = 324
In the web-OA system, document management seems indispensable. Sometimes some data needs to be queried from the database and output in a
1. Set IIS 301
Internet Information Service Manager-> virtual directory-> redirect to URL, enter the target URL to be redirected, and select "permanent resource redirection ".
2. Code redirection in ASP 301
Response. Status = "301 moved
There are about three redirect Methods Using JSP:1. response. sendredirect ();2. response. setheader ("location ","");3.
The following rules are obtained after testing:
I. response. sendredirect ()
Out. Flush () is not allowed before this statement.
When developing the B/S mode, the client needs to execute a program to download the information submitted by the client to the local machine. My idea is to generate a file on the server, download it to the client, and delete it. The function is
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
Problem description: Java app file download function, Chinese garbled characters in the output file name
Test environment: Tomcat and websphere6.1
Method 1:
Response.Setcontenttype("Application/X-download");
Filename =
1. Make the browser not cache the page Filter
Import javax. servlet. *; import javax. servlet. HTTP. httpservletresponse; import Java. io. ioexception;/*** used to filter Browsers without caching pages */public class forcenocachefilter
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.
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.
The verification code written by a servlet is as follows:
It can generate 155 random interference lines, making it difficult for other programs to detect the authentication codes in the image.
The program code is as follows:
Package com.
This article describes the basic principles of the Struts 1.1 framework, as well as the installation of Struts 1.1 and a simple example.
1. Origin of struts
Struts is part of the Apache Jakarta project. The goal of this project is to provide an open-
Note that spring MVC is implemented through annotation. If you want to know how to use spring annotation, go somewhere else, or I will write a new article later!
Prerequisites: the jar package kaptcha-2.3.2.jar is required as
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.