Problem:
The self-developed paging control is used for JSP page query. This paging control achieves synchronization. The entire page is refreshed every time you submit a query.
The query condition is the year, city, and county values. After refreshing, the three controls are reset to the initial state. It is quite troublesome to maintain the value status during the query.
How can the value of the query condition remain unchanged after the query?
Solution:
1) Place the Three query condition controls in a div.
2) Add a struts den struts tag to the JSP page to store the HTML text of the div.
3) obtain the value of hidden in the onload event on the page. If it is not empty, set the value to the HTML text of the div.
4) write the HTML text of the DIV to the value of hidden in the query event.
Ideas:
Use the struts tag and Action property variable binding technology to store client variables.
Solved the problem that variable values cannot be stored after refreshing on the client.
Specific process:
1) write the value to the struts tag before refreshing the page.
2) When a query is submitted, the struts tag value is automatically written to the variable with the same name (Tag Name attribute) as the tag in the action class.
3) After refreshing the variable, the value is written to the value attribute of the struts tag.