. Create a web project testserviceThe directory is as follows:CN -- Test -- service -- impl
2. packages to be importedActivation-1.0.2.jarCommons-codec-1.3.jarCommons-httpclient-3.0.jarCommons-logging-1.0.4.jarJaxen-1.1-beta-8.jarJdom-1.0.jarLog4j-1.2.x.jarMail-1.3.3_01.jarSpring-1.2.x.jarStax-api-1.0.jarWsdl4j-1.5.2.jarWstx-asl-2.9.jarXbean-2.1.0.jarXbean-spring-2.2.jarXfire-all-1.0.jarXmlSchema-1.0.jar
3. Data publishing end(1) Compile the publi
The example in this article describes the custom label usage in JSP. Share to everyone for your reference. Specifically as follows:
Here a simple write a custom tag, the advantage of their own definition of the tag is in the JSP page can be used to define their own functions, completely separated from the Java code
1. tld files are as follows:
The first is to
Today to build the environment eclipse, a simple JSP page appears with this error: The superclass Javax.servlet.http.HttpServlet is not found on theJava Build path
.The reason is that the Tomcat runtime related classes are not being added to the Javaweb engineering class.The solution is as follows:Error file---->>build path---->>config build path---->>java Build path---->>libraries----> >add Library---->>server Runtime---->>tomcat7.0 finish is OK!W
. When we submit
Http://www.somesite.com/acjspbbs/dispuser.jsp?name=someuser
You can pop up a dialog box that contains your own cookie information. and submitted
Http://www.somesite.com/acjspbbs/dispuser.jsp?name=someuser
You can redirect to NetEase.
Because the script does not encode or filter malicious code when the value of the "name" variable is returned to the client, when the user accesses the embedded malicious "name" variable data link, the script code is executed on the user's brow
Small cases of JSP-Servlet implementation of online BBS Project
Project function: implements the function of common bbs Forum projects. Comments can be posted to other friends.
1. Create a database:The SQL statement is as follows:
create table `bbs`.`user`( `userid` INT not null auto_increment, `username` CHAR(20) not null, `userpassword` C
Packagetest;ImportJava.util.Scanner;/*function: Enter a number and show this number, less than 60, enter the loop, add 3 points per loop, and define a variable record added several times * * @author HYF **/ Public classJiafen { Public Static voidMain (string[] args) {Scanner input=NewScanner (system.in);//Create ScannerSystem.out.print ("Please enter your score:"); intScore=input.nextint ();//get the input score and save it in a variable intcount=0;//the number of cracksSystem.out.println
Copy dvrrdk to/usr/local/dvrrdk_03.00.00.00/target/rfs_816x and rename it DVR.
For example, after completing the QT environment configuration (refer to the LZ article above), open qtcreator "file"-> "open file or project"
Select the. Pro file to open the project. Click "project" and set it as follows:
"Tools"-> "b
First, let's look at the directory structure.
-- + Login---------- + WEB-INF----------------------- + Classes-Beans-Tags----------- + TLDsLogin is the JSP file in the main directory. In the example login. jsp, loginfailed. jsp, login_form.jsp, newaccount. jsp, welcome.
In a recent project, jsp (the preferred choice for SUN Enterprise Applications) is used to achieve user logon, and session persistence is of course used. This is implemented using the implements HttpSessionBindingListener interface. This is the brief code I wrote.Public class OnLineUser implements HttpSessionBindingListener {Private NewUser newUser = null;Public OnLineUser (){NewUser = new NewUser ();}
Publ
Published items can be placed under the webapps/in the Tomcat installation directory, but sometimes our catalog is ready to be mapped in the past.1, go to tomcat/conf/, open server.xml2, findUnpackwars= "true" autodeploy= "true" >Documentation at:/docs/config/valve.html---Documentation at:/docs/config/valve.htmlNote:the pattern used is equivalent to using pattern= "common"-prefix= "Localhost_access_log" suffix= ". txt"pattern= "%h%l%u%t quot;%rquot; %s%b "/>3, from here can see, the default dire
The reason is that the Tomcat runtime related classes are not being added to the Javaweb engineering class.The solution is as follows:Error file---->>build path---->>config build path---->>java Build path---->>libraries----> >add Library---->>server Runtime---->>tomcat7.0 finish is OK!Today this page appears again, this time the solution did not do tomcat loading, but the Pom added a jar of dependency:Problem Solving!Web Project
Http://www.somesite.com/acjspbbs/dispuser.jsp?name=someuser
Because the script does not encode or filter malicious code when the value of the "name" variable is returned to the client, when the user accesses the embedded malicious "name" variable data link, the script code is executed on the user's browser, which can result in user privacy disclosure. For example, the following links:
Http://www.somesite.com/acjspbbs/dispuser.jsp? Name=someuser
XXX.X
"java.io.UnsupportedEncodingException"%>"Java"pageencoding="UTF-8"%>"-//w3c//dtd HTML 4.01 transitional//en">"pragma"Content="No-cache">"Cache-control"Content="No-cache">"Expires"Content="0">"keywords"Content="Keyword1,keyword2,keyword3">"Description"Content="This is my page">"Center"> ""Method="Post"action="/jsp-day2/mvc/do.jsp"> "0"align="Center"> "text"Name="name">" +"> Password:" +">"Password"Name="pwd">"2"align="Center">"Submit"name="Submit"Value
="Request">"javabean2.jsp">
javabean2.jsp
"Com.anllin.bean.Person" %>Person person = (person) request.getattribute ("person");Out.print (Person.getname ());%>
Javabean in Session within rangeAfter the 1.Javabean object is created, it exists throughout the lifetime of the session, and the JSP file in the session now shares the
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.