• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hitting a different Struts action with DisplayTag Pagination

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Welcome !!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic