Type of object returned by an input from a web page

Posted by controlfreak123 on Stack Overflow See other posts from Stack Overflow or by controlfreak123
Published on 2010-06-11T00:21:30Z Indexed on 2010/06/11 0:22 UTC
Read the original article Hit count: 528

Filed under:
|
|
|
|

I'm attempting to upload a file into a jsp and then use the file in some other code. My problem is that it comes into the servlet as an Object via the request.getAttribute() call so I don't know what to cast it to.

I have this code so far to try and test what it is but I'm getting a NullPointerException.

PrintWriter out = response.getWriter();
out.println(request.getAttribute("file1").getClass());

Is my understanding of whats going on flawed or am I just coding it up wrong?

© Stack Overflow or respective owner

Related posts about java

Related posts about web-development