• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

[SOLVED] Something wrong with DynaActionForms

 
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: https://coderanch.com/t/446649/Struts/with-LocaleAction-DynaActionForm
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • 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
 
Author
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 Windows XP Java
  • 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
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.
 
For my next trick, I'll need the help of a tiny ad ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic