Struts 2 - Architecture】的更多相关文章

From a high level, Struts2 is a pull-MVC (or MVC2) framework. The Model-View-Controller pattern in Struts2 is realized with following five core components: Actions Interceptors Value Stack / OGNL Results / Result types View technologies Struts 2 is s…
As you learnt from the Struts 2 architecture, when you click on a hyperlink or submit an HTML form in a Struts 2 web application, the input is collected by the Controller which is sent to a Java class called Actions. After the Action is executed, a R…
Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts: Model - The lowest level of the pattern which is responsibl…
基于Web的MVC framework在J2EE的世界内已是空前繁荣.TTS网站上几乎每隔一两个星期就会有新的MVC框架发布.目前比较好的MVC,老牌的有Struts.Webwork.新兴的MVC框架有Spring MVC.Tapestry.JSF等.这些大多是著名团队的作品,另外还有一些边缘团队的作品,也相当出色,如Dinamica.VRaptor等.这些框架都提供了较好的层次分隔能力.在实现良好的MVC 分隔的基础上,通过提供一些现成的辅助类库,同时也促进了生产效率的提高. 如何选择一个好的…
Figure   1.1. The Java Servlet API exposes the HTTP client/server protocol to the Java   platform. Struts 2 is built on top of that.   For web applications, HTTP has two hurdles to get over. It’s stateless, and it’s text based.   Don’t reinvent the w…
七月 11, 2016 3:49:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:EBook' did not find a matching property.七月 11, 2016 3:4…
一. 最近在学习Struts2的一些知识,在使用Struts2搭建框架的时候,部署到服务器上的时候出现上面的问题: 三月 19, 2016 1:43:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.ser…
问题:   为什么 invoke()方法,一旦执行,表示action方法执行完毕,jsp页面已经处理完毕: 其返回值再修改无意义,不影响结果?? 解释: 着重看如下颜色的字: ■ ■ 官方文档有明确的说明: The diagram describes the framework's architecture. In the diagram, an initial request goes to the Servlet container (such as Jetty or Resin) whic…
n the diagram, an initial request goes to the Servlet container (such as Jetty or Resin) which is passed through a standard filter chain. The chain includes the (optional) ActionContextCleanUp filter, which is useful when integrating technologies suc…
Struts2 is popular and mature web application framework based on the MVC design pattern. Struts2 is not just the next version of Struts 1, but it is a complete rewrite of the Struts architecture. The WebWork framework started off with Struts framewor…
高屋建瓴 From Up to Down. Outside into inside. Interface-Oriented Framework with dynamic configuration. SOA:Service-Oriented Architecture. 一.总述 三种方式: WPF OSGi SOA Architecture 二.看看一些系统架构 Windows 架构,架构变迁的从提供功能到以服务为核心. Service-Centered Linux 系统架构 Windows M…
在完成Struts2的HelloWorld后,对Struts2的工作原理进行学习.Struts2框架可以按照模块来划分为Servlet Filters,Struts核心模块,拦截器和用户实现部分,其中需要用户实现的部分只有三个,那就是struts.xml,Action,Template(JSP),如下图: 2.3.31中的org.apache.struts2.dispatcher.ActionContextCleanUp已经被标记为@Deprecated Since Struts 2.1.3,2…
Struts的拦截器 1.什么是拦截器 Struts的拦截器和Servlet过滤器类似,在执行Action的execute方法之前,Struts会首先执行Struts.xml中引用的拦截器,在执行完所有引用拦截器的intercept方法后,才会执行Action的execute方法. 1.在struts中,把每一个功能都用一个个的拦截器实现:用户想用struts的哪个功能的时候,可以自由组装使用 2.在Struts中,为了方法用户对拦截器的引用,提供了拦截栈的定义,里面可以包含多个拦截器.拦截栈就…
Struts的核心业务 Struts核心业务有很多,这里主要介绍了比较简单一些的: 请求数据的处理,和数据自动封装,类型自动转换 1.Struts中数据处理 1.1.方式1:直接过去servletapi 核心类:ServletActionContext提供的静态方法 /** * * 数据处理方式1: */ public class dataAction extends ActionSupport{ public String execute() throws Exception { //1.请求…
Struts的文件上传下载 1.文件上传 Struts2的文件上传也是使用fileUpload的组件,这个组默认是集合在框架里面的.且是使用拦截器:<interceptor name="fileUpload" calss="org.apache.struts2.interceptor.FileUploadInterceptor/> 来完成的. 1.1.Struts完成文件上传的基本步骤 由于功能已经在拦截器就已经完成了,所以在action中就只需要进行配置就可以了…
hibernate文件配置 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&…
失败页面fail.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd&…
1. struts.xml 文件基本配置: 主要放在资源路径下,配置 sturts2相关的 Action , 拦截器等配置 <struts> <!-- 设置常量 --> <constant name="struts.enable.DynamicMethodInvocation" value="false"/> <constant name="struts.devMode" value="true…
在Java Web项目中,经常要在项目开始运行时启动一个线程,每隔一定的时间就运行一定的代码,比如扫描数据库的变化等等.要实现这个功能,可以现在web.xml文件中定义一个Listener,然后在这个Listener中启动一个线程,在线程里面实现功能. 1. 自定义Listener 在Struts+Spring+Hibernate的Web项目中,web.xml里面一般都会有这样的代码: <listener> <listener-class>org.springframework.w…
今天开始接触公司的框架,叫YNA,三个字母应该是雅马哈的缩写,这个框架听公司前辈说功能很强大,但实际上我看不懂.哈哈...... 其中整合了SSH框架,接下来我说下Struts的一些原理 其实这张图就能很清晰地表明Struts的工作原理了,但前提是要有WEB系统的实践经验,只要接触过,再来看这个说明图,我相信都能理解. 下面是一个实例说明…
axis2和struts在整合过程中,struts会把axis的地址也拦截了,默认当成一个action处理, 会因为找不到action而报错: <!-- struts配置 --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</fil…
通过继承ActionSupport类来完成Action开发,ActionSupport类不仅对Action接口进行简单实现, 同时增加了验证.本地化等支持 .真实开发中自定义Action都需要继承该类.对用户登录添加表单验证功能 ActionSupport类的作用: struts2不要求我们自己设计的action类继承任何的struts基类或struts接口,但是我们为了方便实现我们自己的action,大多数情况下都会继承com.opensymphony.xwork2.ActionSupport…
在iOS开发中经常遇到的一个错误是Undefined symbols for architecture arm64,这个错误表示工程某些地方不支持arm64指令集.那我们应该怎么解决这个问题了?我们不仅要解决这个问题,更要了解出现这个问题的根源.这样根本上杜绝这类问题发生. 对于iOS设备来说iOS的指令集有armv6.armv7.armv7s.arm64这样四种,不同型号的iOS设备使用不同的指令集,下面是各自的区别: armv6 iPhone.iPhone 3G iPod 1G.iPod 2…
案例:http://blog.csdn.net/jiuqiyuliang/article/details/39061305 减少在运用MVC设计模型来开发Web应用的时间. l  M —— JavaBean或EJB l  V —— JSP.Tag l  C —— Action(用户请求和业务逻辑之间的桥梁) 和 Action Servlet EJB   Enterprise Java Beans l  会话Bean(Session Bean) l  实体Bean(Entity Bean) l …
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"    "http://struts.apache.org/dtds/struts-2.3.dtd"><struts>    <…
在默认情况下,Struts2只自动加载类加载路径下的struts.xml.default-struts.xml和struts-plugin.xml三类文件.但是随着应用规模的增大,系统中Action数量也大量增加,将导致struts.xml非常臃肿.为了避免这种这情况,我们可以将struts.xml配置文件分解成多个配置文件,然后在struts.xml文件中包含其他配置文件.被包含的配置文件也是标准的Struts2配置文件,一样包含了DTD信息,根元素等信息. 以下是struts.xml配置文件…
来自:Oracle® Database Installation Guide 12_c_ Release 1 (12.1) for Linux Oracle base目录命名规范: /pm/s/u 例如:/u01/app/oracle /u01/app/grid Naming Mount Points for Very Large Databases (VLDBs) /h/q/d 例如:/u01/app/oracle/oradata/test and /u02/app/oracle/oradat…
在使用struts2框架时,为我们提供了时间选择器控件:datetimepicker.但是在使用过程中会出现一些问题,主要就是struts2版本更新时做了一些修改.在struts2.0时,使用<s:datetimepicker/>时,需要在<head></head>标签中申明:<s:head theme="ajax"/>.但在struts2.1.6时,struts2就不再单独提供主题ajax,而是将ajax主题整合到dojo包中.所以我们…
<默认>execute -- 默认方法success -- 默认返回值 <配置><package><package name="default" namespace="/" extends="struts-default">name -- 避免重命名namespace -- 路径extends="struts-default" -- struts2必须继承 <action&…
使用Struts2流程: 1.导入Struts2类包 2.在Web源代码文件夹中,创建名为struts.xml的配置文件.在其中定义Action对象,其关键代码如下: struts.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//…