zoukankan      html  css  js  c++  java
  • Struts

    Struts的几种开发方式:

    1、  extends ActionSupport 

    2、  implements Action  该action来自com.opensy。。。

    3、  就是类

    三者使用顺序就是,想要数据校验就必须extends Ac…

    通配符:

    Struts.xml 文件中进行配置:

             <action name=”out_*” class-“” method=”{1}”>//可以配置多个*号

                       <result name=”{1}”>{1}.jsp  可以配置的位置就是如此之多 {2} 就是第二个*号

    Struts路径配置原则:

             Namespace=“/a”  他会在/a以及/a以下的文件夹中搜索

    struts 常量:

             <content name=”” value=””/>

             改变访问后缀:struts.action.extension “abc,” 访问后缀是abc或者空格

                       在action中不写menthod 默认调用method

                                                   不写class   默认调用系统的一个

                                                   result       默认是success

                       什么情况下不写class?需要跳转到web-info 下的资源的时候

                       全局视图配置:<global-results> 默认没写的都跳转该配置地址

    struts对数据的操作:

             ServletActionContext     耦合,获取地址使用

             ActionContext                      解耦,设置值使用

             implements ResultAware

             自动封装数据

                      <input name=”abc”>

                      获取数据的action private String abc;并get set方法

             上传下载

                       <input type=”file” name=”def”> 还得配置enctype

                       获取上传action

                                private File def;

                                private String defFileName;

                                private String defContentType

                       下载:

                                在配置文件中加入 type=”stream”

                                配置下载方法:去掉get

             自定义装换类型需要继承StrutsTypeConvert

    result name=”input”>/error/error.jsp

  • 相关阅读:
    关于苹果IPhone/Ipad(IOS)开发者证书申请及安装、真机调试、发布的参考文章
    vs 关闭警告
    真机测试及布署Code Sign error问题总结
    在 Win32 Application 和 Win32 Console Application 中使用 MFC
    获取应用程序路径的区别
    js日期控件
    SQL SERVER 企业管理器 MMC 无法创建管理单元
    进程查看两利器
    用PowerDesigner逆向数据库工程时”Unable to list the table"错误的解决方法
    SQL 附加无日志数据库
  • 原文地址:https://www.cnblogs.com/core404/p/5847543.html
Copyright © 2011-2022 走看看