hi,
can anyone tell me if i can use XMLOutputStream from a Servlet ..
and whether the following is correct ..
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
// if the client says "format=object
// return the Date as a serialized object
System.out.println("trying for XML object : *******************" );
if("object".equals(req.getParameter("format"))) {
System.out.println("trying for XML object : " );
//ObjectOutputStream out = new
ObjectOutputStream(res.getOutputStream());
XMLOutputStream out = new XMLOutputStream(res.getOutputStream());
out.writeObject(new DataClass(getDate()));
System.out.println("trying for XML object 2 : " );
}
else {
System.out.println("trying for TExt object: " );
PrintWriter out = res.getWriter();
out.println(getDate().toString());
}
}
please let me know..
regards
shantanu..
--
Don't make the mistake of letting yesterday use up too much of today.
-Anonymous
___________________________________________________________________________
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