Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reload page with additional parameter?

Status
Not open for further replies.

tabaar

Programmer
Jun 12, 2001
34
0
0
US
Hi!

I'm writing a site with the following simple structure: JSP using taglibs is for page structure, and taglibs are for applying XSLT to XML. Model uses XPath to extract needed XML , and there is no controller. Typical JSP is like that news.jsp:

<my:page>
<my:header title="News" />
<my:news show="10">
<my:rangeSelector />
</my:news>
</my:page>

This displays a page with 10 news list and a range selector string like that:
1..10 | 11..20 | 21..25

Tag my:rangeSelector asks its parent tag my:news (which implements IHasRange, so as my:photos for photogallery thumbnails grid, etc.) about the total number of news to form that range selection string. The idea is the following: after the user clicks for example on 11..20, there goes a request, the same as the previous one, but with additional parameter, something like rangeStart=11. The question is HOW TO ACHIEVE THIS keeping in mind that my:rangeSelector knows nothing about its parent, but that it should implement IHasRange. In other words, how to reload the current page with the same set of parameters, and one more additional parameter, without explicit specifying the page, i. e. without that:

<my:rangeSelector target="news.jsp" />

Maybe Struts as a controller can help? I have no idea about it...

Thanks a lot! :)

-----
Constantine Kulak
FAMI BSU, IBA BY
 
1) You may use session to keep track of the current of each user(There may be many sessions)
or
2) <my:rangeSelector target="news.jsp" /> may be a better solution if you can replace news.jsp with a Java class that act as a simple calcuator.
If you pass in current=100&size=10, that Java class return 110 for you in getting next set of data
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top