Regarding pakage in java
<p>i have following directory structure.</p>

<pre><code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\model\BeerExpert.java
</code></pre>

<p>and</p>

<pre><code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.java
</code></pre>

<p>The source code for BeerSelect is</p>

<pre><code>package com.example.web;
import com.example.model.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;


public class BeerSelect extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException
{
String c=req.getParameter("color");
BeerExpert be=new BeerExpert();
List result=be.getBrands(c);
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("Beer Selection Advice&lt;br&gt;");
Iterator it=result.iterator();
while(it.hasNext())
{
out.println("&lt;br&gt;try: "+it.next());
}
}
}
</code></pre>

<p>and source code for BeerExpert is</p>

<pre><code>package com.example.model;
import java.util.*;

public class BeerExpert
{
public List getBrands(String color)
{
List brands=new ArrayList();
if(color.equals("amber"))
{
brands.add("Jack Amber");
brands.add("Red Moose");
}
else
{
brands.add("Jail Pale Ale");
brands.add("Gout Stout");
}
return(brands);
}
}
</code></pre>

<p>Beer Expert is compiling fine but whenevr i am running BeerSelect its giving me an error</p>

<pre><code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.java:2: package com.example.model does not exist
import com.example.model.*;
^
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.java:14: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be=new BeerExpert();
^
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\WEB-INF\classes\com\example\web\BeerSelect.java:14: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect
BeerExpert be=new BeerExpert();
</code></pre>

<p>^
3 errors</p>

<p>Tool completed with exit code 1</p>

<p>Can anyone help in this regard</p>

<p>Thanks in advance'</p>
