google+baidu都没有搞定,遗留的问题了。今天又碰到,就发来请教高手。
不是路径的问题也不是页面的属性和action中的属性类型不匹配!!!
<action name="updateGallery" class="galleryAction" method="updateGallery">
<result >/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>
<!-- <result type="redirect">/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>-->
</action>当<result >/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>写成这个时就会报上面的错误。跟踪调试返回的是SUCCESS,操作成功!不知道为什么报错
当<result type="redirect">/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>写成这个时就不报错哦了!
很纳闷。想弄明白这个为什么?分只有20分,望高手指教
不是路径的问题也不是页面的属性和action中的属性类型不匹配!!!
<action name="updateGallery" class="galleryAction" method="updateGallery">
<result >/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>
<!-- <result type="redirect">/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>-->
</action>当<result >/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>写成这个时就会报上面的错误。跟踪调试返回的是SUCCESS,操作成功!不知道为什么报错
当<result type="redirect">/gallery/fetchAllGallery.action?gallery.uid=${gallery.uid}</result>写成这个时就不报错哦了!
很纳闷。想弄明白这个为什么?分只有20分,望高手指教
要是你成功后直接转到一页面,就不需要用redirect
<result type="success">/gallery/fetchAllGallery.action</result>
<result name="input">/add.jsp</result>
<result name="error">/error.jsp</result>
</action>?gallery.uid=${gallery.uid} --这个属性直接放到action中读取不就行了,还能这样子传 ?》
<result type="redirect">/gallery/fetchAllGallery.action</result>
<result name="input">/add.jsp</result>
<result name="error">/error.jsp</result>
</action>?gallery.uid=${gallery.uid} --这个属性直接放到action中读取不就行了,还能这样子传 ?》
<result name="input">/add.jsp</result>这个试试看
<result name="success">index.jsp</result>这样就可以了
但你这个是重定向要加一个type
<result name="success" type="redirectaction">这里是你action的名字updateGallery</result>
还有
<result name="success" type="redirect">updateGallery这里要加.action</result>
就是说redirect要写一个完整的请求路径而redirectaction写action的名字就可以。
<result name="success" type="redirectAction">
<param name="actionName">fetchAllGallery</param>
<param name="namespace">/gallery</param>
<param name="gallery.uid">${gallery.uid}</param>
</result>
</action>
<result>/blog/showAllDraft.action?uid=${blog.uid}</result>
</action>这是我项目中的,也可以跳转的!疑惑就是这个。如果直接不能跳转就算了,有了一次,就不爽,搞不懂什么原因