Re: [studs-user] Studs and LazyForms
Status: Beta
Brought to you by:
mojavelinux
|
From: Juan C. R. A. <jc...@um...> - 2007-02-13 14:06:29
|
Newton Wagner wrote:
> I think it's because doing that, I can use one class with two or more
> methods... an action called UserAction could have deleteUser() and
> addUser() methods.
>
> It's the way that Java programmers works here. And we want to use
> Studs to use the same framework for both languages.
Uhmm yes it's a matter of taste ;-)
I have hit almost the same stone. One action must to behabiour itself
depending
of the context in which it was called. How I resolved this?
In struts-config.xml
...
<action path="/addUser"
type="action.UserAction">
<forward name="index" path="/pages/action.psp"/>
</action>
<action path="/deleteUser"
type="action.UserAction">
<forward name="index" path="/pages/action.psp"/>
</action>
...
in classes/action/UserAction.php:
...
if ($request->getServletPath() == '/deleteUser.do')
{
$this->deleteUser(...);
}
else
{
$this->AddUser(...);
}
...
At the end, listing the action in struts-config.xml is the same to map
differents action with the
same handler. Because you must to explicity write concrete actions in a
static file.
> People here uses LazyForms for Struts.. but I did not found something
> like that for Studs... You know an active maillist or forum about
I'm sorry. I don't know :-(
Juan Carlos
|