This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Hitting a different Struts action with DisplayTag Pagination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hitting a different Struts action with DisplayTag Pagination" Watch "Hitting a different Struts action with DisplayTag Pagination" New topic
Author

Hitting a different Struts action with DisplayTag Pagination

Gerard Kelly
Greenhorn

Joined: Mar 22, 2009
Posts: 11


Hi,

I'm trying to implement displaytag pagination with a little different funcitonality. Basically, I have 3 displaytag tables on my jsp, and when the user wishes to see the next set of results on one of them it brings them to a new resultant jsp which only displays the info from the table they wished to paginate.

This should be relatively simple to do. However when the user clicks a pagination link, displayTag hits the ORIGINAL struts action that it used in displaying the original data. I want to be able to hit a new struts action.

I don't think I've explained that terribly well so heres a little example.

1. User does a search.
2. A struts action called 'searchAllTypes' is hit and returns a jsp.
3. Results for 3 different types (x,y and z) are displayed in 3 seperate tables.
4. User wishes to see the next 10 results for table y so clicks 'next' on y's table.
5. A struts action called 'searchYType' is hit and returns a new jsp.

Thanks to anyone who can help me with this.

-gearoid.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

look at the requestURI attribute of the table tag. That must solve your problem...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Gerard Kelly
Greenhorn

Joined: Mar 22, 2009
Posts: 11
It would seems as though I can hit a new Struts action but not a new method. For example, if I first hit a method called searchAllTypes then this method is constantly being hit for pagination despite changing the RequestURI....


Any help very much appreciated.
a kishore
Ranch Hand

Joined: Sep 16, 2009
Posts: 82

Hi Gerard,

I think you can pass parameter in requestURI, either for same action or for different action. Then by using that parameter you can call different method based on if-else condition is it ? If you are not sure how to pass parameter, you can pass like this:



I hope this can help you.

regards,
kishore
Gerard Kelly
Greenhorn

Joined: Mar 22, 2009
Posts: 11
a kishore wrote:
Hi Gerard,

I think you can pass parameter in requestURI, either for same action or for different action. Then by using that parameter you can call different method based on if-else condition is it ? If you are not sure how to pass parameter, you can pass like this:



I hope this can help you.

regards,
kishore


Perfect! Thanks so much Kishore!
a kishore
Ranch Hand

Joined: Sep 16, 2009
Posts: 82

Welcome !!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hitting a different Struts action with DisplayTag Pagination
 
Similar Threads
Struts Pagination
Pagination
pagination in jsp
Pagination
Pagination Framework/libraries