SSH相关
这里主要是做一个汇总,把相关介绍的网址黏贴一下。
整个配置文件实例(插一句,一般按次序把这些配置文件配置在服务器的web.xml文件中):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <description>Quartz的本地Cron式执行任务配置</description> <!-- Quartz本地Schduler --> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false"> <property name="triggers"> <list> <ref local="dayQuartzJobTrigger"/> <ref local="onlineNumQuartzJobTrigger"/> </list> </property> </bean> <!-- ==================配置触发器时间================== --> <bean id="dayQuartzJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="dayQuartzJob" /> <!-- 每天23点59分59秒执行一次 --> <property name="cronExpression" value="00 31 20 * * ?" /> </bean> <bean id="onlineNumQuartzJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="onlineNumQuartzJob" /> <property name="cronExpression" value="00 0/5 * * * ?" /> </bean> <!-- ==================配置触发器时间结束================== --> <!-- ==================配置触发器的执行方法和执行方式================== --> <!-- Cron JobDetajil, 基于MethodInvokingJobDetailFactoryBean调用普通Spring Bean --> <bean id="dayQuartzJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="quartzJob" /> <property name="targetMethod" value="execute" /> <!-- 同一任务在前一次执行未完成而Trigger时间又到时是否并发开始新的执行, 默认为true. --> <property name="concurrent" value="false" /> </bean> <bean id="onlineNumQuartzJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="quartzJob" /> <property name="targetMethod" value="executeOnline" /> <property name="concurrent" value="false" /> </bean> <!-- ==================配置触发器的执行方法和执行方式结束================== --> <!-- ==================配置触发器的服务类================== --> <bean id="quartzJob" parent="baseTxProxy"> <property name="target"> <bean class="com.telek.component.schedule.QuartzJob"> </bean> </property> </bean> <!-- ==================配置触发器的服务类结束================== --> </beans>
三、Action中取得Session等网页相关的数据可以使用ActionContext(org.apache.struts2.ActionContex),正如Servelt中可以使用ServletActionContext(org.apache.struts2.ServletActionContext),其中后者继承自前者,只是比前者多若干方法。具体介绍:http://www.cnblogs.com/tanglin_boy/archive/2010/01/18/1650871.html
四、WebRoot\META-INF下面的MANIFEST.MF文件的作用主要是包含了打包的jar或者war的相关信息,譬如main方法入口所在的地方,这个写法就该是:
Manifest-Version: 1.0
Created-By: JDJ example
Main-Class: com.example.myapp.MyAppMain (main方法所在入口)
Class-Path: mail.jar activation.jar(工程依赖的jar包)
它方便的地方在于可以让我们少提供了很多参数:若无这种信息,命令全文应该是:java -classpath mail.jar:activation.jar -jar myapplication.jar com.example.myapp.MyAppMain
而该文件的存在可以使得命令精简为:java -jar myapplication.jar
参考网址:http://blog.csdn.net/outget1/article/details/5364826\
以目标代码的参数赋给aop advisor的参数。【符合正则表达式的showvalue方法是目标代码,它的参数赋值给了bindMethodArgTest。 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <aop:aspectj-autoproxy/> <aop:config> <aop:aspect id="bindArgs" ref="bindArgsAspectBean"> <aop:before method="bindMethodArgTest" arg-names="[color=red]argvalue[/color]" pointcut="execution( * com.spring.ch4.*.showValues(..)) and args([color=red]argvalue[/color])" /> </aop:aspect> </aop:config> <bean id="nameBean" class="com.spring.ch4.InitializingBeanNameClass"> <property name="firstName" value="shen"/> </bean> <bean id="bindArgsAspectBean" class="com.spring.ch4.pointcut.xml.BindArgs" /> </beans>
六、hibernate语句中不要加“;”,会报“无效字符”错误!!!