ssh执行流程
2010-12-17 13:47
218 查看
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"/@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:宋体;
mso-bidi-font-family:宋体;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
1.
从页面开始,工资管理触发一个action(salary!init.action:
为多分支action
,action
名为salary,
执行的方法为init()
方法)
2.action
交给struts2
处理,读取src
目录struts.xml
文件,其中有个配置salary
的action,
如下所示:
<action name="salary"
class="salaryAction">
<result
name="list">/admin/salary_page.jsp</result>
</action>
3.
根据class="salaryAction"
交给Spring(
为什么struts
的action
会交给spring
处理呢?原因是:Struts2
提供一个jar
包
struts2-spring-plugin-2.1.2.jar
,有个struts.properties
文件,打开查找,输入auto
查找有这样一段话:
### specifies the autoWiring logic when using the
SpringObjectFactory.
### valid values are: name, type, auto, and constructor
(name is the default)
struts.objectFactory.spring.autoWire = name
。也就是有了上面那个jar
包之后,根据name
自动提交给Spring
处理)
,
读取Spring
容器的配置文件/WebRoot/WEB-INF/applicationContext.xml
文件。
<bean name="salaryAction" class="com.bu3g.ssh.web.action.SalaryAction">
<property name="empService">
<ref local="empService" />
</property>
</bean>
根据applicationContext.xml
配置文件找到com.bu3g.ssh.web.action.SalaryAction
类,其中有一个属性empService,
并提供了
setEmpService()
方法,由applicationContext.xml
文件得知该empService
对象由Spring
容器依赖注入,set
注入。
由<ref local="empService" />
这个可以知道SalaryAction
的属性empService
引用了本地的(即applicationContext.xml
文件中
配置的一个bean
)
<bean id="empService"
class="com.bu3g.ssh.service.impl.EmployeeServiceImpl">
<property name="empDAO" ref="empDAO"
/>
<property name="payDAO" ref="payDAO"
/>
</bean>
4.
取得empService
对象(
接口对接口实现类的一个引用)
后,调用它的getPager
方法。后面的就是访问DAO
了,一长串省略号代替。。。。。。。。。。。。。。
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"/@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:宋体;
mso-bidi-font-family:宋体;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
1.
从页面开始,工资管理触发一个action(salary!init.action:
为多分支action
,action
名为salary,
执行的方法为init()
方法)
2.action
交给struts2
处理,读取src
目录struts.xml
文件,其中有个配置salary
的action,
如下所示:
<action name="salary"
class="salaryAction">
<result
name="list">/admin/salary_page.jsp</result>
</action>
3.
根据class="salaryAction"
交给Spring(
为什么struts
的action
会交给spring
处理呢?原因是:Struts2
提供一个jar
包
struts2-spring-plugin-2.1.2.jar
,有个struts.properties
文件,打开查找,输入auto
查找有这样一段话:
### specifies the autoWiring logic when using the
SpringObjectFactory.
### valid values are: name, type, auto, and constructor
(name is the default)
struts.objectFactory.spring.autoWire = name
。也就是有了上面那个jar
包之后,根据name
自动提交给Spring
处理)
,
读取Spring
容器的配置文件/WebRoot/WEB-INF/applicationContext.xml
文件。
<bean name="salaryAction" class="com.bu3g.ssh.web.action.SalaryAction">
<property name="empService">
<ref local="empService" />
</property>
</bean>
根据applicationContext.xml
配置文件找到com.bu3g.ssh.web.action.SalaryAction
类,其中有一个属性empService,
并提供了
setEmpService()
方法,由applicationContext.xml
文件得知该empService
对象由Spring
容器依赖注入,set
注入。
由<ref local="empService" />
这个可以知道SalaryAction
的属性empService
引用了本地的(即applicationContext.xml
文件中
配置的一个bean
)
<bean id="empService"
class="com.bu3g.ssh.service.impl.EmployeeServiceImpl">
<property name="empDAO" ref="empDAO"
/>
<property name="payDAO" ref="payDAO"
/>
</bean>
4.
取得empService
对象(
接口对接口实现类的一个引用)
后,调用它的getPager
方法。后面的就是访问DAO
了,一长串省略号代替。。。。。。。。。。。。。。
相关文章推荐
- JavaEE--SSH--hibernate框架执行流程
- SSH 的执行流程
- JavaEE--SSH--structs2-执行流程及配置文件详解
- SSH执行流程
- SSH之Strust2--Struts2的执行流程
- Shiro整合SSH开发2:结合Struts2实现登陆和退出以及Shiro执行流程和原理解析
- 最近做一个SSH项目总结出来的一些程序执行流程
- Activiti介绍(二):Activiti建表,执行操作流程
- vc6之单文档程序执行流程
- Monkey源代码分析之执行流程
- Git配置SSH,并Push到GitHub上的相关流程
- Spark算子执行流程详解之七
- alsa录音放音执行流程详解
- 关于测试流程设计与执行的思考.
- SpringMvc的执行流程
- Android图片加载框架最全解析(二),从源码的角度理解Glide的执行流程
- golang并发ssh执行远程命令
- Thinking in JAVA笔记——第三章 操作符 &第四章控制执行流程
- JUnit4的执行的一般流程
- ssh远程后台执行matlab程序(可并行优化)