Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts and Form validation

Thread Tools

Struts and Form validation

Posts: n/a

I'm having a basic problem using struct.

All I want to get to is to show a collection in a select box and if the form is
incorrectly filled out after a submit the same collection is shown and the
selection that the user made is still selected.

I have a collection which from an struct action gets added to the request
object via setAttribute("types",collection). When the action then forwards onto
the jsp the jsp then uses the collection in a select tag, like this as part of
a form
<html:select property="userType">
<htmlptions collection="types" property="typeid" labelProperty="typename"/>
this works fine when the jsp is first called.

When the form is submitted and the validate is called on the Form object and an
non empty erroraction is returned the jsp fails, due to the fact that the
collection isn't any longer in the request object.

Can anybody guide me in the right direction.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Form Beans and Validation in Struts D. Mantelos Java 9 05-03-2007 02:39 PM
Struts Validation Framework: suppressing startup output from validation.xml javadude Java 0 02-16-2005 05:37 PM
Struts validation for combine form fields validation Sumith Mathur Java 0 09-23-2004 06:26 PM
Form Validation Problem...Persisiting form fields on validation failure. bnp Javascript 4 05-12-2004 12:16 PM
form validation problem with velocity-struts and errortool Leo Gaggl Java 0 04-05-2004 10:38 AM