将html的组件都改成struts自己的
比如:
  <input type="text" name="username" />
改成:
  <html:text property="username" value="" />还有声明form的地方也要改一下
<html:form action="/logon" type="formpath.LogonForm" method="post">
加一个type楼主试试吧,不行再问.

解决方案 »

  1.   

    还有action要改成action="/logon.do",struts1.1中最好加上.do,struts1.0中不加.do没关系.
      

  2.   

    struts-config.xml文件配置有错误。
       <form-bean name="!!!!!"  type="**Form"/>   <action   path="/**Action" type="" name="!!!!!"〉
    “!!!”的两个name 要相同
      

  3.   

    还是不行啊。这是我的struts-config.xml<?xml version="1.0" encoding="UTF-8"?>
    <!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>
      

  4.   

    你的LoginAction 的代码没有贴出来,但我觉得可能是这里出错了:
    <forward name="sucess" path="/index.jsp" />
    如果你的LoginAction 没有改的话,那就是
    <forward name="success" path="/index.jsp" />
    试试看吧
      

  5.   

    你的FormAction中定义的是小写logonForm,在Action中引用的是大写LogonForm,所以出错。
    可否考虑采用JavaWebStudio?配置是自动生成的,就不会出现这种错误了。参见:http://dev.csdn.net/user/kui
      

  6.   

    谢谢,已经ok了
    但是我这个配置文件是JBuilder自己生成的啊,竟然两个不一样,郁闷中不是JBuilder好称最好的啊。
    晕,莫非borland 的公司不行了,以前不是很好的我在用Delphi 的时候觉得这个瞒不错的
    不知道最近这个公司怎么样了啊?谢谢楼上的各位了
    非常感谢。