Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts and adding parameter to URL

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an action class that creates a record(category) in a database. I then get the new primary key for the inserted record(category). I then "redirect" the user to another action class that will search the database for that category using this id and display values associated with it.

My question is how do I append this value to a URL i.e.

/displaycategories.do?categoryid=6

How do I set this value in one action class then redirect the user to another action class and retreive this value from the URL.

thank you
david
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be good enough to do request#setAttribute() to pass the argument to the other action?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!