Extending DynaActionForm

2003-09-11 Thread Erez Efrati
Hi,

Using DynaActionForm and DispatchAction it would have been helpful ift
there was a way to create a BaseForm extending the DynaActionForm, which
always adds the 'method' property to the DynaForm. Is this possible?

Thanks,
Erez



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Extending DynaActionForm

2003-09-11 Thread Mick Knutson
 name. This is
* a convience method.
*/
public Object getApplicationObject(String attrName)
{
return servlet.getServletContext().getAttribute(attrName);
}

/**
* Retrieve an object from the application scope by its name. This is
* a convience method.
*/
public boolean isLoggedIn( HttpServletRequest request )
{
try
{
UserContainer container = getUserContainer(request);
if ( container.getUserLightDto() != null )
{
return true;
}
else
{
return false;
}
}
catch(NotLoggedInException e)
{
return false;
}

}

/**
* Method which is dispatched to when there is no value for specified
request
* parameter included in the request. Subclasses of DispatchAction should
* override this method if they wish to provide default behavior
different
* than producing an HTTP Bad Request error.
*/
public ActionForward unspecified(ActionMapping mapping
,ActionForm form
,javax.servlet.http.HttpServletRequest
request
,javax.servlet.http.HttpServletResponse
response
)
throws java.lang.Exception
{
return defaultMethod(mapping
,form
,request
,response
);
}

public abstract ActionForward defaultMethod( ActionMapping mapping
,ActionForm form

,javax.servlet.http.HttpServletRequest request

,javax.servlet.http.HttpServletResponse response
)
throws java.lang.Exception;


} // The End...


==

---
Thanks
Mick Knutson
http://www.baselogic.com

+001(805) 563-0666 Office
+001 (708) 570-2772 Fax
---

- Original Message - 
From: Erez Efrati [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 8:33 AM
Subject: Extending DynaActionForm


 Hi,

 Using DynaActionForm and DispatchAction it would have been helpful ift
 there was a way to create a BaseForm extending the DynaActionForm, which
 always adds the 'method' property to the DynaForm. Is this possible?

 Thanks,
 Erez



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Extending DynaActionForm to prevent reset

2002-12-05 Thread Etienne Labont
Hi,

I have a session-scoped form that spans on many tabbed pages. Once data is
entered on one or many pages I want to be able to switch back to any page
using the tabs. The tabs point (GET) to the same action that handles
postbacks. A problem I had with this was the reset method of the associated
form being called upon tabbing... The way I found to prevent this is to
extend the DynaActionForm and override the reset methods so they do nothing.
I wrote my own altReset method that I call when the user actually wants to
reset the form. If there are better ways to do this, please tell me. Also
what do people think about adding an attribute to action mappings to control
this behavior. It could be something like:
formReset=(auto/never/beforeGET)



Etienne



Re: Extending DynaActionForm to prevent reset

2002-12-05 Thread Gemes Tibor
2002. december 5. 16:19 dátummal Etienne Labonté ezt írtad:
 nothing. I wrote my own altReset method that I call when the user actually
 wants to reset the form. 

I did the same.

 If there are better ways to do this, please tell
 me. Also what do people think about adding an attribute to action mappings
 to control this behavior. It could be something like:
 formReset=(auto/never/beforeGET)

You can set any properties for your ActionForm with the set-property tag in 
the struts-config.xml. Check the DTD. 

Tib

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Extending DynaActionForm

2002-07-26 Thread @Basebeans.com

Subject: Re: Extending DynaActionForm
From: Kevin Henrikson [EMAIL PROTECTED]
 ===
Yes simply subclass it and add your custom validate() and reset() methods.
Make sure you have dynamic=true when you define the form bean in
struts-config.xml (unless you are running the nightly build) where this is
no longer required.

-kevin

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

 Is it possible to extend the DynaActionForm or something similar into a
 new Form Bean?

 What I want to do is have an object for a formbean, but be able to add
 in my own validate and reset code...

 The things I have tried have not worked for me...






 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]