Hi, Using the command prompt, and navigate to the parent directory gives me the following error:
C:\Program Files\apache-tomcat-5.5.17\webapps\wileystruts\WEB-INF\classes>javac wiley.LookupAction.java error: Can't read: wiley.LookupAction.java 1 error C:\Program Files\apache-tomcat-5.5.17\webapps\wileystruts\WEB-INF\classes>javac wiley.LookupForm.java error: Can't read: wiley.LookupForm.java 1 error Any other thing that i did wrong ? Hemant Johnson Burgula <[EMAIL PROTECTED]> wrote: Hi, I guess you are trying to compile the said class from Edit plus. Pls go to the command prompt and navigate to the parent directory of willy and then javac willy.filename.java. Inspite of this if you get an error class not found then we will have to look into the classpath. pls try and see. johnson. Aiping wrote: Hi, I am having trouble compile a file called LookupAction.java. The error is: Class wiley.LookupForm not found. Currently the LookupAction.java and LookupForm both resides in the same package "wiley". The sources code of the files used are: // LookupForm.java package wiley; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; public class LookupForm extends ActionForm { private String symbol = null; public String getSymbol() { return symbol; } public void setSymbol(String symbol) { this.symbol = symbol; } public void reset(ActionMapping mapping, HttpServletRequest request) { this.symbol = null; } } // LookupAction.java package wiley; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public class LookupAction extends Action { protected Double getQuote(String symbol) { if (symbol.equalsIgnoreCase("SUNW")) { return new Double(25.00); } return null; } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Double price = null; // Default target to success String target = new String("success"); if (form != null) { // Use the LookupForm to get the request parameters LookupForm lookupForm = (LookupForm) form; String symbol = lookupForm.getSymbol(); price = getQuote(symbol); } // Set the target to failure if (price == null) { target = new String("failure"); } else { request.setAttribute("PRICE", price); } // Forward to the appropriate View return (mapping.findForward(target)); } } // Web.xml PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> Wiley Struts Application action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 2 detail 2 2 action *.do /tags/struts-bean /WEB-INF/struts-bean.tld /tags/struts-html /WEB-INF/struts-html.tld /tags/struts-logic /WEB-INF/struts-logic.tld /tags/struts-nested /WEB-INF/struts-nested.tld /tags/struts-tiles /WEB-INF/struts-tiles.tld // struts-config.xml "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> This is a blank Struts configuration file with an example welcome action/page and other commented sample elements. Tiles and the Struts Validator are configured using the factory defaults and are ready-to-use. NOTE: If you have a generator tool to create the corresponding Java classes for you, you could include the details in the "form-bean" declarations. Otherwise, you would only define the "form-bean" element itself, with the corresponding "name" and "type" attributes, as shown here. --> I am currently using apache-tomcat-5.5.17 and Editplus... Btw, could anyone tell me wat do u set in the classpath for struts? Suspect is due to the classpath... I cracking my head over this, please help... thks... __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com