报错信息如下:
javax.servlet.jsp.JspException: Exception creating bean of class com.team5.hr.struts.form.LoginForm: {1}我已经确定包名类名没有写错。SSH集成中formbean的配置应该和只用structs一样吧,如果不是要怎么配置呢。struts文件如下:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"><struts-config>
  <form-beans >
    <form-bean name="loginForm" type="com.team5.hr.struts.form.LoginForm" />
  </form-beans>
  <action-mappings >
    <action
      attribute="loginForm"
      input="/login.jsp"
      name="loginForm"
      path="/login"
      scope="request"
      type="org.springframework.web.struts.DelegatingActionProxy" >
      <forward name="success" path="success.jsp" />
       <forward name="error" path="error.jsp" />
      </action>
  </action-mappings>  <message-resources parameter="com.team5.hr.struts.ApplicationResources" />
</struts-config>

解决方案 »

  1.   

    你的LoginForm是否继承ActionForm啦。不继承struts是不认的
      

  2.   


    这个LoginForm是用myeclipse生成的绝对有继承
      

  3.   

    贴你的完整代码看看,jsp,action,actionform
      

  4.   

    jsp:<%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> 
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
     
    <html> 
    <head>
    <title>JSP for LoginForm form</title>
    </head>
    <body>
    <html:form action="login.do">
    password : <html:text property="password"/><html:errors property="password"/><br/>
    name : <html:text property="name"/><html:errors property="name"/><br/>
    id : <html:text property="id"/><html:errors property="id"/><br/>
    <html:submit value="提交"/><html:cancel/>
    </html:form>
    </body>
    </html>action:package com.team5.hr.struts.action;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;import com.team5.entity.User;
    import com.team5.hr.struts.form.LoginForm;
    import com.team5.manage.UserManage;public class LoginAction extends Action {

    private UserManage userManage; public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    ActionForward af=null;
    LoginForm loginForm = (LoginForm) form;
    String username=loginForm.getName();
    String pwd=loginForm.getPassword();

    System.out.println(username);
    System.out.println(pwd);


    User user=new User();
    user.setName(username);
    user.setPassword(pwd);
    if(userManage.login(user)==true){
    af=mapping.findForward("success");
    }else{
    af=mapping.findForward("error");
    }
    return af;
    }
    public void setUserManage(UserManage userManage) {
    this.userManage = userManage;
    }
    }
      

  5.   


    actionForm:
    package com.team5.hr.struts.form;import org.apache.struts.action.ActionForm;
    public class LoginForm extends ActionForm { private String password;
    private String name;
    private Integer id; public String getPassword() {
    return password;
    } public void setPassword(String password) {
    this.password = password;
    } public String getName() {
    return name;
    } public void setName(String name) {
    this.name = name;
    } public Integer getId() {
    return id;
    } public void setId(Integer id) {
    this.id = id;
    }
    }
      

  6.   

    application-common.xml<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
    <!-- 配置sessionFactory -->

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="configLocation"> 
    <value>classpath:hibernate.cfg.xml</value>
    </property>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
    <tx:method name="save*" propagation="REQUIRED"/>
    <tx:method name="update*" propagation="REQUIRED"/>
    <tx:method name="delete*" propagation="REQUIRED"/>
    <tx:method name="*" read-only="true"/>
    </tx:attributes>
    </tx:advice>
    <aop:config>
    <aop:pointcut id="allManagerMethod" expression="execution(* com.team5.daoimpl.*.*(..))"/>
    <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/>
    </aop:config> </beans>
      

  7.   

    <message-resources parameter="com.team5.hr.struts.ApplicationResources" />
    这个屏蔽掉,看看
      

  8.   

    jsp表头:
    <html:form action="login.do" name="loginForm">
      

  9.   

     password : <html:text property="loginFrom.password"/><html:errors property="password"/><br/>
                name : <html:text property="loginFrom.name"/><html:errors property="name"/><br/>
                id : <html:text property="loginFrom.id"/><html:errors property="id"/><br/>