Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: fix this problem to compile the code

  1. #1
    Tarasj is offline Member
    Join Date
    Mar 2012
    Posts
    14
    Rep Power
    0

    Default fix this problem to compile the code

    package com.example.web;

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

    public class BeerSelect extends HttpServlet
    {
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
    out.println("Beer Selection Advice<br>");
    String c=request.getParameter("color");

    out.println("<br>Got beer color:"+c);
    }
    }


    This is my servlet code and i have saved it in this directory
    D:\all\tomcat6\tomcat6\webapps\Beer-V1\WEB-INF\classes\com\example\web

    than i am compiling it from the directory like this: D:\all\tomcat6\tomcat6\webapps\Beer-V1\WEB-INF\classes\javac com.example.web.BeerSelect.java
    but it it showing some error like class not found ?? is the problem help me to compile this code.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,254
    Rep Power
    19

    Default Re: fix this problem to compile the code

    Use code tags, not bold tags, for posting code.

    db
    chiragaegis likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    nicephotog is offline Member
    Join Date
    Mar 2012
    Posts
    41
    Rep Power
    0

    Default Re: fix this problem to compile the code

    You don't use the .java on the web.xml servlet class entry
    com.example.web.BeerSelect

Similar Threads

  1. I cant get my code to compile Need help please
    By MikeJ39 in forum New To Java
    Replies: 6
    Last Post: 10-15-2011, 06:28 AM
  2. Can not compile code , anyone help me fix it ?
    By batista11b5 in forum New To Java
    Replies: 3
    Last Post: 10-22-2010, 02:00 PM
  3. Code does not Compile
    By ustar in forum New To Java
    Replies: 13
    Last Post: 03-06-2010, 04:54 PM
  4. Code will not compile
    By ShotGunRockets in forum New To Java
    Replies: 17
    Last Post: 05-10-2009, 03:31 AM
  5. simple problem - code wont compile
    By dirtycash in forum New To Java
    Replies: 1
    Last Post: 11-20-2007, 05:49 PM

Tags for this Thread

Posting Permissions

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