1、用LoginAction.do的方式运行;
2、为何输入输出、正确不正确都转发到Login.jsp?
input="/Login.jsp" scope="request">
  <forward name="success" path="/Login.jsp" /> 
  <forward name="failure" path="/Login.jsp" /> 3、可试试JavaWebStudio的Struts文件向导,熟悉后再自己写。
http://dev.csdn.net/user/kui
http://javaweb.51.net/
http://javawebStudio.51.net/下载《Struts开发实例》地址:
http://www.infoxa.com/asp/book/xxnr.asp?id=1333

解决方案 »

  1.   

    错误是不是因为mapping没定义好?输入正确不正确都转发到Login.jsp是我偷懒
      

  2.   

    to  dlxu(沿着Java继续前进)  这个是因为我直接复制了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="LoginActionForm" type="elective.LoginActionForm" />
      </form-beans>
      <action-mappings>
       <action path="/LoginAction" type="elective.LoginAction" name="LoginActionForm" input="/Login.jsp" scope="request">
          <forward name="success" path="/Login.jsp" />
          <forward name="failure" path="/Login.jsp" />
        </action>
      </action-mappings>
    </struts-config>我的struts-config是用Jbuilder9.0配置的。
      

  3.   

    struts-config.xml配置有问题了
      

  4.   

    我也用struts不久,我觉得首先应该是配置文件的问题,然后,我的理解,应该用.do的方式,把输入jsp页面里的<html:form action="/LoginAction" method="GET">里的LoginAction改成一个xx.do,然后把这个xx填到配置文件的path里面"/xx"代替原来的,我想跟web.xml也有关的,那里面要找到xx.do才能找到Form和Action的,大家讨论一下,我的个人见解
      

  5.   

    <html:form action="/LoginAction" method="GET">把LoginAction改成loginAction,对应的struts-config也改了。试试。
      

  6.   

    问题没解决为什么要结贴?这是外国网站对这个问题的处理,不过我试了一下好象还是没有解决:Exceptions, Errors and Bears - Oh My! 
    <html:form>, ActionMappings and Actionforms. This one took me a few days to figure out. When using the <html:form> tag, either JBoss or Tomcat will not create / parse the struts-config.xml document until *after* a post to the ActionServlet. Now that I'm typing this out it makes total sense but I still wasted a few days on it nonetheless. 
    If you are getting the Cannot find ActionMappings or ActionformBeans collection exception when accessing a JSP page, manually make a request to the ActionServlet. Most example code suggests this URL would be something like http://localhost/your_web_app/action/blah 
    http://localhost/your_web_app/some/nested/url/your_action.do You don't need to send this manual request to a real Action - so long as the container maps the request to the ActionServlet you're OK. In my environment I simply use an Ant <get> task to hit http://localhost:8080/my_web_app/action/dumbHackToAvoidThisProblemSmileyFace Also, anytime the web application is reloaded this procedure needs to be repeated. Doh!. After all that, I just learnt that all you need to do is direct the servlet container to load the servlet on startup by adding a <load-on-startup>5</load-on-startup> directive to the <servlet> section in web.xml. org.apache.jasper.JasperException: Cannot find ActionMappings or ActionformBeans collection 
           at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248) 
           at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) 
           at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) 
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Resource Bundles. So, you've played with Struts and everything is working nicely. Like a regular developer you left resource bundles till the end. But, now you want to use <html:errors>, but when you do you get: 
    javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE 
           at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:530) 
           at org.apache.jsp.createCustomer_jsp._jspService(createCustomer_jsp.java:126) 
           at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) 
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
           at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204) 
           at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) 
           at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) 
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
           at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) 
           at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) You'll need to create your Resource bundle. A fact I had to track down was how do you tell Struts where your resource bundle is? It's one of the servlet initialization parameters in web.xml. 
    <servlet> 
     <servlet-name>credux</servlet-name> 
     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> 
     <init-param> 
       <param-name>application</param-name> 
       <param-value>net.threebit.credux.struts.CreduxResources</param-value> 
     </init-param> 
    </servlet> 
      

  7.   

    关于“为什么用struts1.0就OK?”
    Struts1.1版本与1.0版本有些不同,另外,当前的1.2.4版本又与1.1版本有些不同,可参考http://dev.csdn.net/user/kui,《Struts 1.2.1新特点简介(1) 》.如果找到了问题之处,应进一步从源程序分析其原因,以备以后工作之用。
      

  8.   

    问题已解决,用其他好的程序的lib替换就行至于产生这种情况的原因还请高手指点
      

  9.   

    页面要想拿到数据,必须经过action吧~!