hai, moloy,
this is raghuraman.
try using this instead of your code. in the doGet method, the
(HttpServletRequest req & HttpServletResponse res) are parameters. so they
shouldn't be inside curly braces {} as you have given.
public class moloyservlet extends HttpServlet {
public void doGet (HttpServletRequest req, HttpServletResponse
res)
throws ServletException IOException {
hope this solves your problem.
regards,
raghu.
----- Original Message -----
From: Moloy Biswas <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 27, 1999 11:34 AM
Subject: A silly Question
> I am a starter in Servlets. While writing the practice code I got the
> following error :
>
> moloyservlet.java:7: ';' expected
> public void doGet^
>
> moloyservlet.java:8: Instance variable can't be void: doGet
> {^
>
> 2 errors
>
>
>
> My code for moloyservlet.java is given below :
>
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> public class moloyservlet extends HttpServlet
> {
> public void doGet
> {
> HttpServletRequest req,
> HttpServletResponseres
> } throws
> ServletException
> IOException
> {
> res.setContentType( "text/html" );
> ServletOutputStream out = res.getOutputStream();
> out.println( "<html>" );
> out.println( "<head><title>Hello Moloy is
> here</title></head>" );
> out.println( "<body>" );
> out.println( "<h1>Hello Moloy</h1>" );
> out.println( "<p>Congrats,your first servlet is
> working</p>" );
> out.println( "</body>" );
> out.println( "</html>" );
> out.close();
> }
> }
>
>
>
>
> Pl help ....
>
> Moloy
>
>
>
> --------------------------------------------------------------
> SREI INTERNATIONAL FINANCE LTD., CALCUTTA, INDIA
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html