<action path="/Lookup"  type="wiley.LookupAction"检查一下wiley包中的LookupAction。

解决方案 »

  1.   

    我的LookupAction是从书上COPY过来,如下,的有什么问题吗?
    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));
    }
    }
      

  2.   

    你是不是在struts-config.xml文件里面没有配置lookup这个action啊?
      

  3.   

    jsp是怎么写的?<html:form action = "Lookup.do" ... >
    别忘了把tlb也在jsp引进去!
    还有<action path="/Lookup"
    把那个“/”去了 !记住大小写也敏感的! :)
    还没解决的话,最好贴上jsp