Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hitting a different Struts action with DisplayTag Pagination

 
Gerard Kelly
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look at the requestURI attribute of the table tag. That must solve your problem...
 
Gerard Kelly
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Welcome !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic