Servlet problems

I have an "old" course on webtechnology and in the servlet section there are programs who want to import javax.servlet.* and javax.servlet.http.* but those packages don't seem to exist. Solution?

a simple example:
[code]
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HalloServlet1 extends HttpServlet
{
public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
{
response.setContentType ("text/html");
PrintWriter out = response.getWriter();
out.println ( "");
out.println ( "Hallo!");
out.println ( "");
out.println ( "Hallo!");
out.println ( "");
out. close ();
}
}
[/code]


[b]NOTE:[/b] the [blue]http://http[/blue] is interpreted by this page, is must be [b]http[/b]

Thx for futur and past (on the GIF problem) responses,

dvrslype

Comments

  • : I have an "old" course on webtechnology and in the servlet section there are programs who want to import javax.servlet.* and javax.servlet.http.* but those packages don't seem to exist. Solution?
    :
    : a simple example:
    : [code]
    : import java.io.*;
    : import javax.servlet.*;
    : import javax.servlet.http.*;
    :
    : public class HalloServlet1 extends HttpServlet
    : {
    : public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
    : {
    : response.setContentType ("text/html");
    : PrintWriter out = response.getWriter();
    : out.println ( "");
    : out.println ( "Hallo!");
    : out.println ( "");
    : out.println ( "Hallo!");
    : out.println ( "");
    : out. close ();
    : }
    : }
    : [/code]
    :
    :
    : [b]NOTE:[/b] the [blue]http://http[/blue] is interpreted by this page, is must be [b]http[/b]
    :
    : Thx for futur and past (on the GIF problem) responses,
    :
    : dvrslype
    :
    :

    Hi,

    You need JSDK (Java Servlets Development Kit) to compile servlets. If you have installed JSDK2.0 in C drive, You set the classpath environement variable to

    set classpath=%classpath%;c:jsdk2.0lib;.

    after that compile the program.

    -- SRINIVASAN,

  • Alternatively, you can download the J2EE package. In the end, you need j2ee.jar in your path.

    : : I have an "old" course on webtechnology and in the servlet section there are programs who want to import javax.servlet.* and javax.servlet.http.* but those packages don't seem to exist. Solution?
    : :
    : : a simple example:
    : : [code]
    : : import java.io.*;
    : : import javax.servlet.*;
    : : import javax.servlet.http.*;
    : :
    : : public class HalloServlet1 extends HttpServlet
    : : {
    : : public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
    : : {
    : : response.setContentType ("text/html");
    : : PrintWriter out = response.getWriter();
    : : out.println ( "");
    : : out.println ( "Hallo!");
    : : out.println ( "");
    : : out.println ( "Hallo!");
    : : out.println ( "");
    : : out. close ();
    : : }
    : : }
    : : [/code]
    : :
    : :
    : : [b]NOTE:[/b] the [blue]http://http[/blue] is interpreted by this page, is must be [b]http[/b]
    : :
    : : Thx for futur and past (on the GIF problem) responses,
    : :
    : : dvrslype
    : :
    : :
    :
    : Hi,
    :
    : You need JSDK (Java Servlets Development Kit) to compile servlets. If you have installed JSDK2.0 in C drive, You set the classpath environement variable to
    :
    : set classpath=%classpath%;c:jsdk2.0lib;.
    :
    : after that compile the program.
    :
    : -- SRINIVASAN,
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories