Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Small problem with error handling [Struts]

Thread view: 
vysh - 03 May 2007 09:35 GMT
hi,
                                  I have an updation form.On click of
the update button I am doing some validations in my Action class.In
case of any error it will redirect back to the input page.
Now comes my problem.As I have told you,my form is an updation form.So
it contains field already set with some values,a bean.When the
error ,redirects control back to the input page,the newly enterd data
is not displayed and instead the old bean contents are resetted.How to
persist the newly entered data?

any suggestions?
thanks,
vysh
Sanjay - 03 May 2007 13:45 GMT
> hi,
>                                    I have an updation form.On click of
[quoted text clipped - 9 lines]
> thanks,
> vysh

Are you using validator framework? If not I would suggest you use that.
Otherwise if you are writing your own code for error checking in action
classes, create a form bean and copy all the user input. Set this bean
in request scope, so that when you forward back to the jsp page, it will
be available there.
vysh - 04 May 2007 06:31 GMT
> > hi,
> >                                    I have an updation form.On click of
[quoted text clipped - 15 lines]
> in request scope, so that when you forward back to the jsp page, it will
> be available there.

Thanks a lot for your reply,sanjay.
Let me not think of using the validator framework now.So comes the
second option.
I am validating it in the action class.Let the formbean, which gets
populated be x.
As u told,I will create another bean 'y' with the same contents as
x.But how to copy the contents of x to y.
Do I have to set each setter or is there any way for bulk
setting?.Also l have to clear the bean x as I am using the same
Actionform for another jsp page.

waiting for your reply,
thanks,
vysh.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.