• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[SOLVED] Something wrong with DynaActionForms

 
Ed McMillan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic