Re: [Webwork-user] Need Clarification on Workflow
Brought to you by:
baldree,
rickardoberg
From: Maurice C . P. <Ma...@Vi...> - 2000-11-29 14:14:50
|
* Rickard Öberg (ri...@te...) wrote: > Hi! > > Tim White wrote: > > Log In: Provide username and password to access application. > > > > <webwork> Not sure how this fits in. > > I think there will have to be a ServletAware action that sets a cookie > or something in the session. > > Maybe one could do a tag that extracts result data into a session. That > will allow things to be servlet agnostic. > > I.e. Login.action: > setUserName(..) > setPassword(..) > execute() -> loggedin.jsp > loggedin.jsp: > <webwork:session name="username"><webwork:property > name="username"/></webwork:session> > i.e. extract username from Login action and place in session under name > "username". This will keep the action from having to know anything about > servlets. > > This part is not complete yet, so any suggestions are welcome. > For me the Holy Grail would be to write an entire web application without ever needing to code a ServletAware action. With the excellent tags and introspection provided by Webwork, I am seeing the light at the end of the tunnel. I don't know about using tags to set the session variables and cookies. Doesn't that violate the MVC framework somewhat? The view would now be responsible for helping to maintain state. I would prefer a config file that let's Dispatcher know when an action needs a little help from with it's statefulness. Here's one possibility: <dispatcher> <statehelper name="dClickPrivacyViolator" type="cookie"> <action name="CheckForGambler" field="sitesVisited"/> <action name="CheckForPornSurfer" field="sitesVisited"/> </statehelper> <statehelper name="authorization" type="session"> <action name="Login" field="authToken"/> <action name="CheckPermissions" field="authToken"/> <action name="Logout" field="authToken"/> </statehelper> </dispatcher> This way the person writing the views doesn't have to worry about statefulness, it just looks like magic to them and the person writing the actions has control over the state of thier actions without touching the servlet stuff. Later, Maurice |