Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes DynaValidatorForm and my problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DynaValidatorForm and my problem" Watch "DynaValidatorForm and my problem" New topic

DynaValidatorForm and my problem

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 131
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
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"
<form-property name="name"
<form-property name="options"
<form-property name="selected"
/** this is my DispatchAction to forward to my add.jsp
<action name="TestImageForm"
validate="false" input="/pages/testimagebutton.jsp"
parameter="nextpage" scope="request"
<forward name="addbutton"
path="/pages/testaddbutton.jsp" />
/** this is my add action form where i validate the
inut** and if there is error then the reload fails
<action name="TestImageAddForm"
validate="true" input="/pages/testaddbutton.jsp"
scope="request" path="/pages/TestAddAction">
<forward name="add"
path="/pages/testaddbutton.jsp" />

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: DynaValidatorForm and my problem
It's not a secret anymore!