*
The moose likes Servlets and the fly likes PLEASE TAKE TIME TO READ THIS MESSAGE!!!URGENT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "PLEASE TAKE TIME TO READ THIS MESSAGE!!!URGENT" Watch "PLEASE TAKE TIME TO READ THIS MESSAGE!!!URGENT" New topic
Author

PLEASE TAKE TIME TO READ THIS MESSAGE!!!URGENT

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
I am working on a jsp page rightnow which contains one text field,textarea and a file . The form enctype is multipart/form-data. Form method is post. I have two images on that perticular page say "submit" and "morefiles". What i am trying to do rightnow is once the user clicks any of those two images it will post to the page mentioned in action attribute of the form. In that page i am trying to figure out which image has been clicked. If the "morefiles" has been clicked then i need to redirect the user to a different page where he should be able to see the info he had entered so far and also the file he had attached before and provide him the ability to add more files. My problem is i can't redirect him to a different page.I have used response.setDirect,response.reDirectUrl. I think the problem is related to the enctype("multipart/form-data"). How ad i get this thing done.
PLEASE HELP ME. I HAVE A DEADL INE TO FINISH THIS MY MONDAY.
PLEASE HELP ME.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Shiva,
One of the following 2 techniques will help. Please try it out. I used them in many occations and they work fine. 'res' and 'req' are the HttpRequest anf HttpResonse objects. Also note that for the .forward 2nd technique, the argument must always starts with a slash. '/'. The difference between the 2 techniques is , in .forward, the response COMES BACK and executes the following statements after .forward statement whereas in .sendRedirect, the response DOES NOT come back and if there is any following statements they will not be executed.
regds
maha anna


[This message has been edited by maha anna (edited September 16, 2000).]
 
 
subject: PLEASE TAKE TIME TO READ THIS MESSAGE!!!URGENT
 
Similar Threads
form.enctype
File upload doesn't work when additional form elements introduced
[Help, File Upload encounter OutOfMemoryError]
Form method and type
file uploading