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
:
: 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,
: : 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,
:
: