Your "myVector" object is placed in request scope, so it is not present
anymore in the next request, when the user submits the form. To display the
JSP after validation error detection you need to put this object in session
scope.
using <jsp:useBean id="myVector" class="java.util.Vector" scope="request" />
tells the JSP compiler to look for your object and if none is found create a
new (but empty) one of class "java.util.Vector", so your JSP can redisplay
the page with errors but with no datas.
If you don't use scriptlets in your JSP, this <jsp:useBean> is not
necessary.
> Hi,
> I have a problem in rendering data from an object that is
> bound to request object in myaction class.
> request.setAttribute("myVector",results);
> and that is fetched and put it in html select component in myJSP.
>
> <jsp:useBean id="myVector" class="java.util.Vector" scope="request" />
>
> <html:select property="selectStatus">
> <html:options collection="myVector" property="value"
> labelProperty="label"/>
> </html:select>
> So far this is fine..
> When I'm validating the form that is in myJSP.jsp
> and if it finds any errors the same page(myJSP.jsp) is supplied back to
> user,
> but i am not able to see the data in select box again,
>
> How could i get the data that is in myVector instance as it is bound to
> request.
> or How could i retain the data in select box.
>
> I can't bind myVector object to session scope.
> Can any one help me out in this?
>
> Many Thanks,
> rayaku
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>