Title: RE: POPERTIES FILE...

There is nothing apparently wrong with you're init method.  The "Bad Request" message that you see in your browser isn't necessarily caused by you're doPost method not seeing the initialized "s" variable, but if it is you should probably be seeing some kind of error from the servlet runner.  Is there an error message or exception stack trace in your servlet runner's log or on its console?

-----Original Message-----
From: Vijay Vangara [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 16, 2000 11:02 AM
To: [EMAIL PROTECTED]
Subject: POPERTIES FILE...


Hai All,
i have got a problem here.I am trying to initilize some parameters through
the properties file.but when i am using the
service() or doGet() methods it is working fine.but when i am using the
doPost() it is saying some "Bad Request..your Browser sent a request that
this server could not understand
My code is like this"..

public class Exam extends HttpServlet
{
        String s = " ";

        public void init(ServletConfig sc) throws ServletException
        {
                super.init(sc);
                s = getInitParameter("xyz");
        }

        public void doPost(HttpServletRequest request, HttpServletResponse
response)
                        throws ServletException, IOException
        {
                response.setContentType("text/html");
                PrintWriter writer = response.getWriter();

                writer.println("<html><body>" + s + "welcome
world</body></html>");
        }
}

___________________________________________________________________________
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

Reply via email to