Hi all !
Using session tracking I got some information I needed regarding my
session.
q: How can I write all of it into a file from the servlet directly .
All I get is this message :
400 Bad Request
Get is not supported by this URL
By default , as far as I know , doGet , doPost methods return a
BAD_REQUEST (400) error. Somehow I shoud override the method designed to
handle the HTTP interactions that it supports .( from the manual )
So , HELP !!!
e-mail: [EMAIL PROTECTED]
This is the code . Theoratically it should work , but it does not .
DataOutputStream create_file()
{
DataOutputStream out = null;
String path="d:\file.txt";
try {
out = new DataOutputStream(new BufferedOutputStream(new
FileOutputStream(new File(path))));
}
catch( IOException io ) {
System.out.println("Eroare "+io.getMessage());
}
return out;
}
public void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException
{
DataOutputStream file = null;
file=create_file();
HttpSession session = request.getSession(true);
sessionID=(String)session.getValue(session.getId());
file.writeChars(sessionID);
!!!!!!!!!!!!!!!!!!!!!!!!!!! ---here I should have sessionID
write into d:\file.txt
file.close();
}
___________________________________________________________________________
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