http://localhost:8080/TestEJB/register.do 页面执行到这一步后就不执行了 没能进入相应的action
我的struts-config 如下
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="userForm" type="cn.actionForm.UserForm"></form-bean>
<form-bean name="userRegisterForm" type="cn.actionForm.UserRegisterForm"></form-bean>
</form-beans>

   <action-mappings>
   <action path="/login" name="userForm" scope="request" type="cn.action.UserLoginAction">
   <forward name="success" path="/success.jsp" />
<forward name="input" path="/index.jsp" />
   </action>  
   <action path="/register" name="userRegisterForm" scope="request" type="cn.action.UserRegisterAction">
   <forward name="success" path="/success.jsp"/>
   <forward name="input" path="/index.jsp"/>
   </action>
   </action-mappings>
</struts-config>
求指点~~~~

解决方案 »

  1.   

    http://localhost:8080/TestEJB/login.do, 可以正常用不?
    再发点代码看看吧
      

  2.   

    web.xml如下:        <filter>
    <filter-name>Encoding</filter-name>
    <filter-class>cn.fileEncoding.Encoding</filter-class>
    </filter> <filter-mapping>
    <filter-name>Encoding</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping> <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet> <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
      

  3.   

    login.jsp 执行时正常  注册执行时 http://localhost:8080/TestEJB/register.do之后就没下文了
    测了一下没有进注册的action
      

  4.   

    有没错误出现呀, 提示什么的呀, 404?
    发 action 
      

  5.   


    login.jsp 执行的都很顺利   register.jsp 点提交后  浏览器地址改变为http://localhost:8080/TestEJB/register.do   页面白哗哗一片 啥都没有 
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    ServletRequest request, ServletResponse response) throws Exception { UserRegisterForm ulf = (UserRegisterForm) form;
    ActionForward af = null;
    PersonDAO personDao = (PersonDAO) EJBFactory
    .getEJB("PersonDAOBean/remote");

    String name=ulf.getName();
    int age=Integer.parseInt(ulf.getAge());
    Date birthday=new SimpleDateFormat("yyyy-MM-dd").parse(ulf.getBirthday()); 
    boolean sex=ulf.getSex()=="男"?true:false;
    String cardID=ulf.getIdcardno();
    try {
    personDao.insertPerson(name,sex,age,birthday,cardID);
    af = mapping.findForward("success");
    } catch (Exception e) {
    e.printStackTrace();
    af = mapping.findForward("input");
    }
    return af;
    }
      

  6.   

    看控制台有东西出不呢, 有错误出来不咯,
    在 execute 方法中打印东西看有出不?
      

  7.   

    execute 方法没能进去
    控制台没有输出 我没有加log4j 我刚接触struts1 有点不太熟悉 还望指教  ~~~~~
      

  8.   

    <action path="/register" name="userRegisterForm" scope="request" type="cn.action.UserRegisterAction">改为
    <action path="/register" name="register" scope="request" type="cn.action.UserRegisterAction">
    试试看
      

  9.   

    @Override
     public ActionForward execute(ActionMapping mapping, ActionForm form,
     ServletRequest request, ServletResponse response) throws Exception {// 这里加行 
    System.out.println("============execute========");
    就有输出了咯看register.jsp 中 form 写的action,
      

  10.   

    <form action="register.do" method="post">
    用户名<input type="text" name="name"><br />
    性别<input type="radio" name="sex" value="男">男 
    <input type="radio" name="sex" value="女">女<br />
    生日<input type="text" name="birthday"/><br/>
    年龄<input type="text" name="age"><br />
    身份证号<input type="text" name="idcardno"><br />
    <input type="submit" value="提 交">
    </form>
      

  11.   

      
    在action打个断点
      

  12.   

    打了个断点  可是 根本没有进action得execute()方法 
    当点提交按钮后 页面跳转到http://localhost:8080/TestEJB/login.do 后就不执行了
      

  13.   

    不好意思各位 耽误大家时间了 我重写父类方式时 选错方法了  惭愧中……原来是重写这个方法的  (错误之处)
    @Override
     public ActionForward execute(ActionMapping mapping, ActionForm form,
     ServletRequest request, ServletResponse response) throws Exception应该重写这个方法
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)