ICode9

精准搜索请尝试: 精确搜索
  • 自定义属性编辑器不适用于Spring MVC中的请求参数吗?2019-12-10 02:19:42

    我正在尝试使用Spring注释创建一个多动作Web控制器.该控制器将负责添加和删除用户概要文件,并为jsp页面准备参考数据. @Controller public class ManageProfilesController { @InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustom

  • java-在进行JUnit测试时,有什么方法可以在ContextConfiguration中排除上下文?2019-11-22 18:12:49

    所以,我要加载遵循正则表达式的一组应用程序上下文,正则表达式是-context.xml之后的任何内容,好吗? 这省了我很多时间,因为我不需要一个接一个地添加很多应用程序上下文.现在,这些应用程序上下文之一给我带来麻烦,我希望它不包含在上下文配置中.我可以在@ContextConfiguration批注中

  • 为什么我不能让弹簧加载时间进行编织工作2019-11-22 17:21:00

    我一直在尝试使@Configuration构建示例工作(以常规方式),因此我可以使用Spring容器触发依赖项注入,但是我所得到的只是关于-javaagent的错误,我似乎无法修复 我有一个像这样的beanConfig类     @组态     @EnableSpringConfigured //应该打开AnnotationBeanConfigurerAspec

  • Spring @Async批注2019-11-18 04:19:29

    我对Spring @Async注释有疑问. 我有一个控制器自动连线服务(GnInsuranceDetailsS​​ervice) @RequestMapping(value="/agn/AP0W01A_010/insertDetail.do") public ResponseEntity<?> insertDetail(@ModelAttribute("dto")GnInsuranceDetailsDTO dto,HttpSession sessio

  • java-类似Spring中非EJB的EJB接线2019-11-07 21:29:50

    我最近注意到,如果我用@Interceptors(SpringBeanAutowiringInterceptor.class)注释ejb,spring可以为我连接ejb.我从来没有真正做到过,所以不知道细节. 我想知道,是否有办法使它与其他种类的bean一起使用,例如,@ WebService注释的bean. 目前,在我的Web服务类中(因为应用程序服务器管

  • 在集成测试中使用Spring @ActiveProfile2019-10-30 14:19:54

    我正在使用@Profile Spring批注在嵌入式,独立和容器托管数据源之间进行选择.为了选择“嵌入式”,对我的集成测试进行了注释,以激活适当的配置文件: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader=AnnotationConfigContextLoader.class, classes={TestConf

  • java-指定Spring @Autowired的顺序2019-10-29 18:28:46

    我正在使用Spring Framework 4. 我有一个类(例如ClassA),其中使用了另一个类(例如ClassB). ClassA的成员变量从ClassB获得价值. ClassB具有从属性文件读取数据的静态方法.在ClassB中,使用@Autowired批注注入了静态成员变量ApplicationContext. 我想要的是,我要确保当ClassA使用其成

  • java-Spring Framework AliasFor注释难题2019-10-27 03:01:01

    我正在使用Spring Boot(1.3.4.RELEASE),并且对4.2中引入的新@AliasFor注释有疑问 考虑以下注释: 视图 @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Component public @interface View { String name() default "view"; } 综合 @Retention(RetentionPoli

  • java-在Spring 4 MVC中是否可以将控制器/具有控制器作为内部类嵌套?2019-10-13 13:20:24

    我想有一个映射到/ site /的控制器,并且在这两个不同的控制器中看起来像: @Controller @RequestMapping(value="/api") public class ApiController { @Controller @RequestMapping(value="/foo") public class FooController { //Some /foo/* methods here

  • java – 是否可以在Spring Framework中使用注释设置bean名称?2019-09-30 15:00:12

    我有这样的豆: @Bean public String myBean(){ return "My bean"; } 我想要自动装配它: @Autowired @Qualifier("myBean") public void setMyBean(String myBean){ this.myBean=myBean; } 我需要这样的东西: @Bean(name="myCustomBean") 是否可以使用开箱即用的bea

  • Spring Boot @Value属性2019-09-29 03:20:37

    我有一个Spring Boot应用程序,在其中一个类中,我尝试使用@Value从application.properties文件引用一个属性.但是,该财产没有得到解决.我查看了类似的帖子,并尝试按照建议,但这没有帮助.这堂课是: @Configuration @ComponentScan @EnableAutoConfiguration public class PrintProper

  • spring – 有没有办法让@Autowire需要构造函数参数的bean?2019-09-17 00:19:15

    我正在使用Spring 3.0.5并尽可能地为我的班级成员使用@Autowire注释.我需要自动装配的bean之一需要其构造函数的参数.我查看了Spring文档,但似乎找不到任何关于如何注释构造函数参数的引用. 在XML中,我可以将其用作bean定义的一部分. @Autowire注释是否有类似的机制? 例如: @Compone

  • Spring @Transactional不能与其他注释一起使用?2019-09-02 23:19:46

    所以我的春季教育仍在继续目前我正在尝试学习一些注释以及它们为Spring 3带来的东西.所以我有一个迷你webapp可以连接到DB并通过表单放入内容并显示记录等等.一切正常.我决定尝试让Spring自动检测我标记为@Transactional的服务bean,但这样做会阻止应用程序保存到数据库.所以: @Tran

  • java – 为什么更改joinColumn的顺序,hibernate返回正确或不正确的查询?2019-09-02 01:28:33

    问题: 为什么更改joinColumn的顺序,hibernate返回正确或不正确的查询? 第一次加入: @OneToOne @JoinTable(name="TTR_POA_UPA", joinColumns = { @JoinColumn(name="ANO", insertable=false, updatable=false), @JoinColumn(name="ID_ESCAL

  • java – 使用AspectJ的AOP在春天不工作?2019-09-01 04:19:29

    我的Aspect课程将是, @Configuration @EnableAspectJAutoProxy @Component @Aspect public class AspectClass { @Before("execution(* com.pointel.aop.test1.AopTest.beforeAspect())") public void logBefore(JoinPoint joinPoint) { System.out.pr

  • javascript – Request Param中的Ajax POST数据2019-08-29 01:20:20

    我正在发出一个POST请求,如下所示: $.ajax({ url :"/clientCredentials.json", type: "POST", data: { "clientEmail": email, "clientName":clientName, "orgName":orgName, "l

  • java – @Cachable注释不起作用2019-08-25 22:22:18

    我们在项目中使用ehcache进行缓存. import com.googlecode.ehcache.annotations.Cacheable; // Other imports @Component public class Authenticator{ @Cacheable(cacheName = "rest_client_authorized") public boolean isUserAuthorized(final String user, final

  • java – Spring @Value注释不能与mockito mock一起使用2019-08-25 08:19:16

    我正在使用spring @Value注释并为A类中的某些字段设置值. 我正在为这个A类编写单元测试.在测试课中,我用Mockito @Spy注释了A类的参考.我将值设置为系统属性,然后调用MockitoAnnotations.initMocks(this). 我的期望是,间谍对象将通过@Value注释使用系统属性中的值初始化字段.但这不

  • 如何调试Spring Security授权注释2019-08-24 20:20:16

    我有spring安全应用程序,希望启用注释安全性(授权前和授权后). 我也有小样本应用程序,我已经实现了它.一切正常.但是将配置移动到主应用程序失败了.控制台中没有错误.但注释不起作用.看起来,他们根本就没有被贬低.所有配置和组件版本完全相同. 有 <security:global-method-securit

  • spring – @ControllerAdvice覆盖异常@ResponseStatus2019-08-24 03:19:35

    我不确定为什么,但@ControllerAdvice使用@ResponseStatus注释覆盖在Exception级别定义的响应代码. 例外: @ResponseStatus(HttpStatus.BAD_REQUEST) public class GreetException extends RuntimeException {} 控制器: @RestController @RequestMapping("/") public class GreetCo

  • java – Spring MVC @AutoWired响应不起作用2019-07-29 18:19:23

    我有 : @Controller @RequestMapping(value="admin/*", method=RequestMethod.GET) public class AdminController { @Autowired private HttpServletRequest request; @Autowired private HttpServletResponse response; @RequestMapping

  • 关于Spring 3框架的一堆问题2019-07-29 16:19:37

    以下是阅读Spring Reference产生的问题,请帮忙. (1)我是否需要手动创建ApplicationContext?我是否需要第二个AplicationContext实例? (2)我们有以下配置说明: <context:annotation-config/> <context:component-scan base-package=".."/> <mvc:annotation-driven/> 这些说明是否与

  • java – 获取@Service注释类的bean?2019-07-29 02:10:13

    在我的Web应用程序中,我没有使用applicationContext.xml.如何获取@Service注释类的bean? 如果我在我的Web应用程序中使用了applicationContext.xml,则每次都必须加载applicationContext.xml以获取@Service注释类的bean. 我用这种方式 WebApplicationContext ctx = WebApplicationCo

  • java – 如何使用注释对Spring执行基于构造函数的依赖注入?2019-07-28 23:19:08

    好的,所以如果我需要在构造函数中放入一些原始值,我该怎么做? @Autowired public CustomBean(String name, @Qualifier("SuperBean") SuperBean superBean) { super(); this.superBean = superBean; this.name = name; } 例如,我在这里定义superBean有限定符“Sup

  • 如何在一种方法中正确注入Spring环境而不是另一种方法?2019-07-09 10:20:20

    neo4jDatabase()很好,但是在graphDatabaseService()中环境始终为null …如何/为什么? @Configuration @PropertySource("classpath:/neo4j.properties") @EnableNeo4jRepositories("reservation.repository.neo4j") public class Neo4jConfig extends Neo4jConfiguration

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有