??xml version="1.0" encoding="utf-8" standalone="yes"?>懂色av一区二区,51精产品一区一区三区,国产精品嫩草影院av蜜臀http://www.aygfsteel.com/liuwuping12064915/category/48779.html 坚持 随心而动 走自q?/description>zh-cnFri, 03 Jun 2011 01:57:46 GMTFri, 03 Jun 2011 01:57:46 GMT60tomcat7的配|?/title><link>http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351617.html</link><dc:creator>天空布蓝</dc:creator><author>天空布蓝</author><pubDate>Thu, 02 Jun 2011 09:54:00 GMT</pubDate><guid>http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351617.html</guid><wfw:comment>http://www.aygfsteel.com/liuwuping12064915/comments/351617.html</wfw:comment><comments>http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351617.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/liuwuping12064915/comments/commentRss/351617.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/liuwuping12064915/services/trackbacks/351617.html</trackback:ping><description><![CDATA[<span id="wmqeeuq" class="Apple-style-span" style="color: #323e32; font-family: simsun; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">  <br /><br />原文转蝲自:(x)</p></span><span id="wmqeeuq" class="Apple-style-span" style="color: #323e32; font-family: simsun; "><a >http://blog.sina.com.cn/s/blog_70b7bbf20100mhiv.html</a></span><span id="wmqeeuq" class="Apple-style-span" style="color: #323e32; font-family: simsun; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">   Tomcat7已经发布多时QTomcat7增加了对Servlet 3.0,JSP 2.2和JSP-EL 2?的支持、支持web application内存泄露的检和防护{很多新功能。本片教E主要介l如何配|Tomcat7?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">一、Y件下?br /> <wbr> <wbr> <wbr> 首先需要下载Java Jdk以及Tomcat7。JDK下蝲地址Q最Cؓ(f)JDK6 update22, Tomcat7下蝲地址Q最Cؓ(f)Tomcat7.02 Beta?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">二、Y件安装和配置<br /> <wbr> <wbr> <wbr> 1.首先安装JDKQ直接点d装即?比如默认安装的\径ؓ(f)QC:\Program Files\Java\jdk1.6.0_22。安装之后需要设定环境变量。在我的?sh)?>属?>高->环境变量->pȝ变量中添加以下环境变量:(x)(假设你的jdk安装目录如上讄)</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr> <wbr> <wbr> 新徏变量名:(x) <font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">JAVA_HOME</font>,?value)为:(x)<font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">C:\Program Files\Java\jdk1.6.0_22<br /></font> <wbr> <wbr> <wbr> 新徏变量名:(x)<font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">classpath</font> ,?value)为:(x) <font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;</font> <wbr> (.;一定不能少Q因为它代表当前路径)<br /> <wbr> <wbr> <wbr> 查找变量名:(x)path ,增加?value)?font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">Q?JAVA_HOME%\bin;</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><br />d完毕Q确定即可。接下来单测试环境变量是否配|正:(x)</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">public class Test{<br /> <wbr> <wbr> <wbr> public static void main(String args[]){<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> System.out.println("Hello Leyond");<br /> <wbr> <wbr> <wbr> }<br />}<br /></font> <wbr><br />以上代码拷贝保存成Test.java文g。然后命令行H口(xp:在运行输入cmd,vista和win7直接在搜索框中输入cmd)QCD到文件所在的目录Q然后键入下列命令:(x)<br />javac Test.java<br />java Test</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">注意W二个命令没?java后缀。如果看?#8220;Hello Leyond”Q则表明jdk环境变量配置成功Q没有的话,查自q配置情况?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">2. Tomcat7安装和配|?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr> <wbr> <wbr> 下蝲zip文g之后直接解压到某个目录下Q比如:(x)C:\itdevelop\Tomcat7。然后在我的?sh)?>属?>高->环境变量->pȝ变量中添加以下环境变量:(x)</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr> <wbr> <wbr> 新徏变量? <font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">TOMCAT_HOME</font>, ?value)为:(x)<font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">C:\itdevelop\Tomcat7</font><br /> <wbr> <wbr> <wbr> 查找变量? <font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">classpath</font>, 增加gؓ(f)<font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#000000" style="word-wrap: normal; word-break: normal; line-height: 21px; ">Q?/font>%TOMCAT_HOME%\common\lib<br /></font> <wbr> <wbr> <wbr> 增加后的classpath的gؓ(f)<font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#000000" style="word-wrap: normal; word-break: normal; line-height: 21px; ">Q?/font>.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%TOMCAT_HOME%\lib</font>?br /> <wbr> <wbr> <wbr> 最后进入Tomcat7安装目录下的Bin目录Q启动Tomcat,在浏览器中输入:(x)<a href="http://localhost:8080/" style="text-decoration: none; color: #006b77; ">http://localhost:8080/</a>Q若可以看到Tomcat7的欢q界面,表示Tomcat7配置成功了?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">三、新建webApp<br /> <wbr> <wbr> <wbr> q里介绍如何搭徏一个JSP单的应用。首先到Tomcat7目录下webapps目录Q例如:(x)C:\itdevelop\Tomcat7\webappsQ该目录存放了ROOTQdocs,examples{目录,ROOT存放的是Ƣ迎界面的代码,docs主要是文档,examples中可以查看各U例子。接下来看看如何新徏一个属于自qjsp应用E序?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">操作如下Q?br /> <wbr> 1.在webapps下新建myapp目录?br /> <wbr> 2.myapp下新Z个目录WEB-INFQ注意,目录名称是区分大写的?br /> <wbr> 3.WEB-INF下新Z个文件web.xmlQ内容如?</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; "><?xml version="1.0" encoding="ISO-8859-1"?><br /><web-app version="3.0"<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> xmlns="</font><a style="text-decoration: none; color: #006b77; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">http://java.sun.com/xml/ns/javaee</font></a><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">"<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> xmlns:xsi="</font><a style="text-decoration: none; color: #006b77; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">http://www.w3.org/2001/XMLSchema-instance</font></a><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">"<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> xsi:schemaLocation="</font><a style="text-decoration: none; color: #006b77; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">http://java.sun.com/xml/ns/javaee</font></a><a style="text-decoration: none; color: #006b77; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd</font></a><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">"><br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <display-name>My Web Application</display-name><br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <description><br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> A application for test.<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> </description><br /></web-app></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">4. 在myapp下新Z个测试的jsp面Q文件名为index.jspQ文件内容如?<br /><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; "><html><br /> <wbr> <body><br /> <wbr> <wbr> <wbr> <center> Now time is: <%=new java.util.Date()%></center><br /> <wbr> </body><br /></html></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">5. 启动Tomcat,在浏览器输入<a href="http://localhost:8080/myapp/index.jsp" style="text-decoration: none; color: #006b77; ">http://localhost:8080/myapp/index.jsp</a>看到当前旉的话说明成功了?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">四、新建Servlet<br /> <wbr> <wbr> <wbr> 在之前myapp目下?WEB-INF/classes/test目录下新建HelloWorld.java(若没有class,test目录Q请新徏)。HelloWorld内容如下Q?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">package test;<br />import java.io.*;<br />import javax.servlet.*;<br />import javax.servlet.http.*;</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; ">public class HelloWorld extends HttpServlet{<br /> <wbr> <wbr> <wbr> public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{<br /> <wbr> <wbr> <wbr> <wbr> response.setContentType("text/html");<br /> <wbr> <wbr> <wbr> <wbr> PrintWriter out = response.getWriter();<br /> <wbr> <wbr> <wbr> <wbr> out.println("<html><head><title>");<br /> <wbr> <wbr> <wbr> <wbr> out.println("This is my first Servlet");<br /> <wbr> <wbr> <wbr> <wbr> out.println("</title></head><body>");<br /> <wbr> <wbr> <wbr> <wbr> out.println("<h1>Hello,World!</h1>");<br /> <wbr> <wbr> <wbr> <wbr> out.println("</body></html>");<br /> <wbr> <wbr> }<br />}</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr> <wbr> <wbr> 之后用javac HelloWorld.java来编译该文g。倘若出现”package javax.servlet does not exist“Q请把C:\itdevelop\Tomcat7\lib目录下的servlet-api.jar拯到C:\Program Files\Java\jre6\lib\extQ重启电(sh)脑,再次~译卛_?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">目前C:\itdevelop\Tomcat7\webapps\myapp的目录结构如下:(x)</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">./index.jsp<br />./WEB-INF/web.xml<br />./WEB-INF/classes/test/HelloWorld.class (~译HelloWorld.java生成?</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; ">然后在浏览器中输?a href="http://localhost:8080/myapp/HelloWorld" style="text-decoration: none; color: #006b77; ">http://localhost:8080/myapp/HelloWorld</a>,于是Server众望所归的报错?Error 404–Not Found 怎么回事呢?我们q需要配|Servlet的之行环境。打开WEB-INF目录下的web.xmlQ在<web-app></web-app>d下面q段E序Q?/p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; "><servlet><br /> <wbr> <wbr> <wbr> <servlet-name>HelloWorld</servlet-name><br /> <wbr> <wbr> <wbr> <servlet-class>test.HelloWorld</servlet-class><br /> <wbr></servlet></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "><font color="#ED1C24" style="word-wrap: normal; word-break: normal; line-height: 21px; "><servlet-mapping><br /> <wbr> <wbr> <wbr> <servlet-name>HelloWorld</servlet-name><br /> <wbr> <wbr> <wbr> <url-pattern>/HelloWorld</url-pattern><br /> <wbr></servlet-mapping></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; "> <wbr> <wbr> <wbr> q段xml内容Q首先指定servlet的名字,cȝ名字。然后把servlet映射CUURL模式Q得通过URL来访问这个servlet。修改之后,若需要重启Tomcat,然后览<a href="http://localhost:8080/myapp/HelloWorld" style="text-decoration: none; color: #006b77; ">http://localhost:8080/myapp/HelloWorld</a>一个Hello,World!{着你,如果你看CQ表Cservlet也成功了?div style="display: inline-block; "></div></p></span><span id="wmqeeuq" class="Apple-style-span" style="color: #323e32; font-family: Verdana, 宋体, sans-serif; font-size: 12px; line-height: 20px; "><h2 id="t_70b7bbf20100mhiv" class="titName SG_txta" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; color: #006b77; font-size: 18px; font-family: 微Y雅黑, 黑体; font-weight: 300; display: inline; ">Tomcat7配置</h2></span><span id="wmqeeuq" class="Apple-style-span" style="color: #323e32; font-family: Verdana, 宋体, sans-serif; font-size: 12px; line-height: 20px; "> </span><img src ="http://www.aygfsteel.com/liuwuping12064915/aggbug/351617.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/liuwuping12064915/" target="_blank">天空布蓝</a> 2011-06-02 17:54 <a href="http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351617.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tomcat介之web.xml详解http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351614.html天空布蓝天空布蓝Thu, 02 Jun 2011 09:40:00 GMThttp://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351614.htmlhttp://www.aygfsteel.com/liuwuping12064915/comments/351614.htmlhttp://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351614.html#Feedback0http://www.aygfsteel.com/liuwuping12064915/comments/commentRss/351614.htmlhttp://www.aygfsteel.com/liuwuping12064915/services/trackbacks/351614.html阅读全文

