Hi,
i have a simple webapp in the developperphase (as given in the book "Head First
Servlets & JSP"). I have installed jdk 1.6.0.4 and jre 1.6.0.4 (public). And i have
Tomcat 6.0.14 up and running.
Now, i want to compile a servlet (see code at the end between "***") but the "import" command doesn't work, as it can't find the path. Here's the message by javac:
"C:\WebAppsDev\beerV1>javac -d classes src/com/example/web/beerselect.java
src\com\example\web\beerselect.java:3: package com.example.model does not exist
import com.example.model.*;
^
1 error"
.
I have set the JAVA_HOME variable (Windows XP SP2) in the systemvariables and in the uservariables the following way: C:\Program Files\Java\jdk1.6.0_04
I am about to troubleshoot this for weeks, i can't get the thing running, thanks for a feedback,
Patrick
Servlet code:
***
package com.example.web;
import com.example.model.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
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");
BeerExpert be = new BeerExpert();
List result = be.getBrands(c);
Iterator it = result.iterator();
while (it.hasNext())
{
out.print("<br>try: " + it.next());
}
}
}
***