Kirk,
I am curious if it is possible to dynamically create and/or modify an
> action's view mappings for a particular request with WW?
> Lets say you have a multi-paged user profile service. After you submitI'm not sure if its necessary or not so you let me explain the problem.
> a page, the destination success page depends on your current role (e.g.
> child vs. adult). How would you build that intelligence into a WW action?
> An action's success page depends on the role of the user.
If I understand what your question is then you just need to check the user's role in your doExecute() method and return an appropriate result code. For example:
public String doExecute() {
// .. All profile logic here ...
// I assume you have some sort of method
// to get a user and their role?
if (getUser().getRole() == Role.CHILD) {
return "childsuccess";
}
else if (getUser().getRole() == Role.ADULT) {
return "adultsuccess";
}
else {
addErrorMessage("Unrecoginzed role");
return ERROR;
}
}
Then in your actions.xml file you'd need something like:
<actions>
....
<action name="foo.MyAction" alias="foo">
....
<view name="childsuccess">childsuccess.jsp</view>
<view name="adultsuccess">adultsuccess.jsp</view>
</action>
....
</actions>
Is that what you were looking for?
Regards,
--Bill
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork