I have a JSP app, it uploads a file, but to do so, the user can use the name and password. Must have to certify. So my JSP file starts:
// 0.2.- We get password string password (string) request.getParameter ("pass"); // -> It returns zero / 0.20 returns. We get the "uvus" string uvus = (string) request.getParameter ("uvus"); // -> It also gives zero / more code
So I want to know why why am I being nullified with those variables .
I went to the form I uploaded, and look for the data that was being sent. I looked up using the Firefox debug tool:
< P> In fact, it was being sent.
As an additional information, I am creating a request like this:
var pUvus = document.getElementById ("uvus") .Value; Var pPassword = document.getElementById ("pass"). Values; Var file = document.getElementById ("userFile"); Var formatta = new form data (); FormData.append ("Upload", file.files [0]); FormData.append ("uvus", puvus); FormData.append ("pass", pPassword); Xmlhttp.open ("post", "uploadFile.jsp", true); Xmlhttp.send (formData); Finally, I would like to say that without any error, I can get the VAs from the application object in a single JSP, and in the other pair of JSP files the requested object will be more There are problems without getting more, so I think my mistake should be in the form of a request in Ajax, but I have no clue about it ... Anybody guided me May God?
Updates : @ricix asked me how to get a file and parse the request (what would be done after my problem The scope of the request to objects): list item; Item = servlet_up.parseRequest (requested); For (int i = 0; i & lt; item. Size (); i ++) {file item item = (filesystem) item. Gate (i); If (! Item.isFormField ()) {
request.getParameter () won 'Multipart / Do not work for a form-data request If you are using org.apache.commons.fileupload, then you should use something like
No comments:
Post a Comment