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>
  • 相关阅读:
    java快速排序代码
    java操作redis实现和mysql数据库的交互
    python 操作mysql数据库存
    JAVA 操作远程mysql数据库实现单表增删改查操作
    URI和URL及URN的区别
    day06_字符集设置
    day6_oracle手工建库
    day08_SGA后半部分
    day08_存储
    day05_sqlloader基础
  • 原文地址:https://www.cnblogs.com/blogxiao/p/6275040.html
Copyright © 2011-2022 走看看