运行struts的问题,请教!!! <action path="/Lookup" type="wiley.LookupAction"检查一下wiley包中的LookupAction。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的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 successString target = new String("success");if ( form != null ) {// Use the LookupForm to get the request parametersLookupForm lookupForm = (LookupForm)form;String symbol = lookupForm.getSymbol();price = getQuote(symbol);}// Set the target to failureif ( price == null ) {target = new String("failure");}else {request.setAttribute("PRICE", price);}// Forward to the appropriate Viewreturn (mapping.findForward(target));}} 你是不是在struts-config.xml文件里面没有配置lookup这个action啊? jsp是怎么写的?<html:form action = "Lookup.do" ... >别忘了把tlb也在jsp引进去!还有<action path="/Lookup"把那个“/”去了 !记住大小写也敏感的! :)还没解决的话,最好贴上jsp hibernate3 添加实体的问题 谷歌地图 api v3 平移控件中间点击返回上一结果这个怎么设置啊? 求大神解答 关于.asmx webservice的问题,请高手指教下 NullPointerException extjs能与struts2的convention-plugin整合么? 请问.do的网站是怎么做的。 JSP页面中怎么调用过滤器 猜数字运行问题,请达人帮帮忙 学生选课系统:选课添加 servlet+mysql不知哪出错了 请教一个问题,非常急手(在线等侍),拜托,拜托. jsp连oracle时游标的问题,在线求助,急 如何捕捉网页被关闭事件,并进行相应处理?
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));
}
}
别忘了把tlb也在jsp引进去!
还有<action path="/Lookup"
把那个“/”去了 !记住大小写也敏感的! :)
还没解决的话,最好贴上jsp