Use jquery's ajaxSubmit () to asynchronously upload images to save form data. The Demo code is as follows. If you are interested, refer to the following code and hope to help you (jsp needs to be introduced: jquery-1.9.0.js, jquery. form. js), jsp pages are produced by bootstrap, and you don't need to worry about the labels you don't understand. form forms are similar. The code is simple, just to demonstrate how to use ajaxSubmit to asynchronously upload images and save data. Please include it!
(References: http://www.jb51.net/shouce/jquery/jquery_api/Plugins/Form/ajaxSubmit.html)
I. web (add. jsp)
The Code is as follows:
<% @ Page import = "com. fingerknow. project. vo. UserInformation" %>
<% @ Page language = "java" contentType = "text/html; charset = UTF-8"
PageEncoding = "UTF-8" %>
<% @ Taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
Registered business area
<%
Response. setCharacterEncoding ("UTF-8"); // This is the encoding method.
Response. setContentType ("text/html"); // set the webpage type as text code
UserInformation user = null;
String username = "";
Integer userId = null;
If (request. getSession (). getAttribute ("userinfo ")! = Null ){
User = (UserInformation) request. getSession (). getAttribute ("userinfo ");
Username = user. getUsername ();
UserId = user. getUserId ();
} Else {
Username = "Please log on ";
}
%>
Largest Chinese shopping experience sharing platform
Homepage | help
Registered business area
©2012 fingerknow.com | privacy terms | Terms of Service | Guangdong ICP filing no. 12003619-1