【javaWeb第四天】-Web资源访问概述
2013-05-31 18:46
253 查看
netstat - ano查看端口占用情况
Web应用供外界访问方法
1.放在tomcat的webapp文件夹中。
2.虚拟映像
tomcat提供5种方法。
http://localhost:8080/docs/config/context.html
Context elements may be explicitly defined:
In the
In the
In individual files (with a ".xml" extension) in the
may be defined using #, e.g.
Only if a context file does not exist for the application in the
application is packaged as a WAR then
WAR with a newer
Inside a Host element in the main
使用第四种
若Tomcat 和Web应用不在同一个盘中,可在tomcat的conf/Catalina/localhost目录中加一个XML文件,文件名为虚拟映像名,如zpy.xml,内容为<Context docBase="F:\web文件名"/>,服务器会自动加载该应用。
在项目的Web-inf目录中可配置首页,输入项目名即可访问(http://localhost:8080/Test/)
reloadable 设置为true.改过之后 不需要重新发布,服务器会自动 更新。在实际开发中最好不要配制,因为一但改动就会重新加载,应用较大时一旦连续加载会挂掉。
Web应用供外界访问方法
1.放在tomcat的webapp文件夹中。
2.虚拟映像
tomcat提供5种方法。
http://localhost:8080/docs/config/context.html
Context elements may be explicitly defined:
In the
$CATALINA_BASE/conf/context.xmlfile: the Context element information will be loaded by all webapps.
In the
$CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.defaultfile: the Context element information will be loaded by all webapps of that host.
In individual files (with a ".xml" extension) in the
$CATALINA_BASE/conf/[enginename]/[hostname]/directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths
may be defined using #, e.g.
foo#bar.xmlfor a context path of
/foo/bar. The default web application may be defined by using a file called
ROOT.xml.
Only if a context file does not exist for the application in the
$CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at
/META-INF/context.xmlinside the application files. If the web
application is packaged as a WAR then
/META-INF/context.xmlwill be copied to
$CATALINA_BASE/conf/[enginename]/[hostname]/and renamed to match the application's context path. Once this file exists, it will not be replaced if a new
WAR with a newer
/META-INF/context.xmlis placed in the host's appBase.
Inside a Host element in the main
conf/server.xml.
使用第四种
若Tomcat 和Web应用不在同一个盘中,可在tomcat的conf/Catalina/localhost目录中加一个XML文件,文件名为虚拟映像名,如zpy.xml,内容为<Context docBase="F:\web文件名"/>,服务器会自动加载该应用。
在项目的Web-inf目录中可配置首页,输入项目名即可访问(http://localhost:8080/Test/)
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
reloadable 设置为true.改过之后 不需要重新发布,服务器会自动 更新。在实际开发中最好不要配制,因为一但改动就会重新加载,应用较大时一旦连续加载会挂掉。
相关文章推荐
- Struts2-Action概述和在Action中访问WEB资源
- 访问web资源,浏览器报404的可能原因总结(访问的页面不存在)
- web.xml中配置访问资源URL<url-pattern>/</url-pattern>时无法访问.html、.jsp、.js、.css等静态资源时的解决方案
- JavaEE细节问题01——访问web资源的相对路径和绝对路径
- IIS中遇到无法预览的问题(HTTP 错误 401.3 - Unauthorized 由于 Web 服务器上此资源的访问控制列表(ACL)配置或加密设置,您无权查看此目录或页面。)
- 浏览器访问web资源的过程
- JavaWeb学习笔记——开发动态WEB资源(七)
- Web资源访问及HTTP协议详解
- 访问WEB-INF目录下的资源
- WEB项目tomcat容器下 java访问自定义的资源文件xml
- Java EE WEB工程师培训——JDBC+Servlet+JSP整合开发之21.Servlet_资源访问(访问数据库) 推荐
- jsp访问WEB-INF下面的资源-jsp
- Spring Mvc Web 配置拦截规则与访问静态资源 (三)
- web 资源访问图
- web.xml配置SpringMVC时导致访问的页面资源不存在,跳转页面时出现404
- web项目外网访问第一次加载特别慢,但以后特别快,在线资源连接失效的原因
- Web资源访问及HTTP协议详解
- Structs2 HelloWorld-02 访问web资源
- Struts2学习笔记(3)-如何访问Web资源
- 浏览器访问web资源的过程