jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Need help from Struts guru Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need help from Struts guru" Watch "Need help from Struts guru" New topic

Need help from Struts guru

Kelly Walker

Joined: Sep 09, 2003
Posts: 24
I have a Struts 1.1 webapp.
The webapp is a wizard style app. The flow is defined in the struts -conf.
For example:
page a forwards to page b.
page b forwards to page c.
page c forwards to page d.
My question:
How do I maintain the integrity of the flow?
How do I stop a user who is viewing page a from jumping straight to page d by simply entering /paged.do in the browser.
I must ensure my follows the correct flow and cannot circumvent the flow. He/she must vist a - b - c - d in that order. If they do not then we will forward them back to the start.
I need a generic solution. I would like to have the logic in an extended ActionServlet perhaps. I can't think of a simple solution though.
Experts can you help???
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63346

Moving to the Struts forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bruno Korcinski

Joined: Jun 03, 2003
Posts: 16
I dont know if struts has some system to do it/i'm beginner/
just only came om my mind ..put to the session scope attribute let say
flow="" and in page "a" you will put "a" in page b you will put "ab"..and so onin page b you can check flow=="a" ??? if not forward to page "a"...
I dont know if it's good solotion or not...
Srikanth Shenoy
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Your scenario is a classic case for using Struts workflow extensions.
Dont start developing anything by yourself.
It will turn into a project by itself.....
Go to www.livinglogic.de and download the workflow extension.
Their tutorial and a simple dmoe is quite good and enough to realize to how to do it.
You have to basically modify your struts-config.xml and use WorkflowActionMappings, WorkflowRequestProcessor etc...
Hope this helps.
Author: Struts Survival Guide - Basics to Best Practices

Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
Emilio Butrage´┐Żo

Joined: Mar 05, 2004
Posts: 8
I will agree with Srikanth, that is probably the easiest solution. Good luck.
Kelly Walker

Joined: Sep 09, 2003
Posts: 24
Just what I wanted.
I agree. Here's the link: http://aspose.com/file-tools
subject: Need help from Struts guru
It's not a secret anymore!