Java Query
Results 1 to 3 of 3

Thread: Java Query

Threaded View

  1. #1
    Senior Member kingkong's Avatar
    Join Date
    Oct 2007
    Location
    UAE
    Posts
    197

    Java Query

    Hi AO's

    Well i am new to java programming

    and i was writing a new program in java servlet which is

    // Hello.java
    import java.io.*;
    import javax.servlet.*;

    public class Hello extends GenericServlet {
    public void service(ServletRequest request, ServletResponse response)
    throws ServletException, IOException
    {
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    pw.println("Hello, world!");
    pw.close();
    }
    }
    and while compiling in CMDi got error as follows
    C:\Program Files\Java\jdk1.6.0_06\bin>javac Hello.java
    Hello.java:3: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    Hello.java:5: cannot find symbol
    symbol: class GenericServlet
    public class Hello extends GenericServlet {
    ^
    Hello.java:6: cannot find symbol
    symbol : class ServletRequest
    location: class Hello
    public void service(ServletRequest request, ServletResponse response)
    ^
    Hello.java:6: cannot find symbol
    symbol : class ServletResponse
    location: class Hello
    public void service(ServletRequest request, ServletResponse response)
    ^
    Hello.java:7: cannot find symbol
    symbol : class ServletException
    location: class Hello
    throws ServletException, IOException
    ^
    5 errors

    C:\Program Files\Java\jdk1.6.0_06\bin>
    what does this error resembles to
    Last edited by kingkong; June 8th, 2008 at 08:41 AM. Reason: modification
    Question is not "Why are you Online"
    Question is "Why are you Off line"

Similar Threads

  1. Men speak C, Women speak Java.
    By MrLinus in forum Cosmos
    Replies: 4
    Last Post: April 18th, 2004, 08:01 AM
  2. The history of the Mac line of Operating systems
    By gore in forum Operating Systems
    Replies: 3
    Last Post: March 7th, 2004, 07:02 AM
  3. Java chat sessions....a query
    By vozhan in forum AntiOnline's General Chit Chat
    Replies: 1
    Last Post: March 6th, 2004, 08:49 PM
  4. Foot Printing with Host
    By SonofGalen in forum The Security Tutorials Forum
    Replies: 7
    Last Post: February 9th, 2004, 10:14 AM
  5. Difference between Java and JavaScript
    By Remote_Access_ in forum Security Archives
    Replies: 4
    Last Post: January 3rd, 2002, 10:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides