Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

controlling the actions to be called

 
venkateshwar rao ravula
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,

i have around 50 actions in my web appliation.if application starts from the index page everything is working fine. if i enter the url like http://local;ahost:8888/app/joinstep2.do in browser i am getting the probem ,because it is mandatory that http://local;ahost:8888/app/joinstep1.do should execute before join step2

please help me to handle this type of situations.if user enters any url like above it shuld redirect to login page

Any Help is appreciated

Thanks
RvRao
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have around 50 actions in my web appliation.if application starts from the index page everything is working fine. if i enter the url like http://local;ahost:8888/app/joinstep2.do in browser i am getting the probem ,because it is mandatory that http://local;ahost:8888/app/joinstep1.do should execute before join step2


Users should not have any idea what those URLs are. Users should only know about the View (HTML/JSP pages).

You can write code in the joinstep2 Action class that will check to see if joinstep1 Action has executed. If not, send the browser an error page or some other page that states they nees to do whatever joinstep1 requires.

Also, the first word in English sentences is capitalized. And the word 'I' is always capitalized.
[ September 22, 2008: Message edited by: James Clark ]
 
tapeshwar sharma
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if user enters any url like above it shuld redirect to login page

If you mean any url, then probably you would like to write a filter in web.xml.
However, since the 2 URLs that you gave look like they are step 1 and then step 2 towards a particular goal (and therefore not a generic requirement for all the action mappings in you application), you can implement a more localized solution in step 2 : like checking for some value in the session that is set by step 1.If it is there, then go ahead, otherwise present the login page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic