帮忙看一下,xml文件和jsp 代码。1.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>
  <data-sources />
  <form-beans >
    <form-bean name="loginForm" type="org.tongrui.struts.form.LoginForm" />  </form-beans>  <global-exceptions />
  <global-forwards />
  <action-mappings >
    <action
      attribute="loginForm"
      input="/login.jsp"
      name="loginForm"
      path="/login"
      scope="session"
      type="org.tongrui.struts.action.LoginAction">
      <forward
        name="show"
        path="/show.jsp"
        redirect="true" /> 
    </action>  </action-mappings>  <message-resources parameter="org.tongrui.struts.ApplicationResources" />
</struts-config>2.login.jsp
<%@ page language="java"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> 
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
 
<html> 
<head>
<title>JSP for LoginForm form</title>
</head>
<body>
<html:form action="/login">
name : <html:text property="name"/><br/>
id : <html:text property="id"/><br/>
<html:submit/><html:cancel/>
</html:form>
</body>
</html>3. show.jsp<%@ page language="java" import="java.util.*"%>
  
<html>
  <head> 
  <jsp:useBean id="loginFrom"  class="org.tongrui.struts.form.LoginForm" scope="session" />
    <title>My JSP 'show.jsp' starting page</title>
 </head>
  
  <body>
    id: <jsp:getProperty name="loginFrom" property="id"/><br>
    name:<jsp:getProperty name="loginFrom" property="name"/><br>
  </body>
</html>

解决方案 »

  1.   

    loginAction呢?
    不明白你在show.jsp中用<jsp:useBean>做什么。
    还有你输入的英文吗?
      

  2.   

    where is your action ,and you 'd better change redirect to false in your struts-config.xml
      

  3.   

    redirect="true" />
    这里错了,配成重定向了,应该是转发。
      

  4.   

    what'the difference please, learn and learn!
      

  5.   

    用newxy很方便,它很好地将struts的功能集成在一起,不写代码实现数据增、删、改、多项查询、文件上传。
        newxy网站:http://www.newxy.net