struts2真的配好了么,和1的配置不一样的啊
解决方案 »
- Fckeditor 怎么添加导入word文档的功能???急急急。。。
- 触发器在hibernate中使用的难题
- java.lang.NumberFormatException
- WebWork标签问题
- 问一个关于HTTP头的问题,现在我很迷茫!
- 很头痛的问题,已经问了好多人,jsp高手请帮忙。。。
- 服务器多线程问题
- JForum2.1.9在MyEclipse上部署出现错误
- 什么问题[Microsoft][SQLServer 2000 Driver for JDBC]Connection reset by peer: JVM_recv in socket input stream read
- TOMCAT中JAVABEAN的路径设置问题(急)
- 求助<诸事好商量>云笔记设计与实现
- dwr comet 推送问题
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="main" extends="struts-default" >
<action name="login" class="controller.Login" >
<result name="success">/index.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
这是struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="main" extends="struts-default" >
<action name="login" class="controller.Login" >
<result name="success">/index.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
这是struts.xml
404就是请求路径错了,你请求的URL是什么
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="main" extends="struts-default" >
<action name="login" class="controller.Login" >
<result name="success">/index.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
这是struts.xml
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="main" extends="struts-default" >
<action name="login" class="controller.Login" >
<result name="success">/index.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
这是struts.xml
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧粘错了。嗯嗯那个是写错的超链接。
http://localhost:8080/Website/Login.jsp 就会显示上面图片那个错误。
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧粘错了。嗯嗯那个是写错的超链接。
http://localhost:8080/Website/Login.jsp 就会显示上面图片那个错误。
你为什么不通过action去访问呢?
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧粘错了。嗯嗯那个是写错的超链接。
http://localhost:8080/Website/Login.jsp 就会显示上面图片那个错误。
你为什么不通过action去访问呢?
因为 要先提交信息啊而且报错
加上过滤器的那几行代码后 jsp都打不开了。。
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧粘错了。嗯嗯那个是写错的超链接。
http://localhost:8080/Website/Login.jsp 就会显示上面图片那个错误。
你为什么不通过action去访问呢?
因为 要先提交信息啊而且报错
加上过滤器的那几行代码后 jsp都打不开了。。
你项目部署成功没,tomcat有没有报错,还是有你的项目名称是Website吗?
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧粘错了。嗯嗯那个是写错的超链接。
http://localhost:8080/Website/Login.jsp 就会显示上面图片那个错误。
你为什么不通过action去访问呢?
因为 要先提交信息啊而且报错
加上过滤器的那几行代码后 jsp都打不开了。。
你项目部署成功没,tomcat有没有报错,还是有你的项目名称是Website吗?
项目部署成功了啊,项目名称也是对的啊。。网页本来可以有显示的,这说明是部署成功的啊。。就是加了几行代码就报错了不晓得为什么呜呜呜。
配置struts出现404错误,可能是jar包问题,可能是版本问题,也可能是路径问题,需要多次测试
他这次不是404 了,还是页面一片空白。。就是简单的显示jsp文件,没有加action.....
可能是jar问题,你把jar包删除掉,重新导入试下。
另外,最好不要用自带的jar包吧。
你看一个图,黑色框里的是自己添加的,红色那个是导入Myeclipse 的
严重: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
。
。
。
Caused by: Unable to load configuration. - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
... 19 more
Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:232)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 21 more
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name struts has already been loaded by bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:30:124 - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
... 24 more
六月 03, 2014 2:53:35 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
六月 03, 2014 2:53:35 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/Website] startup failed due to previous errors
六月 03, 2014 2:53:35 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
六月 03, 2014 2:53:35 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
六月 03, 2014 2:53:35 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2705 ms
六月 03, 2014 2:53:45 下午 org.apache.catalina.startup.HostConfig checkResources
信息: Reloading context [/Website]
六月 03, 2014 2:53:46 下午 org.apache.catalina.startup.TaglibUriRule body
信息: TLD skipped. URI: /struts-tags is already defined
六月 03, 2014 2:53:46 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
六月 03, 2014 2:53:47 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
。
。Caused by: Unable to load configuration. - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
... 19 more
Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:232)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 21 more
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name struts has already been loaded by bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml:30:124 - bean - jar:file:/E:/JSP/.metadata/.me_tcat7/webapps/Website/WEB-INF/lib/struts2-core-2.3.16.3.jar!/struts-default.xml:40:72
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
... 24 more
六月 03, 2014 2:53:47 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
六月 03, 2014 2:53:47 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/Website] startup failed due to previous errors
这一大堆的错误。。
这个错是为什么啊
选中项目-----右击选择Myeclipse
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="main" extends="struts-default" >
<action name="login" class="controller.Login" >
<result name="success">/index.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
这是struts.xml
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
result是执行aciton返回结果执行页面跳转,是请求路径吧
404就是请求路径错了,你请求的URL是什么
路径不是和action返回的字符串然后在result里匹配么?action里和result里是对应的。。
现在是我加上过滤器就一片空白了不加过滤器action 肯定不会显示的吧。。
你在浏览器地址栏中输入的是什么
localhost:8080/Website/index.html不明白你想请求什么?项目中有index.html吗?
应该是localhost:8080/Website/login.action吧粘错了。嗯嗯那个是写错的超链接。
http://localhost:8080/Website/Login.jsp 就会显示上面图片那个错误。
你为什么不通过action去访问呢?
因为 要先提交信息啊而且报错
加上过滤器的那几行代码后 jsp都打不开了。。
<action name="login" class="....." method="方法(比如login)">
没有指定方法 你的要执行的代码只能写在execute()方法有效