Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 用hibernate+struts跳转时出现的问题!
lego2816





发贴: 2
积分: 0
于 2008-06-01 16:53 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
跳转时无法到达最终页面,原先是想先是通过index.jsp页面 <logic:redirect action="/note.do?method=show"/>转至一个action 用action连接数据库后放在request,然后转至note_show.jsp。但是最后结果只是停在action那里。我很急!!希望大家多多指教!谢谢大家啊!!!部分主要代码如下:
-----index.jsp
<logic:redirect action="/note.do?method=show"/>

----NoteAction.java
public ActionForward show(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)
{
ApplicationContext ctx=new ClassPathXmlApplicationContext("ApplicationContext.xml");
NoteDAO dao=(NoteDAO)ctx.getBean("NoteDAOProxy");
List notes=dao.findAll();
request.setAttribute("note",notes);
return mapping.findForward("note.show.suc");

}

-----note_show.jsp
<logic:iterate id="note" name="note" >
<table>
<tr> <bean:write name="note" property="menber"/> </tr>
<tr> <bean:write name="note" property="title"/> </tr>
<tr> <bean:write name="note" property="ncontent"/> </tr>
<tr> <bean:write name="note" property="publishtime"/> </tr>
</table>
</logic:iterate>



作者 Re:用hibernate+struts跳转时出现的问题! [Re:lego2816]
lwb314





发贴: 6
积分: 0
于 2008-06-04 12:50 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
mapping.findForward()会去Strutsconfig.xml里查找要跳转到的页面,你看看你在那里对应note.show.suc的跳转地址设置好了没,设置好了应该会跳转的



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923