在我的action中有如下代码:
request.setAttribute("conn",conn);
return mapping.findForward("toTable");它对应的forword
<forward name="toTable" path="/selectTable.do" />那我在SelectTableAction中
Connection conn=(Connection)request.getAttribute("conn");
获得的是null也就是conn没有传过来,这是为什么啊?
request.setAttribute("conn",conn);
return mapping.findForward("toTable");它对应的forword
<forward name="toTable" path="/selectTable.do" />那我在SelectTableAction中
Connection conn=(Connection)request.getAttribute("conn");
获得的是null也就是conn没有传过来,这是为什么啊?
2. Boolean doEdit = false;
3.
4. return new ActionForward("/myaction.do?userid="+userid + "&teamUser="+teamUser + "&doEdit="+doEdit); 这样转好了
Jboss Struts Spring Hibernate DB javascript jquery 等相关技术讨论
conn是在前一个action中生成的
手头没有STRUTS的东西 你找一下STRUTS中findForward()方法的代码看看。
Connection conn=(Connection)request.getAttribute("conn"); 这个是肯定得不到数据的
你可以放在session里面 或者
没有使用<forward name="toTable" path="/selectTable.do" redirect="true"/>
因此不是重定向,我怀疑conn在request.setAttirbute()之前就是null.