草庐IT

spring的jar包

全部标签

xml - 如何在 Spring MVC 中配置自定义 MediaType?

使用SpringMVC,我的Controller已经适用于JSON和XML媒体格式。在内容协商配置中,我想只依赖Acceptheader,并引入自定义名称媒体类型,例如:“myXml”我的配置:@Configuration@EnableWebMvcpublicclassWebConfigextendsWebMvcConfigurerAdapter{@OverridepublicvoidconfigureContentNegotiation(ContentNegotiationConfigurerconfigurer){configurer.favorPathExtension(fals

xml - spring-boot 使用来自 xml 配置的多个 View 解析器无法正确重定向

我有一个使用springxml的遗留应用程序,我正在将其迁移到spring-boot。应用程序启动,我得到身份验证页面,映射在applicationContext-login.xml中。登录成功后,它应该加载WEB-INF/client/home.jsp,但相反,它尝试加载/WEB-INF/auth/home.jsp,我得到404。在启动日志中,我看到它映射了所有路径。为什么这些重定向会发生冲突?我该怎么做才能解决这个问题?它是否因为多个包含View解析器的@ImportResource而遇到问题?从安全http配置中提取:它指向的Controller:@RequestMapping(

xml - 如何通过 XML 在 Spring bean 中设置 XmlAdapters 的 Jaxb2Marshaller 列表?

我试图在Spring-WS中定义一个Jaxb2Marshallerbean,以使用扩展XmlAdapter的自定义适配器。我在XML文件中有以下内容:com.lmig.am.claims.clip.ContactAdapter但是,我收到以下错误:无法将类型[java.lang.String]的值转换为属性“适配器[0]”所需的类型[javax.xml.bind.annotation.adapters.XmlAdapter]:找不到匹配的编辑器或转换策略知道我做错了什么吗?谢谢! 最佳答案 适配器属性需要一组XMLAdapter对象

xml - 支持 XML 的 Spring Boot REST

我使用SpringBoot1.2.5制作了一个简单的REST网络服务,它适用于JSON,但我无法让这项工作返回XML。这是我的Controller:@RestController..@RequestMapping(method=RequestMethod.GET,produces={MediaType.APPLICATION_JSON_VALUE,MediaType.APPLICATION_XML_VALUE})@ResponseStatus(HttpStatus.OK)publicListgetAllActivities(){returnactivityRepository.find

xml - spring xml问题

我正在尝试编写一个简单的SpringAOP应用程序,但我遇到了xml配置问题。我的xml:我收到此警告和异常:WARNING:IgnoredXMLvalidationwarningorg.xml.sax.SAXParseException:SchemaLocation:schemaLocationvalue='http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/sc

xml - maven-jar-plugin 包括 vs 排除

我有一个包含maven-jar-plugin部分的现有pom文件。它为test-jar目标运行,目前排除了几个目录:......somedir/**我需要在somedir目录中包含一个文件,但在somedir目录中保留其余文件。我读到包含优先于排除,所以我添加了如下内容(之前没有包含部分):somedir/somefile.xml这最终会创建一个用于测试的jar文件,其中只有几个文件(只是META-INF中的内容)。我包含的文件也不在jar中。我期望的是一个jar,它与在我的include更改之前创建的jar相同,其中包含一个附加文件。我在这里错过了什么?

xml - 在 Spring 3 中使用注解注册转换器和 converterFactories

首先...我在Spring中相对较新,我使用spring3.x并且我不喜欢SPRING的XML配置文件...我不希望我所做的每一次重构都运行到XML文件中进行更新...我正在尝试以任何请求的方式配置spring,如果我的hadler中有一些@RequestParam/@RequestBody/@PathVariable等类型不是String,spring会将值正确转换为该类型或将处理程序的参数为null(我从不在处理程序参数中使用原始类型)。到目前为止一切顺利......到目前为止,我已经像这样注册了所有转换器/converterFactory类:...有什么方法可以用注解注册转换器吗

xml - 引用的文件包含错误 (jar :file:/. ../plugins/org.jboss.tools.jst.web_3.5.0.Final-v20130717-0309-B75.jar!/catalog/web-facesconfig_2_2.xsd)

我在eclipse中创建JSF项目,文件faces-config.xml出错Referencedfilecontainserrors(jar:file:/D:/eclips/eclipsek/plugins/org.jboss.tools.jst.web_3.5.0.Final-v20130717-0309-B75.jar!/catalog/web-facesconfig_2_2.xsd).faces-config.xml当我删除以下行时,faces-config.xml中的错误指示消失了http://xmlns.jcp.org/xml/ns/javaee/web-facesconfi

xml - 如何使用 XML 配置 Spring Data JPA

我正在阅读“Web应用程序的专业Java-NicholasS.Williams”这本书本书示例具有SpringDataJPA的此配置:@BeanpublicDataSourcecustomerSupportDataSource(){JndiDataSourceLookuplookup=newJndiDataSourceLookup();returnlookup.getDataSource("jdbc/CustomerSupport");}@BeanpublicLocalContainerEntityManagerFactoryBeanentityManagerFactoryBean()

xml - spring security 4 csrf 通过 xml 禁用

有没有办法通过XML配置在springsecurity中禁用CSRFtoken?我只看到java配置在线..可以基于xml的示例。使用spring框架4.0 最佳答案 AsofSpringSecurity4.0,CSRFprotectionisenabledbydefaultwithXMLconfiguration.IfyouwouldliketodisableCSRFprotection,thecorrespondingXMLconfigurationcanbeseenbelow.CSRFprotectionisenabledby