1 Reply Latest reply on Jun 27, 2011 11:34 AM by gimbal2

    HELP - First Servlet

    Claudio A.
      Hi to all ....

      I'm trying to write my first servlet on a Weblogic server 11

      Weblogic is not running in production mode so I have the autodeploy active

      I create a directory under .../autodeploy called app1

      I get from internt one example of a HelloWorld

      package test;

      import java.io.*;
      import javax.servlet.http.*;
      import javax.servlet.*;

      public class HelloServlet extends HttpServlet {
      public void doGet(HttpServletRequest request,
      HttpServletResponse response)
      throws ServletException, IOException {
      PrintWriter out = response.getWriter();
      out.println("Hello World");

      After I compile it and now I have the HelloServlet.class I copied it into .../autodeploy/app1 directory

      Now what i need to do to run it ????

      thank's in advance

      Edited by: Claudio A. on 27-giu-2011 3.46
        • 1. Re: HELP - First Servlet

          - you configure the servlet in your web.xml
          - you properly deploy your application
          - you start the server
          - you open a browser and navigate to whatever url pattern you mapped the servlet to

          If at any of these points you want to reply and ask "but how do I do that" - forget it. If you don't know, you need to read at least a basic servlet introductory article and the manual of your server. Perhaps you want to start with something simpler than Weblogic, such as Apache Tomcat, to get your first simple web stuff to work. Most beginner articles you can find online will focus on Tomcat.