还有一个 好像 Action名要跟你那个一致
具体我忘记了
好像你test!test.action
是访问 TestAction的test方法 
他是根据名字去找action的吧

解决方案 »

  1.   

    http://localhost:8080/Struts2_demo/path/li!list1.action
      

  2.   

    !前面是action名(去掉action后缀后的)
    后面就是方法名 想访问哪个都行
    只不过这种方式是要用注解的方式来写的
    用配置文件貌似不行的
      

  3.   

    你想用配置文件的方式 就不能这么写吧
    配置文件 你先得在web.xml上指定后缀
     <filter>
        <filter-name>struts</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
      </filter>
      <filter-mapping>
        <filter-name>struts</filter-name>
        <url-pattern>*.html</url-pattern>
      </filter-mapping>然后在配置action的时候
     <package name="struts2" namespace="/path"  extends="struts-default">
     <action name="li1" class="controller.T" method="方法1">
     <result name="success">/index.jsp</result>
     <result name="false">/false.jsp</result>
     <result name="true">/true.jsp</result>
      </action>
    <action name="li2" class="controller.T" method="方法2">
     <result name="success">/index.jsp</result>
     <result name="false">/false.jsp</result>
     <result name="true">/true.jsp</result>
      </action>
      </package>
      

  4.   

    访问方法1:
    http://localhost:8080/Struts2_demo/path/li1.html
    访问方法2:
    http://localhost:8080/Struts2_demo/path/li2.html
      

  5.   

    以上说的都不行,
    访问指定Action中的方法有两种:
    1、指定属性method的值设置为想使用的方法。
    2、URL中将需要访问的方法通过“Action名!方法名”的方式进行访问。
    我现在想使用的是第二种方式,第一种尝试过了,没有问题,
    问题是第二种想请大家帮我看看是不是URL地址有什么问题。。