Store the queried data in the session
Public String FindAll () {
List<student> list= Studentbiz.findall ();
HttpServletRequest request=servletactioncontext.getrequest ();
Request.getsession (). SetAttribute ("studentsession", list);
return "Findallsuccess";
}
Take out the data that exists in the session
<s:iterator value= "#session. Studentsession" var= "Slist" >
<tr>
<td> <s:property value= "#slist. Stuid"/></td>
<td> <s:property value= "#slist. Name"/></td>
<td> <s:property value= "#slist. Sex"/></td>
<td> <s:property value= "#slist. Sdate"/></td>
<td> <input name= "button" id= "button" onclick= "doit (' del ', <s:property value=" #slist. Stuid "/>);"
Value= "Delete" class= "Input-button" type= "button"/></td>
<td><a href= "" > Update </a></td>
</tr>
</s:iterator>
Store data in a stacked way
List<categorys> Categorylist=categoryservice.findall ();
Store data store data using a stack-up approach
If you use session to store data, you may need to refresh the page to get data
Servletactioncontext.getrequest (). GetSession ()
Putting data into the stack
Actioncontext.getcontext (). Getvaluestack (). Set ("CategoryList", categorylist);
Take the data () in the JSP page
<s:iterator value= "CategoryList" var= "C" >--------------note there's a different way to get data from the session. Session is using #categorylist
<dl>
<dt>
<a href= "${pagecontext.request.contextpath}/image/vegetables-Powered by Mango team.htm" >
<s:property value= "#c. CName"/>
</a>
</dt>
<s:iterator value= "#c. Categoryseconds" var= "cs" >--------------because what I'm storing here in Java code is the first class category. Level two classification (relationship between database tables)
<dd>
<a>
<s:property value= "#cs. CSName"/>
</a>
</dd>
</s:iterator>
</dl>
</s:iterator>
JSP page data interacts with the action data using the navigation map language and set injection