![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
文章平均质量分 63
frank1998819
这个作者很懒,什么都没留下…
展开
-
Spring MVC Locale 的使用 中文 英文 等语言 切换
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"> <property name="defaultLocale" value="en" /> </bean> <bean id="l原创 2011-05-19 15:35:48 · 476 阅读 · 0 评论 -
Spring 如何引用 jar中的XML(转)
在基于Spring构建的项目中,我们都知道核心的Context配置文件是ApplicationContext.xml或者{projectName}-serverlet.xml, 如果我们想拆分配置文件,那么只需在核心的配置文件中import其它的几个配置文件即可。 举例说明:如果当前的项目名称为cms-validator,我们假定现在Spring的核心的Context配置文件是:cm...原创 2013-09-11 15:13:04 · 795 阅读 · 0 评论 -
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [....Service] found for dependency: expected at least 1 bean which qualifies as autowire candida...2013-10-08 12:01:45 · 280 阅读 · 0 评论 -
spring3使用@ResponseBody 输出乱码,加入此配置(转)
spring3使用@ResponseBody 输出乱码,加入此配置 <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" > <property name="messageConverters"> <list> ...原创 2013-10-23 15:32:33 · 80 阅读 · 0 评论 -
springMVC No mapping found for HTTP request with URI(转)
No mapping found for HTTP request with URI出现这个问题的原因是在web.xml中配置错了,如: <servlet> <servlet-name>springMVCDispatcherServlet</servlet-name> <servlet-class>org.springframework.w...原创 2013-10-25 17:32:39 · 85 阅读 · 0 评论 -
主题:Spring Web MVC中的页面缓存支持 ——跟我学SpringMVC系列(转)
原作者 网址 http://www.iteye.com/topic/1121788 注:本章讲的是Spring2的@Deprecated,但还是有必要提一下。跟我学SpringMVC系列。。4.2、Controller接口 Java代码 package org.springframework.web.servlet.mvc; publicinte...原创 2014-04-15 16:59:00 · 126 阅读 · 0 评论 -
Spring MVC 同一URL 触发了 Controller 中的方法两次
Spring MVC 同一URL 触发了 Controller 中的方法两次 因为页面中用到了<img src="${user.image}"> 标签若src的值为空,则会请求两次controller中的方法,解决方法:加个判断,若${user.image} 为空时,不显示即可<img src="${user.image}" alt="test" one...2014-04-16 15:06:46 · 603 阅读 · 0 评论 -
使用Spring Cloud和Docker构建微服务(转)
【编者的话】这是系列博文中的第一篇,本文作者使用Spring Cloud和Docker构建微服务平台,文章的例子浅显易懂。本系列博文主要向大家介绍如何使用Spring Cloud和Docker构建微服务平台。什么是Spring Cloud?Spring Cloud 是Pivotal提 供的用于简化分布式系统构建的工具集。Spring Cloud引入了云平台连接器(Cloud Con...原创 2016-08-17 10:38:45 · 106 阅读 · 0 评论 -
Spring下载方式(转)
Spring官网改版后,很多项目的完整zip包下载链接已经隐掉了,虽然Spring旨在引导大家用更“高大上”的maven方式来管理所依赖的jar包,但是完全没想到中国的国情,在伟大的墙内,直接通过maven下载墙外的东西,要么龟速,要么直接被和谐。下面是从网上搜集的一些方法,可用于一次性下载Spring各项目的完整dist.zip第一种直接http://repo.springs...原创 2015-10-29 16:23:23 · 102 阅读 · 0 评论 -
Spring定时任务的几种实现(转)
Spring定时任务的几种实现近日项目开发中需要执行一些定时任务,比如需要在每天凌晨时候,分析一次前一天的日志信息,借此机会整理了一下定时任务的几种实现方式,由于项目采用spring框架,所以我都将结合spring框架来介绍。一.分类从实现的技术上来分类,目前主要有三种技术(或者说有三种产品):Java自带的java.util.Timer类,这个类允许你调度一...原创 2015-10-30 11:55:02 · 74 阅读 · 0 评论 -
spring boot + mybatis 完整配置过程+mybatis 体会(转)
在团队里面现在大多数开发者都喜欢用mybatis,因为mybatis 基于sql 基本上看下sql 怎么写就能写出来,算是比较容易上手。因此就萌生了这个spring boot+mybatis的框架构建。(其实笔者更喜欢觉得jpa 更加简洁容易上手 我认为jpa + idea + spring loader 才是开发最快的= = !笔者不喜欢用eclipse 觉得搞terminal有点麻烦,下...原创 2016-09-23 17:07:19 · 414 阅读 · 0 评论 -
quartz在集群环境下的最终解决方案 (转)
原创:http://blog.csdn.net/lifetragedy/article/details/6212831在集群环境下,大家会碰到一直困扰的问题,即多个APP下如何用quartz协调处理自动化JOB。大家想象一下,现在有A,B,C3台机器同时作为集群服务器对外统一提供SERVICE:A,B,C 3台机器上各有一个QUARTZ,他们会按照即定的SCHEDULE自动...原创 2014-11-21 15:37:43 · 305 阅读 · 0 评论 -
springboot2.0跨域配置
springboot2.0跨域配置: 一、代码 Java代码 收藏代码@Value("${cors.allowOrigin.url:anyValue}") private String corsAllowOriginUrl; @ConditionalOnProperty(name="cors.allowOrigin.enable", havingValue="true...原创 2018-07-06 14:44:07 · 146 阅读 · 0 评论 -
javax.servlet.ServletException: Could not resolve view with name 'ok' in (转)
最近使用spring mvc开发项目,遇到一个问题:javax.servlet.ServletException: Could not resolve view with name 'ok' in servlet with name 'spring'at org.springframework.web.servlet.DispatcherServlet.render(Dispatch...原创 2014-05-31 23:10:10 · 387 阅读 · 0 评论 -
sprng mvc3 日期自动绑定(转)
原文 http://blog.csdn.net/whumr1/article/details/8056285 使用spring的mvc,直接将页面参数绑定到对象中,对象中有属性为Date时会报错,此时需要处理下。同样的,其他的需要处理的类型也可以用这种方法。在controller中加入代码 @InitBinderprotected void initBinder(Ht...原创 2013-06-13 15:50:11 · 98 阅读 · 0 评论 -
Spring MVC Locale 的使用 中文 英文 等语言 切换Cookie方式(转)
<% org.springframework.web.servlet.i18n.CookieLocaleResolver cookieLocaleResolver = new org.springframework.web.servlet.i18n.CookieLocaleResolver(); String langCountry = request.getParameter("local...原创 2011-05-19 15:41:37 · 382 阅读 · 0 评论 -
spring classpath* 说明 (转)
0, There is special support for retrieving multiple class path resources with the same name, via the "classpath*" prefix. For example, "classpath*:/beans.xml" will find all beans.xml files in the cl...原创 2011-12-27 17:35:13 · 75 阅读 · 0 评论 -
Spring 加载 spring xml 配置(转)
[b]作者:http://liuwei1578.blog.163.com/blog/static/495803642007116111923195/[/b]Spring中ApplicationContext加载机制。 加载器目前有两种选择:ContextLoaderListener和ContextLoaderServlet。 这两者在功能上完全等同,...原创 2011-12-27 18:50:33 · 72 阅读 · 0 评论 -
spring 加载 xml 配置 6种方式(转)
因为目前正在从事一个项目,项目中一个需求就是所有的功能都是插件的形式装入系统,这就需要利用Spring去动态加载某一位置下的配置文件,所以就总结了下Spring中加载xml配置文件的方式,我总结的有6种, xml是最常见的spring 应用系统配置源。Spring中的几种容器都支持使用xml装配bean,包括: XmlBeanFactory,ClassPathXmlApplicationCon...原创 2011-12-29 00:33:43 · 230 阅读 · 0 评论 -
Spring 连接池 DB Pool 总结(转)
applicationContext-datasource-jdbc.xml <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-be...原创 2011-11-11 20:11:32 · 332 阅读 · 0 评论 -
Spring JDBC Transaction Spring 3.0.6 事务配置
<context:annotation-config></context:annotation-config> <context:component-scan base-package="com.frank.test.dao.*"></context:component-scan> <context:component-scan base-p...原创 2011-11-14 21:33:02 · 85 阅读 · 0 评论 -
candidate for this dependency. Dependency annotations: {@org.springframework.bea
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308) at org.springframework.test.context.suppo...原创 2011-11-15 00:42:46 · 319 阅读 · 0 评论 -
Bean named '*' must be of type [*], but was actually of type (转)
在用junit测试dao接口时,出现以下的错误 Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'userDao' must be of type [com.changetech.dao.impl.UserDaoImpl], but was actuall...原创 2012-06-27 11:10:08 · 723 阅读 · 0 评论 -
spring @Transaction 事务控制
1. 第一种用法--spring.xml 配置文件中 --java service 代码中@Service("userService")@Transactional(readOnly = true)public class UserServiceImpl implements IUserService {@Transact...原创 2012-03-13 14:22:36 · 96 阅读 · 0 评论 -
严重: Servlet.service() for servlet
Spring MVC严重: Servlet.service() for servlet [FrankDemo] in context with path [/FrankDemo] threw exception [Could not resolve view with name '/frank' in servlet with name 'SDS'] with root causejava...2013-05-11 14:43:00 · 12647 阅读 · 0 评论 -
Spring 3 MVC No mapping found for HTTP request with URI (转)
[b][i]原作者:http://chokee.iteye.com/blog/1181625[/i][/b]Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决 2011年01月19日 星期三 11:24 最近项目中使用到Spring3,在感叹Spring3注解配置清爽的同时竟...原创 2012-08-19 23:36:32 · 81 阅读 · 0 评论 -
在使用spring3 mvc中 int 自动绑定(转)
import java.beans.PropertyEditorSupport;import org.springframework.util.StringUtils;/** * * @author 程栋栋 int 2011-4-9 类型转换器 * */public class MyEditor extends PropertyEditorSupport { @Override publ...原创 2013-06-13 15:48:26 · 102 阅读 · 0 评论 -
springboot2.0跨域配置(转)
springboot2.0跨域配置: 一、代码 Java代码 @Value("${cors.allowOrigin.url:anyValue}") private String corsAllowOriginUrl; @ConditionalOnProperty(name="cors.allowOrigin.enable", havingValue="tr...原创 2018-07-17 13:24:27 · 400 阅读 · 0 评论