如题所属。能执行action中的代码,但是怎么都跳转不到指定的那个结果页面。
后台报了如下信息:
1 2012-11-16 10:33:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 2 警告: Could not find property [struts.actionMapping] 3 2012-11-16 10:33:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 4 警告: Could not find property [struts.valueStack] 5 loginSSS(这句输出是我的action输出的) 6 2012-11-16 10:33:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 7 警告: Could not find property [org.apache.catalina.jsp_file] 8 2012-11-16 10:41:18 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 9 警告: Could not find property [struts.actionMapping] 10 2012-11-16 10:41:18 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 11 警告: Could not find property [org.apache.catalina.jsp_file] 12 2012-11-16 10:41:26 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 13 警告: Could not find property [struts.actionMapping] 14 2012-11-16 10:41:26 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 15 警告: Could not find property [struts.valueStack] 16 loginSSS 17 2012-11-16 10:41:26 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 18 警告: Could not find property [org.apache.catalina.jsp_file]
struts 配置文件如下:
1 <?xml version="1.0" encoding="UTF-8" ?> 2 <!DOCTYPE struts PUBLIC 3 "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" 4 "http://struts.apache.org/dtds/struts-2.1.dtd"> 5 6 7 <struts> 8 <!-- 制定全局国际化资源文件 --> 9 <constant name="mess" value="struts.custom.i18n.resources"/> 10 <!-- 制定国际化编码 所使用的字符集--> 11 <constant name="GBK" value="struts.i18n.encoding"/> 12 <!-- 设置浏览器是否缓存静态内容,默认值为true(生产环境下使用),开发阶段最好关闭 --> 13 <constant name="struts.serve.static.browserCache" value="false"></constant> 14 <!-- 当struts的配置文件修改后,系统是否自动重新加载该文件,默认值为false(生产环境下使用),开发阶段最好打开 --> 15 <constant name="struts.configuration.xml.reload" value="true"></constant> 16 <!-- 开发模式下使用,这样可以打印出更详细的错误信息 --> 17 <constant name="struts.devMode" value="true" /> 18 <constant name="struts.convention.classes.reload" value="true"/> 19 <!-- 所有Action 都在package下 --> 20 <package name="default" extends="struts-default" namespace="/"> 21 <global-results> 22 <result name="mainpage">/main.jsp</result> 23 </global-results> 24 <action name="login" class="actions.LoginAction" > 25 <result name="login_success">/main.jsp</result> 26 </action> 27 </package> 28 </struts>
web.xml 如下:
1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app version="2.5" 3 xmlns="http://java.sun.com/xml/ns/javaee" 4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 5 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 6 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> 7 <welcome-file-list> 8 <welcome-file>indexw.jsp</welcome-file> 9 </welcome-file-list> 10 <!-- 定义structs2 的核心Filter --> 11 <filter> 12 <filter-name>struts2</filter-name> 13 <filter-class> 14 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 15 </filter-class> 16 <init-param> 17 <param-name>config</param-name> 18 <param-value> 19 struts-default.xml, 20 ../conf/struts_conf/struts.xml 21 </param-value> 22 </init-param> 23 </filter> 24 <!-- structs2 的核心Filter 拦截到所有的请求 --> 25 <filter-mapping> 26 <filter-name>struts2</filter-name> 27 <url-pattern>/*</url-pattern> 28 </filter-mapping> 29 </web-app>
怎么执行都不能跳转到指定的页面,网上说的log4j 的那种方法无效。请大侠之路!!
你的property配置文件出错了
什么property 文件,log4j 么?我没有加log4j ,请详细告知!