环境 myeclipse 8.6
tomcat 6.0.35
struts2.3.3建立的web service在src中添加struts.xml<?xml version="1.0" encoding="UTF-8"?>
<xml-body>
<struts>
<package name="struts2" namespace="" extends="struts-default">
<action name="l">
<result>/index.jsp</result>
</action>
</package>
</struts>
</xml-body>
修改web.xml<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Struts Blank</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts2 lib下的所有包都引入了
于是访问不了index.jsp了
localhost:8080/struts2/index.jsp 404
localhost:8080/struts2/l.action 404
localhost:8080/struts2 404删了web.xml就可以了。。但是。。求解啊。。我百度了好久没找打答案。。有人说是webservice的包和strut2的包的冲突了。。但是不摘掉怎么办。。
tomcat 6.0.35
struts2.3.3建立的web service在src中添加struts.xml<?xml version="1.0" encoding="UTF-8"?>
<xml-body>
<struts>
<package name="struts2" namespace="" extends="struts-default">
<action name="l">
<result>/index.jsp</result>
</action>
</package>
</struts>
</xml-body>
修改web.xml<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Struts Blank</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts2 lib下的所有包都引入了
于是访问不了index.jsp了
localhost:8080/struts2/index.jsp 404
localhost:8080/struts2/l.action 404
localhost:8080/struts2 404删了web.xml就可以了。。但是。。求解啊。。我百度了好久没找打答案。。有人说是webservice的包和strut2的包的冲突了。。但是不摘掉怎么办。。
解决方案 »
- jsp 中如何显示tomcat文件目录下的图片
- 导入项目出错(急)
- 请问表单中各种项目都有哪些事件
- 各位JSP高手帮帮我吧!!!!!!!!!!
- JSP自动生成试卷的问题!急,帮帮小弟吧
- 整合tomcat 5.0和IIS6,并且怎么配置多个tomcat应用?急用
- java 变量的变量使用
- 求助:关于在页面上删除记录(不反应到数据库)后的刷新问题
- 在线等:我是照着精华区里的一个帖子配的Tomcat.可是http://localhost:8080/,该页无法显示,我查了很长时间还是不知道哪错了,请高手指
- 老問題-中文亂碼
- 刚学hibernate通到的问题,忘解答!
- 怎么使用MyEclipse将Hibernate文件所设计的数据库表生成到数据库里面呢
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
这个完全没问题
我是让他跳到jsp页面。。class该怎么写呢?
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;D:\Genuitec\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_8.5.0.me201003121946\tomcat\bin
2012-5-10 18:40:04 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2012-5-10 18:40:04 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 516 ms
2012-5-10 18:40:04 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2012-5-10 18:40:04 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.13
2012-5-10 18:40:06 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2012-5-10 18:40:06 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2012-5-10 18:40:06 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Users/purple/Desktop/abc/.metadata/.me_tcat/webapps/struts2/WEB-INF/lib/struts2-gxp-plugin-2.3.3.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: Unable to load bean: type:org.apache.struts2.views.gxp.inject.InjectedObjectContainer class:org.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - jar:file:/C:/Users/purple/Desktop/abc/.metadata/.me_tcat/webapps/struts2/WEB-INF/lib/struts2-gxp-plugin-2.3.3.jar!/struts-plugin.xml:8:162
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:206)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 31 more
写个继承ActionSupport类,在类中execute方法里写个return SUCCESS;在struts.xml中
<action name="l" class="报名.类名">
<result name="success">/index.jsp</result>
</action>
要不上面的回答总是乱想、
严重: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Users/purple/Desktop/abc/.metadata/.me_tcat/webapps/struts2/WEB-INF/lib/struts2-gxp-plugin-2.3.3.jar!/struts-plugin.xml:8:162
Caused by: Unable to load bean: type:org.apache.struts2.views.gxp.inject.InjectedObjectContainer class:org.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - jar:file:/C:/Users/purple/Desktop/abc/.metadata/.me_tcat/webapps/struts2/WEB-INF/lib/struts2-gxp-plugin-2.3.3.jar!/struts-plugin.xml:8:162另外建议楼主照个例子动手弄下、可以自己定义变量、但是别太难懂的变量了