> Hello Struts users,
> 
> We are currently evaluating Struts and other web (MVC) frameworks and would like to 
>ask you some questions:
> 
> - Is there some struts-config XML-generation from some
>   modeling tool (Rose for instance) ?
> 
>   We would like to design a state or activity diagram in
>   such a tool then generate the navigation XML file.
> 
> - Can struts behave like a real state machine ?
> 
>   i.e. how to ensure that some Action is performed only if
>   another Action (or view but is not ideal) has been
>   performed with some result (success to be simple). We
>   would like this to be Struts-controlled, not developper-
>   controlled (check session variables, etc.).
> 
>   We found the built-in Struts token system but this seem
>   only to be used to demarcate transactions in a set of
>   views. This allow to demarcate a transaction end (token
>   value change) but not an inconstency within the
>   transaction (i.e. i valide twice the first page of the
>   transaction) as the token value will not change.

I hit the same weakness of struts a few months ago and I enhanced some struts
classes in order to be able for each action to specify which action has to
precede this action. This allows you to implement some kind of control flow. For
instance you can now define an action that displays a logon page (displayLogon)
and specify in the next action (logonAction, which gets executed when the user
presses the submit button of the logon page) that displayLogon needed to be
executed directly before. This is more powerful than the token mechanism.

What I also did at the same time is an enhanced user authentication checking for
each action. You can now specify a different user authorization class for each
action, so you can easily implement a very fine grained user authorization.

Exceptions (either control flow or user authentication exceptions) are handled
by the framework and cause a forward to different error pages.

I plan to propose this enhancement to the struts developer's group after release
1.0 is out. If you are interested in the meantime I can send you the code.

> - Why does the struts-example perform some scoped-
>   variables cleanup at the end of every Action ?
> 
>   As these variables are defined as scoped in the struts-
>   config XML file, they should naturally live during the
>   specified scope lifetime. We don't understand that in the
>   struts-example (maybe this is not mandatory).

My understanding is: For request scope you normally do not need to clean up,
because the object gets removed automatically, when the request is served. For
the session scope you pretty often want to remove e. g. a form bean, when it is
no longer needed to keep your session data lean.

> Thank you very much for your informations about Struts.
> 
>   Laurent.

--- Matthias

S/MIME Cryptographic Signature

Reply via email to