跳转时无法到达最终页面,原先是想先是通过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>
-----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>
见我在这个帖子的回复
<action
attribute="noteForm"
input="/Admin/note/note_show.jsp"
name="noteForm"
parameter="method"
path="/note"
scope="request"
type="cn.bookshop.struts.action.NoteAction" >
<forward name="note.show.suc" path="/Admin/note/note_show.jsp"/>
</action>