Hi to all!!
When i get user input data from a form by using :
public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, java.io.IOException
{
...
ServletOutputStream out = res.getOutputStream();
Hashtable postedData =
HttpUtils.parsePostData(req.getContentLength(),req.getInputStream());
String sn = (String) postedData.get("SN");
out.print(SN);
....
}
I get the error
java.lang.ClassCastException: java.lang.Object
when I submit the data.
The "SN" is the name of a text-box that allows user input, in a HTML Form.
I have confirm that the value associated with the key "SN" is a String, by
doing :
...
Object sn = postedData.get("SN");
out.print( sn.getClass().getName().);
...
I don't see were the problem is since the method "get" from Hastable returns
an Object, and String is a subclass of Object.
Maybe it as something to do with the classloader of the servlet?
Does anyone know whats's the problem?
Tanks in advance,
RJCampos.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html