我配置SSH2框架。。启动tomcat一切正常。。http://localhost:8080/也正常显示。。
只是加入项目后就总显示The requested resource (/Struts2/) is not available.了我已经在C:\Tomcat 5.5\conf\Catalina\localhost下添加了部署文件:
<?xml version="1.0" encoding="utf-8" ?>
<Context path="/Struts2" docBase="C:\Documents and Settings\admin\workspace\Struts2\WebRoot" debug="0" privileged="true" /> 我写过测试文件。。SSH框架应该算是OK的。。这个是web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Struts2</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list> <display-name>Struts2</display-name> <welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param> <filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener> </web-app>请问大侠我应该是哪里出错了呢。。
只是加入项目后就总显示The requested resource (/Struts2/) is not available.了我已经在C:\Tomcat 5.5\conf\Catalina\localhost下添加了部署文件:
<?xml version="1.0" encoding="utf-8" ?>
<Context path="/Struts2" docBase="C:\Documents and Settings\admin\workspace\Struts2\WebRoot" debug="0" privileged="true" /> 我写过测试文件。。SSH框架应该算是OK的。。这个是web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Struts2</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list> <display-name>Struts2</display-name> <welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param> <filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener> </web-app>请问大侠我应该是哪里出错了呢。。
解决方案 »
- Tomcat 经常挂掉
- 用JSP+tomcat4+SQLserver做一个登陆模块时的问题,急呀,在线等
- java 数据库连接类设计问题
- 高分求tomcat sql2000配置方法!
- 有关在自己的程序中调用百度或是谷歌的搜索功能,还有能够获取所搜索结果页面(就是列出一条条结果的页面)的URL
- 怎样在JavaBean中写一个方法来写入cookie值,例如写入name,然后又怎样把这个cookie值读出来?
- 动态代理和RMI的问题
- JSP页面输出不完整
- 怎样把一个session变量的全部值读出来!请各位高手帮助一下!
- 我到底应过去当老师还是做程序员呢?
- 图片为啥显示不出来?
- 当用户登陆后进入JSP页面时默认显示最后一次退出的样式
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list><display-name>Struts2</display-name>这一段删了
2012/07/20 16:14:18 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
情報: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_30\bin;C:\mySql 5.0\bin;C:\Documents and Settings\admin\デスクトップ\eclipse;;.
2012/07/20 16:14:18 org.apache.coyote.http11.Http11BaseProtocol init
情報: Coyote HTTP/1.1を http-8080 で初期化します
2012/07/20 16:14:18 org.apache.catalina.startup.Catalina load
情報: Initialization processed in 297 ms
2012/07/20 16:14:18 org.apache.catalina.core.StandardService start
情報: サービス Catalina を起動します
2012/07/20 16:14:18 org.apache.catalina.core.StandardEngine start
情報: Starting Servlet Engine: Apache Tomcat/5.5.20
2012/07/20 16:14:18 org.apache.catalina.core.StandardHost start
情報: XML検証は無効です
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
2012/07/20 16:14:20 org.apache.catalina.core.ApplicationContext log
情報: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2012/07/20 16:14:20 org.apache.catalina.core.ApplicationContext log
情報: ContextListener: contextInitialized()
2012/07/20 16:14:20 org.apache.catalina.core.ApplicationContext log
情報: SessionListener: contextInitialized()
2012/07/20 16:14:20 org.apache.catalina.core.ApplicationContext log
情報: ContextListener: contextInitialized()
2012/07/20 16:14:20 org.apache.catalina.core.ApplicationContext log
情報: SessionListener: contextInitialized()
2012/07/20 16:14:20 org.apache.coyote.http11.Http11BaseProtocol start
情報: Coyote HTTP/1.1を http-8080 で起動します
2012/07/20 16:14:20 org.apache.jk.common.ChannelSocket init
情報: JK: ajp13 listening on /0.0.0.0:8009
2012/07/20 16:14:20 org.apache.jk.server.JkMain start
情報: Jk running ID=0 time=0/0 config=null
2012/07/20 16:14:20 org.apache.catalina.storeconfig.StoreLoader load
情報: Find registry server-registry.xml at classpath resource
2012/07/20 16:14:20 org.apache.catalina.startup.Catalina start
情報: Server startup in 2453 ms这是启动信息。。
——这步尝试了么?
不好意思周末都没上网= =
谢谢回答哦~~你说的方法我试了下。。<host>标签里添加:<Context path="/Struts2" reloadable="true" docBase="C:\Documents and Settings\admin\workspace\Struts2\WebRoot\jsp" workDir="C:\Documents and Settings\admin\workspace\Struts2\WebRoot" /> 可还是不行。。
把eclipse的tomcat配置修改:配置文件读取改成server.xml
然后又试了一次。。好用了。。十分感谢~~~