jeudi 23 février 2017

Web servlet error by using html code in get method

I am new to web programming. I am using this simple code in my get method

        response.setContentType( "text/html" );
        PrintWriter out = response.getWriter();
        out.println( "<html><head><title>Guest Book</title></head><body>" );
        out.println(" </body></html> ");

I am getting the below error while clicking on run on server enter image description here

Note: When i removed the html code, the servlet is working fine.Is it my Html code problem or any tomcat sevrver issue. The servlet is in my package cs3220homework and servlet name is @WebServlet("/MainFolder").

I tried everywhere to look for the issue and i was not able to find it.If its duplicate please let me know.

Thanks for your reply Harminder




Aucun commentaire:

Enregistrer un commentaire