java SSM
嘻嘻哈哈Man
这个作者很懒,什么都没留下…
展开
-
背景图片上传
controller //上传背景图片 @PostMapping("/upload") public String upload(Integer id, @RequestParam("file") MultipartFile uploadFile,HttpServletRequest request){ //上传文件位置 String path=request.getSession().getServletContext().getRealPath("原创 2021-03-29 13:37:04 · 134 阅读 · 0 评论 -
创建定时任务
目标:对调查问卷的状态进行定时检测//定时任务,检测问卷状态@EnableSchedulingpublic class ScheduleTask { @Autowired private SurveyService surveyService; @Scheduled(cron = "*/10 * * * * ?") public void state(){ System.out.println("执行任务"); surveyServic原创 2021-03-29 13:25:52 · 70 阅读 · 0 评论 -
spring整合mybatis
<!--整合mybatis--> <!--加载外部properties文件--> <context:property-placeholder location="classpath:jdbc.properties"/> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driver...原创 2021-03-29 13:20:51 · 58 阅读 · 0 评论 -
数据库事务
<!--数据库事务--> <!--平台事务管理器--> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <!--事务增强...原创 2021-03-29 13:19:45 · 62 阅读 · 0 评论 -
ssm操作日志管理
技术不到位考虑到的比较少。使用自定义注解对函数进行操作类型设定//自定义注解@Target(ElementType.METHOD) //方法注解@Retention(RetentionPolicy.RUNTIME) //设置生存周期,运行时可见public @interface LogPointCutAnno { String operateType() default "";//标记当前操作类型}使用环绕通知对日志信息进行获取保存@Aspect@Componentpub原创 2021-03-29 13:04:02 · 947 阅读 · 0 评论 -
Mybatis获取插入数据自增长字段值
<insert id="add" keyProperty="id" useGeneratedKeys="true" parameterType="com.example.domain.Question" > insert into tb_question (id,survey_id ,title,remark,type,required,check_style,order_style ,show_style,test,score,orderby,creator,cre..原创 2021-03-14 20:28:01 · 376 阅读 · 0 评论