How to use the dom4j of the JSP tutorial to read parse XML files
111cn.net China web first stop
" Untitled Document
Use dom4j to read XML files.dom4j
Package test.xml;
Import Java.io.File;Import Java.util.Iterator;Import
This article is to use the JSP servlet to upload the file function Oh, well crap don't say much we first take a look at this upload instance code.
1. Html Fileaction= "uploadimage.jsp" enctype= "Multipart/form-data"Target=_self> advertising photo
Web effects phttp://www.111cn.net/Web effects p.html target=_blank >jsp Tutorials struts2 Initialization and class creation Public Xmlconfigurationprovider () {This ("Xwork.xml", true);}
public class StrutsxmlconfigurationproviderExtends
Str = str. substring (int beginIndex); truncates the string whose length is beginIndex from the first letter, and assigns the remaining string to str;Str = str. substring (int beginIndex, int endIndex); truncate the string from beginIndex to
Configure the jsp environment in linux$180★Diamond reputation★Xinnet domain name registration Chinese. cn Chinese. China★Diamond reputation★Xinnet domain name registration Chinese. cn Chinese. China Today, I have successfully configured the JSP
Functions of JSP actionsJSP actions use tags in XML syntax to control the behavior of the Servlet engine. JSP actions can be used to dynamically insert files, reuse the JavaBean component, redirect users to another page, generate HTML code for the
-- GetParameter is of the String type. OrHttp://a.jsp? Id = 123Or the data submitted by a form.-- GetAttribute can be an object.-- GetParameter () is used to obtain the parameter value passed by POST/GET;-- GetAttribute () is used to obtain the data
If else is used in most programming languages in this way. Today we will briefly introduce the if else and multi-condition judgment in the jsp tutorial. Using the if Statement Using the if Statement Int value = 10;If (value> 0)Out. println
Because login. in the jsp form, the switch is specified through the action attribute. jsp is the JSP file in the response. select a logon user in jsp. After entering the password to submit the form, the client sends an HTTP request to the server,
Format tag library: Format ActionIf you have used the Java DateFormat and NumberFormat classes, the methods used in the following labels should look familiar, because the JSTL formatting action is created on these classes. These Java classes
Process controlLet's turn to the process control and condition marking of JSTL. If you have used conditions and flow control statements in any language, theoretically there is nothing new here.C: Test the if action processing simple condition
This article is based on the implementation of the tomcat platform. The file directory is:Under tom_homewebappsews:└ Html✓ WEB-INFClasses└ ComUsing FileMan. class└ FileServlet. classWeb. xmlOn the homepage, we first implement the file reading class:
Application and session are relatively simple. Here we mainly describe the scope of application and page.Application: global scope of action. The whole application is shared, that is, the same webApp in the deployment file is shared, and the
In jsp, post requests are generally not garbled. If the request is garbled, add the following sentence:Solution 1 The code is as follows:Copy code Request. setCharacterEncoding ("UTF-8 "); For get requests, if the url contains non-Western
I encountered a problem in the jsp download function. I don't know why:First, I made a jsp file: filedown. jsp hello download Then I made a servlet: DownloadServlet. javaImport java. io. BufferedInputStream;Import java. io. File;Import java. io.
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.