Alibabacloud.com offers a wide variety of articles about simple java web framework, easily find your simple java web framework information here online.
; Publicclass MyWebServer { PublicStatic void Main (string[] args) throws exception{TODO Auto-generated method stubsServerSocket ss=New serversocket (9999); Set port number 9999while (true) {System. out. println ("Wait for connection on port 9999 ..."); Wait for a request to send overSocket s=ss.accept ();System. out. println ("Successfully connected on port 9999 ...");OutputStream Os=s.getoutputstream ();BufferedReader br=New BufferedReader (new FileReader ("e:\\webtest/hello.html"));String bfs
The following illustrates the common steps of Eclipse development Java EE-Configuring a simple Web application, with different versions of Eclipse likely to be slightly different, but with little or no major discrepancies.Take the "Eclipse-jee-luna-sr2-win32" + "apache-tomcat-8.0.21-windows-x86" version as an example, (as of the latest version as of May 2015):(De
A simple Java Web server implementation, relatively simple, based on java.net.Socket and java.net.ServerSocket implementation;Program execution steps
Create a ServerSocket object;
Call the Accept method of the ServerSocket object, wait for the connection, the successful connection will return a socket object, oth
editing (customer ......). The previous version of this system uses the servlet loop out. to facilitate this project and future development, I wrote a Java Web-based gridview in the afternoon. The original idea was to imitate ASP. net in the gridview write, but the time is not much, it is written a simple first use.
This s
JSP page, itself the server will also translate the page into a servlet page, so the request for the page is likely to be wrong, there will be a page similar to the followingThis is not friendly to the customer.1. JSP page You can configure the ErrorPage property in the @ Page Language="Java"Import="java.util.*"pageencoding="UTF-8" errorpage="errorpage.jsp" %>Jump to the error page ... It looks a lot better then.2. Configure
Java Web simple de login Registration
Recently I wrote a simple login Registration
The implementation result is as follows:
**************************************** * Part 1: effect *************************************** ****
Logon and registration page:
Login successful and registration successful page:
(Return to
use the following statement to generate a simple batch program:
Copy Code code as follows:
Set classpath=e:\bluemsun\tomcat\apache-tomcat\apache-tomcat-7.0.55\lib\servlet-api.jar;%classpath%
javac-d E:\bluemsun\tomcat\apache-tomcat\apache-tomcat-7.0.55\webapps\mm\WEB-INF\classes%1
Pause
The first sentence is to set the environment variable, and we all know that Tomcat needs mo
Mailsendmanager ();
Mainsendmanager.waitingmailremind ();
}
}
4. In the Contextinitialized method of listening for Servelet, write a timer, and let it schedule method to perform the Mailsendtask task described above.[HTML]View PlainCopy
When the listener starts executing, set a time
Timer timer = new timer ();
System.out.println ("-------MailSend timer begins execution--------------");
Mailsendtask msendtask = new Mailsendtask ();
Timer.schedule
SimpleWEB ServerA simple WEB server will be built by listing 9.2. of course, the other party's method and response events must also be improved. simple servers do not analyze and store request headers. the new WEB server will analyze and store requests to prepare for future processing. for this purpose, you must have a
this blog is original: Integrated still Silicon Valley (http://www.atguigu.com) System tutorial (deep thank) and network of existing resources (blogs, documents, books, etc.), the source of resources I will mark The purpose of this blog: ① summary of their own learning process, equivalent to study notes ② to share their own experience to everyone, learn from each other, communication, not commercial content inevitably appear problems, welcome to correct, exchange, discussion, you can leave a mes
I. OverviewTest1. Create a Cookie ObjectCookie Cookie1=new Cookie ("name", "XRK");2, call response a method to pass the cookie to the clientResponse.addcookie (COOKIE1);1. Obtaining CookiesCookie[] Cookies=request.getcookies ();if (cookies!=nullcookies.length>1) {for (Cookie cookie2:cookies) {Gets the name and value of the cookieOut.print (Cookie2.getname () + ":" +cookie2.getvalue ());Out.print ("}}else{Out.print ("No cookies are being created!") ");Cookie Cookie3=new Cookie ("name", "XRKKKK");
A simple Java Web server implementation, relatively simple, based on java.net.Socket and java.net.ServerSocket implementation;First, the procedure executes the procedure1. Create a ServerSocket object;2. Call the Accept method of the ServerSocket object, wait for the connection, the connection succeeds will return a so
The previous article wrote a simple Java Web server implementation, can only handle some static resource requests, this article implementation of the Servlet container based on the previous server made a small transformation, increased the processing of servlet requests.
Program execution steps1. Create a ServerSocket object;2. Call the Accept method of the Serv
It is well known that the communication between the Web server and the client is using the HTTP protocol. HTTP is a standard (TCP) for both client and server-side requests and responses. Because the HTTP protocol is based on the TCP protocol, I will use the socket in Java to complete this simple Web server. For more de
Path.contains ("login.jsp") anyway how accurate how to come not to say moreif (Path.indexof ("/login.jsp") >-1) {//Note: Login page must not filter or filter on ... Self-commissioning Don't be lazy! It's a deep memory.Arg2.dofilter (req, resp);Return} else {//If the filter is not login.jspif (password = = NULL | | "". Equals (password)) {Jump to landing pageResp.sendredirect ("login.jsp");} else {Have landed, continue this requestArg2.dofilter (req, resp);}}}public void init (Filterconfig arg0)
Google http://www.googto.com/1. FormsHere, the action in the form cannot take "/", without/representing the relative path, with "/" for absolute path, must be written/project name/url. 2, Web. XML configuration There must be a/in the url-pattern here, or it will error java.lang.IllegalArgumentException:Invalid 3. Logincontroller rewrite Dopost and Doget codeReference W3cschool in the servlet tutorialHttp://www.runoob.com/servlet/servlet-form-data.htm
Project members: Zhang Jinsheng Zhang ZhengRequirements Analysis:1. To carry out arithmetic;2. Calculation problem is random;3. Make a judgment of right and wrong;4. Integer operation.Program outline:1. Implement with JSP;2. Users can choose the number of topics;3. The answer page is listed in the form;4. Contains the input box to fill in the answer;5. After the answer, click Submit will directly show the correct error of the corresponding topic.Implementation process:The data structure mainly u
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.