运行struts的出错信息,请大家帮忙 你的INDEX里是怎么写的?贴出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 或者,你的这个类jbtest.LookupForm的大小写没错吧?你有没有把它放到WEB-INF下的CLASSES下?还有,你是不是用WAR去部署的?都说清楚点 明显是相关的类没有拷贝到web-inf下 我用的是tomcat,我的目录结构是:C:\Program Files\Apache Tomcat 4.0\webapps\wileyapp; wileyapp是我的应用目录,wineyapp下有WEB-INF目录,在WEB-INF目录下有struts-config.xml与web.xml两个文件与一些运行struts需要的文件,LookForm放在WEB-INF\classes\jbtest目录下,大小写应该没问题。我的index.jsp很简单:<%@ page language="java" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><html><head><title>Wiley Struts Application</title></head><body><table width="500"border="0" cellspacing="0" cellpadding="0"><tr><td> </td></tr><tr bgcolor="#36566E"><td height="68" width="48%"><div align="left"><img src="images/hp_logo_wiley.gif"width="220"height="74"></div></td></tr><tr><td> </td></tr></table><html:form action="Lookup"name="lookupForm"type="jbtest.LookupForm" ><table width="45%" border="0"><tr><td>Symbol:</td><td><html:text property="symbol" /></td></tr><tr><td colspan="2" align="center"><html:submit /></td></tr></table></html:form></body></html>jbtest.LookupForm也很简单就是保存数据:package jbtest;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; }}我把index.jsp中的<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>与<html:form action="Lookup"name="lookupForm"type="jbtest.LookupForm" ><table width="45%" border="0"><tr><td>Symbol:</td><td><html:text property="symbol" /></td></tr><tr><td colspan="2" align="center"><html:submit /></td></tr></table></html:form>屏蔽调,就可以。单打开<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>也出错,我不知道执行<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>,会做什么事。谢谢大家的指点 很可能你写的formbean并没有从org.apache.struts.action。ActionFormBean继承,导致类型转化错误! <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>中的uri="/WEB-INF/struts-html.tld"必须在web.xml中定义 你必须把所有和STRUTS相关的JAR放到WEB-INF下的LIB目录!而不能放到CLASSPATH中同时,打一个WAR包发布到TOMCAT上去! 请先确认jbtest.LookupForm是不是从org.apache.struts.action.ActionFormBean中继承过来的! <html:form action="Lookup"name="lookupForm"type="jbtest.LookupForm" >中的type属性在struts-1.1中已不推荐,并且type属性的类别与struts-config.xml中的form定义要一样 谢谢大家,问题解决了。是LookupForm没有继承Action,导致类型转换出错。 J2EE还原数据库没改变求解啊 能正常运行,就是数据库没变 请问公共类用单例模式和static方法哪个好? windows的播放器 如何将XML数据保存到LIST集合中 自定义的标签在web.xml中出错? 请教关于MiddleGen连接MsSqlServer,得不到所有的表。。为什么?? struts的超连接问题,报错http 405,请高手指点 在jbuilderx下面怎样配制 tomcat4.1的数据库连接池 如何用Jbuilder 做测试? 短信猫在linux下找不到串口的问题谁有解决思路吗? 学习struts 如何在bmp管理的ejb中查找数据库?
你有没有把它放到WEB-INF下的CLASSES下?
还有,你是不是用WAR去部署的?
都说清楚点
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>Wiley Struts Application</title>
</head>
<body>
<table width="500"
border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr bgcolor="#36566E">
<td height="68" width="48%">
<div align="left">
<img src="images/hp_logo_wiley.gif"width="220"
height="74">
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<html:form action="Lookup"
name="lookupForm"
type="jbtest.LookupForm" >
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>jbtest.LookupForm也很简单就是保存数据:
package jbtest;
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;
}}
我把index.jsp中的<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>与
<html:form action="Lookup"
name="lookupForm"
type="jbtest.LookupForm" >
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit /></td>
</tr>
</table>
</html:form>屏蔽调,就可以。单打开<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>也出错,我不知道执行<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>,会做什么事。谢谢大家的指点
同时,打一个WAR包发布到TOMCAT上去!
name="lookupForm"
type="jbtest.LookupForm" >
中的type属性在struts-1.1中已不推荐,并且type属性的类别与struts-config.xml中的form定义要一样