[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Error : "Get or Post is not supported"

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

Industry Leaders: 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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

656 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