Questions tagged [spring-annotations]

A common placeholder for issues related to the use of annotations with the Spring framework

The Spring Framework () provides several annotation-driven configuration options from wiring beans to managing transaction.

Annotation types

JSR support

  • JSR 107
    • @CacheResult
    • @CachePut
    • @CacheRemove
    • @CacheRemoveAll
    • @CacheDefaults
    • @CacheKey
    • @CacheValue
  • JSR 250:
    • @Resource
  • JSR 303:
    • @Valid
    • @NotNull
    • @Size, etc
  • JSR 330:
    • @Inject
    • @Named

Useful links

1301 questions
0
votes
1 answer

How to use spring mvc controllers without component-scanning?

I use Spring 3.x MVC @Controller annotations. My servlet.xml has this entry: My webapp, on Google's app engine has to initialize & startup within 60secs. Mine takes longer due to…
Ravi
  • 3,719
  • 6
  • 28
  • 40
0
votes
1 answer

After bean definition created from @Configuration

The problem: I have a bean (ConversionService) that needs a collection of Converters to be created. So within my @Configuration class I have a @Bean that is a Collection with a specific @Qualifier. For my ConversionService @Bean, I…
Francisco Spaeth
  • 23,493
  • 7
  • 67
  • 106
0
votes
1 answer

Understanding Spring mvc produces/consumes and Jackson

I am running a Spring MVC 3 maven app with embedded jetty with configuration below: org.mortbay.jetty maven-jetty-plugin 6.1.14
birdy
  • 9,286
  • 24
  • 107
  • 171
0
votes
1 answer

struts2 annotation spring managed beans

I'm using Spring to manage the struts 2 action beans. I am trying to migrate from XML based configuration to annotation based. I am using the struts2-spring-plugin so that struts gets the handle to the object managed by spring. The following is in…
blaks
  • 113
  • 3
  • 14
0
votes
1 answer

How to skip an annotation call based on a flag in the same class

I have couple of annotations on a getter as below. I would like to skip all the annotations call on the getter based on a boolean in the same class. Is there any way to do it? @MyAnnotation1(message = "{someMessage1}") @MyAnnotation2(message =…
Superman9999
  • 815
  • 3
  • 16
  • 30
0
votes
2 answers

SpringMVC Annotation Validation - DataBinding data type

When using custom validation under this scenario: if(officer.getBadgeId() == 0){ errors.rejectValue("badgeId", "badgeId.required"); } if the POJO/Model officer has a datatype of int for the badgeId can a string be set as the error message…
devdar
  • 5,564
  • 28
  • 100
  • 153
0
votes
1 answer

GWT and Spring Annotations not working with External projects

I am working with GWT and a Spring server. I have an project that I am using for a number of projects that has Spring annotations (@Repository, @Service, @Component etc.) that work in other webapps and projects but when I integrate Spring with GWT…
Brian
  • 79
  • 12
0
votes
4 answers

Spring Controller

I am trying to follow the Spring tutorial, but keep receiving a 404 error. Below is my Controller class: @Controller @RequestMapping("/updatedescription.htm") public class UpdateDescriptionController { /** Logger for this class and subclasses…
Dan
  • 979
  • 1
  • 8
  • 29
0
votes
1 answer

Requestmapping annotation

Hi I am trying to use Requestmapping but it does not work, HelloController.java package com.project.springapp; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import…
user1608396
0
votes
2 answers

Spring Security annotation configuration regarding web.xml

I'm using annotation based configuration and so far worked without a web.xml. Now, according to documentation, I'll need to create a web.xml file and add these fields to it: springSecurityFilterChain
Martin Spa
  • 1,494
  • 1
  • 24
  • 44
0
votes
0 answers

Order of bean Creation in Spring

I have a controller package com.controller; @Controller public class MyController{ @Autowired private ISessionHolder holder; } In my config xml:
Srini
  • 420
  • 1
  • 5
  • 17
0
votes
1 answer

Spring MVC controller mapping -- @RequestMapping

I'm trying to understand Spring MVC annotations. I've looked at various tutorials, and I just want to make sure I understand. In this example, @RequestMapping("/welcome") am I correct in understanding that welcome is the page making the request…
user636859
0
votes
1 answer

How do I configure Spring security to work on Virgo - using annotations?

I am having a problem configuring my web-app to use Spring security on Virgo Tomcat Server. I am using annotation based configuration - and would like to maintain using Annotations if possible. Below show the logs containing the error…
dasbouse
  • 61
  • 2
  • 6
0
votes
1 answer

Annotation based user retrieval Spring security

I was looking for proper way how to recieve active/logged in user. I use Spring Security 3.1 with the same version of Spring MVC. The whole idea is based on this topic which was more commented in the article : @ActiveUser annotation from the…
Marek Surek
  • 23
  • 1
  • 6