Spring comes with JPETSTORE analysis (3)

xiaoxiao2021-03-06  14

Search and Page Search Tool Interfaces are included in includetop.jsp,

" Method = "post"> configured in Struts-Config.xml : SearchProductSAction By judging Parameter is Search or Page to distinguish whether the query or the post a few pages, if it is the Search form to commit, Search. Because , if it is displayed different pages, the URL contains Page, URL: ... / SHOP / SEARCHPRODUCTS.DO? Page = previous, if not The parameter is just a refresh. Here is a feature of Spring, org.springframework.beans.support.pagedListholder.PagedListholder (List arg0). This class provides two methods for NEXTPAGE and PREVIOUSGE. In fact, this paging function requires all data to remove, and then a part is displayed. This approach is not suitable if the amount of data is large. The results of the query in the action are PagedListholder objects to appear in the session, and the object is accessed to display the content. There is no way to process the direct input address, such as directly entering http: // localhost: 8080 / jpetstore / shop / searchProducts.DO? Page = previous, as long as the Judgment Session is added You can solve this problem with this object.

============================== Display goods directory (classification display) In ViewCategoryAction, processing displaying product species and paging display, structure, and lookup paging, but here is directly accessed HTTP: //localhost:8080/jpetStore/shop/viewcategory.do has been processed. If you don't query any item, you don't have ViewProductAction_category in the session, throw an error. Display Commodity (with ID) This structure and Finding paging is similar, and there is no way to access this Action directly without parameters. It also uses Spring's PagedListholder to handle paging.

Display Product Details This does not use paging, directly using Bo Methods to get data, deposit into session, and the JSP page is displayed. This has not been processed without finding the data.

转载请注明原文地址:https://www.9cbs.com/read-48847.html

New Post(0)