?
Solved

Error : "Get or Post is not supported"

Posted on 2001-06-25
4
Medium Priority
?
160 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 200 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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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