将html的组件都改成struts自己的
比如:
<input type="text" name="username" />
改成:
<html:text property="username" value="" />还有声明form的地方也要改一下
<html:form action="/logon" type="formpath.LogonForm" method="post">
加一个type楼主试试吧,不行再问.
比如:
<input type="text" name="username" />
改成:
<html:text property="username" value="" />还有声明form的地方也要改一下
<html:form action="/logon" type="formpath.LogonForm" method="post">
加一个type楼主试试吧,不行再问.
<form-bean name="!!!!!" type="**Form"/> <action path="/**Action" type="" name="!!!!!"〉
“!!!”的两个name 要相同
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="logonForm" type="struct.LogonForm" />
</form-beans>
<action-mappings>
<action input="/logon.jsp" name="LogonForm" path="/logon" scope="request" type="struct.LogonAction" validate="true">
<forward name="sucess" path="/index.jsp" />
<forward name="failure" path="/logon.jsp" />
</action>
</action-mappings>
</struts-config>修改后的logon.jsp<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<title>
logon
</title>
</head>
<body bgcolor="#ffffff">
<h1>
LogOn
</h1>
<html:form action="/logon.do" type="struct.LogonForm" method="post">
username:
<html:text property="username" value=""/>
<br>
password:
<html:password property="password" value=""/>
<html:submit property="submit" value="submit"/>
<html:reset/>
</html:form>
</body>
</html>
<forward name="sucess" path="/index.jsp" />
如果你的LoginAction 没有改的话,那就是
<forward name="success" path="/index.jsp" />
试试看吧
可否考虑采用JavaWebStudio?配置是自动生成的,就不会出现这种错误了。参见:http://dev.csdn.net/user/kui
但是我这个配置文件是JBuilder自己生成的啊,竟然两个不一样,郁闷中不是JBuilder好称最好的啊。
晕,莫非borland 的公司不行了,以前不是很好的我在用Delphi 的时候觉得这个瞒不错的
不知道最近这个公司怎么样了啊?谢谢楼上的各位了
非常感谢。