• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help from Struts guru

 
Kelly Walker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum.
 
Bruno Korcinski
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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"...
hmmm
I dont know if it's good solotion or not...
Igor
 
Srikanth Shenoy
author
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kelly,
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.
Srikanth
Author: Struts Survival Guide - Basics to Best Practices
 
Emilio Butrage´┐Żo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will agree with Srikanth, that is probably the easiest solution. Good luck.
 
Kelly Walker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fantastic.
http://www.livinglogic.de/Struts/
Just what I wanted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic