This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

[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.
 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic