我的一个页码要显示多条记录
1 是去别的页码先查上来在显示
用Struts1.2
只要struts.config.xml的范围设置成Session查下一条的时候返回页码上一条应该还在吧
我设置了好像没用。。是 不是Action里面 request.setAttribute("someList2", someList);
也设置成session还是在jsp里的EL表达式中 <c:forEach items="${someList}" var="u">这里还要设置什么。。
<struts-config>
<action-mappings>
<action path="/index"
type="com.name.servlet.IndexAction"
scope="session"
>
<forward name="success"
path="/indexinsert.jsp"/>
</action>
1 是去别的页码先查上来在显示
用Struts1.2
只要struts.config.xml的范围设置成Session查下一条的时候返回页码上一条应该还在吧
我设置了好像没用。。是 不是Action里面 request.setAttribute("someList2", someList);
也设置成session还是在jsp里的EL表达式中 <c:forEach items="${someList}" var="u">这里还要设置什么。。
<struts-config>
<action-mappings>
<action path="/index"
type="com.name.servlet.IndexAction"
scope="session"
>
<forward name="success"
path="/indexinsert.jsp"/>
</action>
request.setAttribute( "someList2 ", someList);
既然放到session中 就不是request了session.setAttribute( "someList2 ", someList);
ps:楼上恶心的头像好久不见了
要查询,不用再生成session,直接页面获取的时候历遍判断,满足则输出,不满足则跳过。
session.setAttribute("someList", someList);在Action里面写上这句话就有错误提示session cannot be resolved是不是少了那个方法!
request.getSession().setAttribute
在结帐时候应该怎么销毁最好
应该用的是session来放置才对啊
<c:forEach items= "${someList2} " var= "u "> 是不是写错了呀?