• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DynaValidatorForm and my problem

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have to do the following
I have a jsp which has a button add, when i click this
button it goes to a DispatchActionClass which has a
add method, to forward it to add.jsp
In this add method i populate dyanValidatorForm with
a collection, which i get from database,
Then i put this form in request and forward it to
add.jsp which displays the collections, so far so
good.
But when i am on add.jsp and submit , and if there is
error then DynaValidatorForm tries to reload the page
and fails giving error
Failed to obtain specified collection
I can understand since there is no collection after i
submit add.jsp as it was in rewuest scope?
How can i solve this problem
These are my struts-config.xml definiations
<form-bean name="TestImageAddForm"
type="org.apache.struts.validator.DynaValidatorForm"
dynamic="true">
<form-property name="name"
type="java.lang.String"/>
<form-property name="options"
type="java.util.Collection"/>
<form-property name="selected"
type="java.lang.String"/>
</form-bean>
/** this is my DispatchAction to forward to my add.jsp
**/
<action name="TestImageForm"
type="com.testapp.action.TestImageButton"
validate="false" input="/pages/testimagebutton.jsp"
parameter="nextpage" scope="request"
path="/pages/TestImageButton">
<forward name="addbutton"
path="/pages/testaddbutton.jsp" />
</action>
/** this is my add action form where i validate the
inut** and if there is error then the reload fails
**/
<action name="TestImageAddForm"
type="com.testapp.action.TestAddAction"
validate="true" input="/pages/testaddbutton.jsp"
scope="request" path="/pages/TestAddAction">
<forward name="add"
path="/pages/testaddbutton.jsp" />
</action>
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic