aspose file tools*
The moose likes Struts and the fly likes [SOLVED] Something wrong with DynaActionForms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[SOLVED] Something wrong with DynaActionForms" Watch "[SOLVED] Something wrong with DynaActionForms" New topic
Author

[SOLVED] Something wrong with DynaActionForms

Ed McMillan
Greenhorn

Joined: May 23, 2009
Posts: 8
Hi, have declared a /loginPage action as follows:
This action is just to show the login page without calling the Action, for that I have another action:
Then, I have a DynaActionForm declared:
And the JSP:

When I acces to the login page, an exception raises:

It seems to be a general problem with DynaActionForms, because I have a similiar problem, described here: http://www.coderanch.com/t/446649/Struts/with-LocaleAction-DynaActionForm
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575


<action name="LoginForm" path="/Login" scope="request"
type="com.bookstore.struts.actions.LoginAction">
<forward name="failure" path=".loginLayout" />
<forward name="success" path=".homeLayout" />
</action>


why here(path attribute) . insteadof / ?

also personally i suggest you to not use DynaActionForm . it wont expensive to create your own ActionForm
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Probably because it's a Tiles definition; using a "." to distinguish them from physical files has been somewhat of a convention.

I don't know any compelling reason to avoid using DynaActionForms or DynaValidatorActionForms--why write or generate code when you don't have to?
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

David Newton wrote:
I don't know any compelling reason to avoid using DynaActionForms or DynaValidatorActionForms--why write or generate code when you don't have to?


Well, but if you want to apply a common logic to all your form, it may not user friendly. example in my project all form needs to extends UserForm which is extend ActionForm
Ed McMillan
Greenhorn

Joined: May 23, 2009
Posts: 8
Problem solved, in the DynaActionForm declaration, is mandatory to put java.lang.String instead of just String:

<form-bean name="LoginForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="email" type="java.lang.String" initial="Enter your email" />
<form-property name="password" type="java.lang.String" />
</form-bean>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

seetharaman venkatasamy wrote:
David Newton wrote:
Well, but if you want to apply a common logic to all your form, it may not user friendly. example in my project all form needs to extends UserForm which is extend ActionForm
That's why I said "... if you don't have to". My S1 forms rarely had logic in them--I used them only as a way to get data from HTML forms. Even then I often subclassed DynaAction/DynaValiadatorActionForm to avoid cluttering the class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [SOLVED] Something wrong with DynaActionForms