Solved

Error : "Get or Post is not supported"

Posted on 2001-06-25
4
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

696 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