| Author |
File Upload JSP
|
Rohit Malhotra
Greenhorn
Joined: Jan 29, 2006
Posts: 21
|
|
Hi, I have written a JSP for File Upload which has a form element <"FORM ENCTYPE="multipart/form-data"> <input type="submit" name="option" value="upload"> <input type="submit" name="option" value="check-in"> </form> the problem is now. i want to check which button is clicked. by request.getPArameter("option"); however. it does not return any value since the enctp is mulipart/form. Can anyone please let me know how can i check which button is clickd? Reggards,
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56205
|
|
|
How are you parsing the multi-part request? With your own code, or a 3rd-party package?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Rohit Malhotra
Greenhorn
Joined: Jan 29, 2006
Posts: 21
|
|
|
I am using a third party tool typically FileUpload jar from apache.
|
 |
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 1005
|
|
|
The fileUpload component has a guide here that demonstrates how to retrieve the standard request parameters.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56205
|
|
|
The documentation of your upload package should tell you how to obtain the non-file parameters. If your package doesn't let you do that, try a different one.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56205
|
|
Originally posted by srilatha reddy: onclick event of button write code to set the value in request/session object
And how exactly do you propose he do that?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56205
|
|
Originally posted by srilatha reddy: within jsp scriplet write request.setAttribute("todo","upload"); in onclick event
That would be pointless. The onclick event is fired on the client as a Javscript event. Any scriptlet "embedded" in it would have been executed on the server before the page was even sent to the browser. [ March 01, 2006: Message edited by: Bear Bibeault ]
|
 |
 |
|
|
subject: File Upload JSP
|
|
|