Solved

Error : "Get or Post is not supported"

Posted on 2001-06-25
4
154 Views
Last Modified: 2013-11-24
hi experts,
 The following servlet is giving an error similar to this
  "Errror 400   GET or POST is not supported by this URL "

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet
{
     public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
     {
          PrintWriter out = res.getWriter();
          out.println("Hello World");
     }
I compiled the servlet and saved it in the 'Examples' directory of JSDK2.0.. then I called the servlet by giving "http://127.0.0.1:8080/servlet/HelloWorld"
     pls comment
 regs pvraj
}
0
Comment
Question by:pvraj
  • 2
4 Comments
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6226919
You should put the servlet class inside the subdirectory WEB-INF/classes of the Examples directory.

The idea is that the Webserver loads all servlet classes from two additional places:

1. WEB-INF/classes
2. WEB-INF/lib/*.jar

No need to set the classpath.
0
 
LVL 9

Accepted Solution

by:
mmuruganandam earned 50 total points
ID: 6227836
If you are using the jws then place this class in the

servlets directory and try.  The code is perfect.

you can use the localhost also.



All the best

Cheers,
Muruganantham
0
 

Author Comment

by:pvraj
ID: 6232485
i m using LWS-2.2.1 SERVER
regs
0
 

Author Comment

by:pvraj
ID: 6248471
when i place the servlet in the servlets directory of lws , it is working .. thanx
regs
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question