zoukankan      html  css  js  c++  java
  • strut2配置文件属性介绍

    mystruts.xml配置文件属性介绍

      1.package标签的中的namespace属性

        <package name="default" extends="struts-default" namespace="/">
          <action name="helloword" class="day01.helloword">
            <result name="success">/WEB-INF/index.jsp</result>
          </action>
        </package>
        namespace默认是“/”这个命名空间,也可以自定义,例如“/mytest”,
          当命名空间为自定义时,访问url:http://localhost:8080/test/mytest/helloword.action,(此处test为项目名)如果写掉了没有mytest则会报找不到hellword这个action
          当命名空间为默认时:访问url:http://localhost:8080/test/helloword.action

      2.result标签中的name和type属性

    <action name="hello" class="hello.helloAction" method="excute">
    <!--result返回的是配置结果集
    name与方法的返回值匹配,默认是success
    type:表示结果类型,默认值为dispatcher(转发到结果)
    -->
    <result name="success" type="dispatcher">/index.jsp</result>
    </action>
  • 相关阅读:
    git, tornado 小计
    算法小计-列表排列
    CMDB小计1
    linux 中mysql的主从复制
    SQL语句的种类
    mysql的结构,段页区,及客户端命令
    mysql的程序结构,实例, 及mysql的多实例
    在linux中操作mysql误删root用户的应对方法
    MySQL面试
    linux下载安装mysal
  • 原文地址:https://www.cnblogs.com/blogxiao/p/6275040.html
Copyright © 2011-2022 走看看