struts2问题

zt_zhangtuo 2009-04-10 02:01:42
这是我的struts的配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" >
<struts>
<include file="struts-default.xml"/>
<package name="mail-default" namespace="/" extends="struts-default">
<interceptors>
<interceptor name="session" class="com.zytc.mail.interceptor.SessionInterceptor"></interceptor>
<interceptor name="mailUser" class="com.zytc.mail.interceptor.MailUserInterceptor"></interceptor>
<interceptor-stack name="sessionStack">
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="session"></interceptor-ref>
</interceptor-stack>
<interceptor-stack name="mailUserStack">
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="mailUser"></interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="defaultStack"></default-interceptor-ref>
<global-results>
<result name="relogin">/index.jsp</result>
</global-results>
</package>
<package name="mailUser" extends="mail-default" namespace="/mail">
<action name="login" class="mailLoginAction">
<interceptor-ref name="sessionStack"></interceptor-ref>
<result name="failure">/index.jsp</result>
<result name="success">/mail/main.jsp</result>
</action>
<action name="opt" class="mailOptAction">
<interceptor-ref name="mailUserStack"></interceptor-ref>
<result name="sequential">/mail/opt/sequential.jsp</result>
<result name="listMessages">/mail/opt/listMessages.jsp</result>
<result name="getAllFolders">/mail/opt/getAllFolders.jsp</result>
<result name="setAttrs">/mail/opt/setAttrs.jsp</result>
<result name="compose">/mail/opt/compose.jsp</result>
<result name="readMessage">/mail/opt/readMessage.jsp</result>
<result name="searchMessages">/mail/opt/searchMessages.jsp</result>
<result name="folderInfo">/mail/main/folderInfo.jsp</result>
<result name="mailContent">/mail/opt/mailContent.jsp</result>
<result name="fileupload">/mail/opt/upload.jsp</result>
<result name="createFolder">/mail/opt/createFolder.jsp</result>
<result name="folders">/mail/opt/folders.jsp</result>
<!--
<result name="readData">/mail/opt/readdata.jsp</result>
-->
<result name="readData" type="stream">
<param name="inputName">inputStream</param>
<param name="bufferSize">4096</param>
<param name="contentDisposition">attachment; filename="${fileName}"</param>
</result>
</action>
</package>
</struts>


提交页面有upload控件时就抱这个错误,其他页面没有这个问题,都很正常:
严重: Could not find action or result
No result defined for action com.zytc.web.action.MailOptAction and result input - action - file:/C:/Documents%20and%20Settings/losse.z/workspace/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/zytcmail/WEB-INF/classes/struts.xml:29:48
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:350)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)


感觉是拦截器的upload控件好像是不兼容,求高人解答。
...全文
73 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
zl_bright 2009-04-11
在你input页面加入<s:fielderror />会显示出错的字段
估计会显示你的那个upload控件有问题
也许是因为upload控件中与action的属性字段类型不一致
在action中那个属性字段的类型应该是java.io.File类型
回复
jumpheightway 2009-04-11
先看进到action没有
如果进到那就是result配置的问题了
就是没有找到对应的路径
回复
zt_zhangtuo 2009-04-10
action里面我已经看过了...return的参数我在配置文件中都配置过了...如果我配置一个<result name="input"的话,,,这个result的页面是接受struts不能处理异常的页面,不能解决问题
回复
zidasine 2009-04-10
或者需要配置 <result name="input"你没有配
回复
zidasine 2009-04-10
很可能的原因是你在action中有return "xxx"而xxx在配置文件中没有配<result name="xxx"
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2009-04-10 02:01
社区公告
暂无公告