File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes controlling the actions to be called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "controlling the actions to be called" Watch "controlling the actions to be called" New topic
Author

controlling the actions to be called

venkateshwar rao ravula
Greenhorn

Joined: Apr 03, 2006
Posts: 15
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

Joined: Apr 16, 2008
Posts: 2187
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

Joined: Mar 10, 2006
Posts: 245

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: controlling the actions to be called