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 / October 2006

Tip: Looking for answers? Try searching our database.

Problem with alert in JSP

Thread view: 
mohammed.naghman@gmail.com - 13 Oct 2006 21:03 GMT
Hi all,

I have a a jsp page that enters the form values into the database. I
need to check if the userid entered for new signup is already taken.

If yes, then I need to show an alert and then remain on the same page.

I am unable to stay on the same page after showing the alert. Is there
a way to solve this problem?

I know that JSP runs on server and java script runs on client.

But is there any work around for this?
Manish Pandit - 14 Oct 2006 04:47 GMT
One way to do it is to retain all the form values in your action
(assuming you are using struts), and then check for userID. If already
taken, set the retained values back in the request and have the
controller render the signup page again. Code the page in a way that it
prints values from the bean that is in the request - if there is none,
it'd be empty anyway. When you do an actionMapping.findForward() do not
use redirect=true.

I know all this sounds a little complicated but if you've used or are
using struts, it is pretty straightforward.

-cheers,
Manish


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.