天空布蓝 2011-06-02 17:40 发表评论
]]>
Tomcat中web.xml文g的详l说?/title><link>http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351611.html</link><dc:creator>天空布蓝</dc:creator><author>天空布蓝</author><pubDate>Thu, 02 Jun 2011 09:19:00 GMT</pubDate><guid>http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351611.html</guid><wfw:comment>http://www.aygfsteel.com/liuwuping12064915/comments/351611.html</wfw:comment><comments>http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351611.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/liuwuping12064915/comments/commentRss/351611.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/liuwuping12064915/services/trackbacks/351611.html</trackback:ping><description><![CDATA[<span id="wmqeeuq" class="Apple-style-span" style="font-family: verdana, sans-serif; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><span style="font-family: verdana, sans-serif; font-size: 14px; line-height: 21px; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; ">原文转自Q?/p></span></p></span><span id="wmqeeuq" class="Apple-style-span" style="font-family: verdana, sans-serif; "><a >http://blog.csdn.net/pathfinder163/archive/2009/09/02/4506817.aspx</a></span><span id="wmqeeuq" class="Apple-style-span" style="font-family: verdana, sans-serif; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><span style="font-family: verdana, sans-serif; font-size: 14px; line-height: 21px; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><br /><?xml version="1.0" encoding="GB2312"?> <!-- <br />Web.xml依次定议了如下元素:(x) <br /><span style="font-size: 14pt; "><web-app> <br /></span><br /><span style="font-size: 14pt; "><display-name></display-name> 定义了WEB应用的名?nbsp;<br /></span><br /><span style="font-size: 14pt; "><description></description> 声明WEB应用的描qC?nbsp;<br /></span><br /><span style="font-size: 14pt; "><filter></filter> <br /></span><br /><span style="font-size: 14pt; "><filter-mapping></filter-mapping><br /> </span><br /><span style="font-size: 14pt; "><servlet></servlet> <br /></span><br /><span style="font-size: 14pt; "><servlet-mapping></servlet-mapping> <br /></span><br /><span style="font-size: 14pt; "><session-config></session-config> <br /></span><br /><span style="font-size: 14pt; "><welcome-file-list></welcome-file-list> <br /></span><br /><span style="font-size: 14pt; "><taglib></taglib> <br /></span><br /><span style="font-size: 14pt; "><resource-ref></resource-ref> <br /></span><br /><span style="font-size: 14pt; "><security-constraint></security-constraint> <br /></span><br /><span style="font-size: 14pt; "><login-config></login-config> <br /></span><br /><span style="font-size: 14pt; "></web-app> </span><br />在web.xml中元素定义的先后序不能颠倒,否则Tomcat服务器可能会(x)抛出SAXParseException. <br />--> <br /><!DOCTYPE web-app PUBLIC "-//Sun Microsystems,Inc.//DTD Web Application 2.3//EN" "<a style="text-decoration: none; color: #336699; ">http://java.sun.com/dtd/web-app_2_3.dtd</a>"> <br /><web-app></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><display-name>Sample Application</display-name></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><description> <br />This is a Sample Application <br /></description></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />filter 配置Servletqo?nbsp;<br />filter-name 定义qo器的名字。当有多个过滤器Ӟ不能同名 <br />filter-class 指定实现q一qo的类Q这个类负责具体的过滤事?nbsp;<br />--> <br /><filter> <br /><filter-name>SampleFilter</filter-name> <br /><filter-class>mypack.SampleFilter</filter-class> <br /></filter></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />filter-mapping 讑֮qo器负责过滤的URL <br />filter-name qo器名。这里的名字一定要和filter中的qo器名匚w <br />url-pattern 指定qo器负责过滤的URL <br />--> <br /><filter-mapping> <br /><filter-name>SampleFilter</filter-name> <br /><url-pattern>*.jsp</url-pattern> <br /></filter-mapping></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />servlet 配置Servlet. <br />servlet-name 定义Servlet的名?nbsp;<br />servlet-class 指定实现q个servlet的类 <br />init-param 定义Servlet的初始化参数和参数|可有多个init-param。在servletcM通过getInitParamenter(String name)Ҏ(gu)讉K初始化参?nbsp;<br />load-on-startup 指定当Web应用启动Ӟ装蝲Servlet的次序?nbsp;<br />当gؓ(f)正数或零Ӟ(x)Servlet容器先加载数值小的servletQ再依次加蝲其他数值大的servlet. <br />当gؓ(f)负或未定义:(x)Servlet容器在Web客户首次讉Kq个servlet时加载它 <br />--> <br /><servlet> <br /><servlet-name>SampleServlet</servlet-name> <br /><servlet-class>mypack.SampleServlet</servlet-class> <br /><init-param> <br /><param-name>initParam1</param-name> <br /><param-value>2</param-value> <br /></init-param> <br /><load-on-startup>1</load-on-startup> <br /></servlet></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置servlet映射Q下面代码ؓ(f)SampleServlet指定的相对URL?/sample": <br />servlet-name 指定servlet的名字,q里的名字应该和<Servlet>元素中定义的名字匚w?nbsp;<br />url-pattern 指定讉Kq个servlet的URL。只需l出相对路径?nbsp;<br />--> <br /><servlet-mapping> <br /><servlet-name>SampleServlet</servlet-name> <br /><url-pattern>/sample</url-pattern> <br /></servlet-mapping></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!--配置session session用来讑֮HttpSession的生命周期。单位(U)--> <br /><session-config> <br /><session-timeout>30</session-timeout> <br /></session-config></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!--配置Wel0come0文g清单--> <br /><welcome-file-list> <br /><welcome-file>login.jsp</welcome-file> <br /><welcome-file>index.htm</welcome-file> <br /></welcome-file-list></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置Tag Library <br />taglib-uri 讑֮Tag Library的唯一标识W,在Web应用中将Ҏ(gu)q一标识W来引用Tag Library <br />taglib-location 指定和Tag Library对应的TLD文g的位|?nbsp;<br />--> <br /><taglib> <br /><taglib-uri>/mytaglib</taglib-uri> <br /><taglib-location>/WEB-INF/mytaglib.tld</taglib-location> <br /></taglib></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置资源引用 <br />description Ҏ(gu)引用的资源的说明 <br />res-ref-name 指定所引用资源的JNDI名字 <br />res-type 指定所引用资源的类名字 <br />res-auth 指定理所引用资源的Manager,它有两个可选|(x) <br />ContainerQ由容器来创建和理resource <br />Application:同W(xu)EB应用来创建和理Resource <br />--> <br /><resource-ref> <br /><description>DB Connection</description> <br /><res-ref-name>jdbc/sampleDB</res-ref-name> <br /><res-type>javax.sql.DataSource</res-type> <br /><res-auth>Container</res-auth> <br /></resource-ref></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置安全U束Q以下代码指定当用户讉K该WEB应用下的所有资源时Q必d备guest角色Q?nbsp;<br />web-resource-collection 声明受保护的WEB资源 <br />auth-constraint 声明可以讉K受保护资源的角色Q可以包含多?lt;role-name>子元?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; ">web-resource-name 标识受保护的WEB资源 <br />url-pattern 指定受保护的URL路径 <br />--> <br /><Security-constraint> <br /><web-resource-collection> <br /><web-resource-name>sample appliction</web-resource-name> <br /><url-pattern>/*</url-pattern> <br /></web-resource-collection> <br /><auth-constraint> <br /><role-name>guest</role-name> <br /></auth-constraint> <br /></Security-constraint></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><br /><!-- <br />配置安全验证d界面Q指定当WEB客户讉K受保护的WEB资源Ӟpȝ弹出的登录对话框的类型?nbsp;<br />auth-method 指定验证Ҏ(gu)Q它有三个可选|(x)BASIC(基本验证)、DIGEST(摘要验证)、FORM(表单验证) <br />realm-name 讑֮安全域的名称 <br />form-login-config 当验证方法ؓ(f)FORMӞ配置验证|页和出错网?nbsp;<br />form-login-page 当验证方法ؓ(f)FORMӞ讑֮验证|页 <br />form-error-page 当验证方法ؓ(f)FORMӞ讑֮出错|页 <br />--> <br /><login-config> <br /><auth-method>FORM</auth-method> <br /><realm-name> <br />Tomcat Server Configuration form-Based Authentication Area <br /></realm-name> <br /><form-login-config> <br /><form-login-page>/login.jsp</form-login-page> <br /><form-error-page>/error.jsp</form-error-page> <br /></form-login-config> <br /></login-config></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!--配置对安全验证角色的引用--> <br /><security-role> <br /><description> <br />The role that is required to log into the sample application <br /></description> <br /><role-name>guest</role-name> <br /></security-role> <br /></p></span></p></span><span id="wmqeeuq" class="Apple-style-span" style="font-family: verdana, sans-serif; "></web-app></span><span id="wmqeeuq" class="Apple-style-span" style="font-family: verdana, sans-serif; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><?xml version="1.0" encoding="GB2312"?> <!-- <br />Web.xml依次定议了如下元素:(x) <br /><web-app> <br /><display-name></display-name> 定义了WEB应用的名?nbsp;<br /><description></description> 声明WEB应用的描qC?nbsp;<br /><filter></filter> <br /><filter-mapping></filter-mapping> <br /><servlet></servlet> <br /><servlet-mapping></servlet-mapping> <br /><session-config></session-config> <br /><welcome-file-list></welcome-file-list> <br /><taglib></taglib> <br /><resource-ref></resource-ref> <br /><security-constraint></security-constraint> <br /><login-config></login-config> <br /></web-app> <br />在web.xml中元素定义的先后序不能颠倒,否则Tomcat服务器可能会(x)抛出SAXParseException. <br />--> <br /><!DOCTYPE web-app PUBLIC "-//Sun Microsystems,Inc.//DTD Web Application 2.3//EN" "<a style="text-decoration: none; color: #336699; ">http://java.sun.com/dtd/web-app_2_3.dtd</a>"> <br /><web-app></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><display-name>Sample Application</display-name></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><description> <br />This is a Sample Application <br /></description></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />filter 配置Servletqo?nbsp;<br />filter-name 定义qo器的名字。当有多个过滤器Ӟ不能同名 <br />filter-class 指定实现q一qo的类Q这个类负责具体的过滤事?nbsp;<br />--> <br /><filter> <br /><filter-name>SampleFilter</filter-name> <br /><filter-class>mypack.SampleFilter</filter-class> <br /></filter></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />filter-mapping 讑֮qo器负责过滤的URL <br />filter-name qo器名。这里的名字一定要和filter中的qo器名匚w <br />url-pattern 指定qo器负责过滤的URL <br />--> <br /><filter-mapping> <br /><filter-name>SampleFilter</filter-name> <br /><url-pattern>*.jsp</url-pattern> <br /></filter-mapping></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />servlet 配置Servlet. <br />servlet-name 定义Servlet的名?nbsp;<br />servlet-class 指定实现q个servlet的类 <br />init-param 定义Servlet的初始化参数和参数|可有多个init-param。在servletcM通过getInitParamenter(String name)Ҏ(gu)讉K初始化参?nbsp;<br />load-on-startup 指定当Web应用启动Ӟ装蝲Servlet的次序?nbsp;<br />当gؓ(f)正数或零Ӟ(x)Servlet容器先加载数值小的servletQ再依次加蝲其他数值大的servlet. <br />当gؓ(f)负或未定义:(x)Servlet容器在Web客户首次讉Kq个servlet时加载它 <br />--> <br /><servlet> <br /><servlet-name>SampleServlet</servlet-name> <br /><servlet-class>mypack.SampleServlet</servlet-class> <br /><init-param> <br /><param-name>initParam1</param-name> <br /><param-value>2</param-value> <br /></init-param> <br /><load-on-startup>1</load-on-startup> <br /></servlet></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置servlet映射Q下面代码ؓ(f)SampleServlet指定的相对URL?/sample": <br />servlet-name 指定servlet的名字,q里的名字应该和<Servlet>元素中定义的名字匚w?nbsp;<br />url-pattern 指定讉Kq个servlet的URL。只需l出相对路径?nbsp;<br />--> <br /><servlet-mapping> <br /><servlet-name>SampleServlet</servlet-name> <br /><url-pattern>/sample</url-pattern> <br /></servlet-mapping></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!--配置session session用来讑֮HttpSession的生命周期。单位(U)--> <br /><session-config> <br /><session-timeout>30</session-timeout> <br /></session-config></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!--配置Wel0come0文g清单--> <br /><welcome-file-list> <br /><welcome-file>login.jsp</welcome-file> <br /><welcome-file>index.htm</welcome-file> <br /></welcome-file-list></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置Tag Library <br />taglib-uri 讑֮Tag Library的唯一标识W,在Web应用中将Ҏ(gu)q一标识W来引用Tag Library <br />taglib-location 指定和Tag Library对应的TLD文g的位|?nbsp;<br />--> <br /><taglib> <br /><taglib-uri>/mytaglib</taglib-uri> <br /><taglib-location>/WEB-INF/mytaglib.tld</taglib-location> <br /></taglib></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置资源引用 <br />description Ҏ(gu)引用的资源的说明 <br />res-ref-name 指定所引用资源的JNDI名字 <br />res-type 指定所引用资源的类名字 <br />res-auth 指定理所引用资源的Manager,它有两个可选|(x) <br />ContainerQ由容器来创建和理resource <br />Application:同W(xu)EB应用来创建和理Resource <br />--> <br /><resource-ref> <br /><description>DB Connection</description> <br /><res-ref-name>jdbc/sampleDB</res-ref-name> <br /><res-type>javax.sql.DataSource</res-type> <br /><res-auth>Container</res-auth> <br /></resource-ref></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!-- <br />配置安全U束Q以下代码指定当用户讉K该WEB应用下的所有资源时Q必d备guest角色Q?nbsp;<br />web-resource-collection 声明受保护的WEB资源 <br />auth-constraint 声明可以讉K受保护资源的角色Q可以包含多?lt;role-name>子元?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; ">web-resource-name 标识受保护的WEB资源 <br />url-pattern 指定受保护的URL路径 <br />--> <br /><Security-constraint> <br /><web-resource-collection> <br /><web-resource-name>sample appliction</web-resource-name> <br /><url-pattern>/*</url-pattern> <br /></web-resource-collection> <br /><auth-constraint> <br /><role-name>guest</role-name> <br /></auth-constraint> <br /></Security-constraint></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><br /><!-- <br />配置安全验证d界面Q指定当WEB客户讉K受保护的WEB资源Ӟpȝ弹出的登录对话框的类型?nbsp;<br />auth-method 指定验证Ҏ(gu)Q它有三个可选|(x)BASIC(基本验证)、DIGEST(摘要验证)、FORM(表单验证) <br />realm-name 讑֮安全域的名称 <br />form-login-config 当验证方法ؓ(f)FORMӞ配置验证|页和出错网?nbsp;<br />form-login-page 当验证方法ؓ(f)FORMӞ讑֮验证|页 <br />form-error-page 当验证方法ؓ(f)FORMӞ讑֮出错|页 <br />--> <br /><login-config> <br /><auth-method>FORM</auth-method> <br /><realm-name> <br />Tomcat Server Configuration form-Based Authentication Area <br /></realm-name> <br /><form-login-config> <br /><form-login-page>/login.jsp</form-login-page> <br /><form-error-page>/error.jsp</form-error-page> <br /></form-login-config> <br /></login-config></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; "><!--配置对安全验证角色的引用--> <br /><security-role> <br /><description> <br />The role that is required to log into the sample application <br /></description> <br /><role-name>guest</role-name> <br /></security-role> <br /></web-app></p></span><img src ="http://www.aygfsteel.com/liuwuping12064915/aggbug/351611.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/liuwuping12064915/" target="_blank">天空布蓝</a> 2011-06-02 17:19 <a href="http://www.aygfsteel.com/liuwuping12064915/archive/2011/06/02/351611.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʯʨ</a>| <a href="http://" target="_blank">Ѱ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">³</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˫</a>| <a href="http://" target="_blank">ͤ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ǹ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ݳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">տ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">³</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ר</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ӧ</a>| <a href="http://" target="_blank">ﴨ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ī</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ϴ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>