Tomcat Settings default startup Project
Tomcat sets the default startup project, as the name suggests, so that you can access our project by typing ip:8080 in the browser's address bar. The specific actions are as follows:
1. Open Tomcat's installation root directory, find Tomcat 6.0\conf\server.xml, open the file, locate 2. Put the WebTest project under the Tomcat root directory and delete or rename the root folder in the WebApps folder to another name.
3, start Tomcat, in the browser input ip:
This article is a beginner's tutorial on building a Java Web project under MyEclipse. Illustrated, very detailed. The version of MyEclipse used is 7.5.First step: Create a new web Project, such as.In the second step, fill in the popup window below. Project name fills in the item names; specification Level select
Sometimes we need to get a connection in the Java program and then parse the connection and get the result of the content returned by the connection. To be exact is to parse a link.The following code when parsing Baidu homepage link, get the effect of HTML code: 1 Public StaticListgeturlcollection (String address) {2listNewLinkedlist();3 Try{4URL url =NewURL (address);5URLConnection conn =url.openconnection ();6 Conn.connect ();7Inp
("ten");Thread.Sleep (10000);ed.setsize (1000,1000); //create a new imagebufferedimage Image =newbufferedimage (Ed.getwidth (), Ed.getheight (),Bufferedimage.type_int_argb); //paint the editor onto the imageswingutilities.paintcomponent (Image.creategraphics (),Ed,Newjpanel (),0,0, Image.getwidth (), Image.getheight ());//save the image to fileImageio.write ((renderedimage) image, "PNG", NewFile ("Html.png"));System.out.println ("OK"); }}The above is the introduction of several pages saved as
/*** Extract the value of a specific input from the page *@paramFormparams *@paramDocument *@paramElementID*/ Private voidAddformhiddenelementvalue (listFormparams, document document, String ElementID) {element element=document.getElementById (ElementID); if(Element! =NULL) {String elementvalue= Element.attr ("Value"); Formparams.add (NewBasicnamevaluepair (Elementid,elementvalue)); } } /** * Get the document instance for the corresponding URL
There are get,post two ways to request HTTP. Here, use the Get method to request "https://www.baidu.com".Introduction of Appache httpclient bag, http://hc.apache.org/httpcomponents-client-4.5.x/download.htmlPost Code Firstpackagetest;importjava.io.ioexception;importorg.apache.http.httpentity;import org.apache.http.httpresponse;importorg.apache.http.client.clientprotocolexception;import Org.apache.http.client.methods.httpget;importorg.apache.http.impl.client.closeablehttpclient;import org.apache.
This article originates from the "Java Development Notes" blog http://gaoqifang.blog.51cto.com/2270113/758306 Description: 1, this program can achieve Web page files, ordinary files sent. 2, the implementation of mail delivery needs three jar package support: Commons-codec-1.3.jar, Commons-httpclient-3.0.jar (these two jar package implementation crawl Internet
This article is an example of how Java uses Spiders to crawl Web page content. Share to everyone for your reference. Specifically as follows:
Recently in the Java research under the crawl technology, hehe, into a door, their own experience and everyone to share the nextHere are two ways to provide a package with Apach
Get the source of the webpage: PackageCom.atguigu.crud.controller;ImportJava.io.BufferedReader;ImportJava.io.BufferedWriter;ImportJava.io.FileWriter;Importjava.io.IOException;ImportJava.io.InputStreamReader;Importjava.net.MalformedURLException;ImportJava.net.URL; Public classSsssss { Public Static voidMain (string[] a) {Try{URL URL=NewURL ("http://www.baidu.com"); BufferedReader Reader=NewBufferedReader (NewInputStreamReader (Url.openstream ())); BufferedWriter writer=NewBufferedWriter (NewFileW
Label:Num= (String) Session.getattribute (day);1.session You can assign a value if you want to cast itDay in 2.session.getattribute (day) should be a string Error:Dbresult rst=new Dbresult ();This sentence is an errorDefault constructor cannot handle exception type exception thrown by implicitSuper constructor. Must define an explicit constructorSolve:The reason is that Dbresult () has an exception thrownYou can change the throw method of Dbresult () to try{}catch{}, How to display a clock on
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.