Questions tagged [spring-4]

Version 4.x of the Spring Framework

Use for general Spring related questions. This tag is for questions that are specific to versions 4.x only.

618 questions
0
votes
0 answers

Why @Autowired fails in constructor and not in instance variable in a WebMvcConfigurerAdapter subclass

I am working through Spring MVC and I have many Formatter classes, something like this @Component public class DeporteFormatter implements Formatter { ... @Autowired public DeporteFormatter(SomeDependency someDependency){ …
Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
0
votes
2 answers

Return json array in Spring 4 RESTful Web Service

I am writing an application using Spring and Rstful webservices. I want the JSOn in the format {companies : [{name:"companyName", industry : "companyIndustry"} , {name:"companyName", industry : "companyIndustry"}, ]} But when i fire the url am…
Abhi
  • 6,471
  • 6
  • 40
  • 57
0
votes
1 answer

no mapping found for /info Spring 4 websockets

In spring controllers if I use @MessageMapping it is working, but if I changed to @Requestmapping(value=="",method=RequestMethod.POST) and try to use SimpMessagingTemplate to send the messages to client then it is unable to connect, it is showing…
Sravan Kumar
  • 253
  • 1
  • 2
  • 8
0
votes
0 answers

Spring validator - bean values not reset

I have a JSP page that takes values from the user and shows it in next page (review page before saving). I have bean that has all the values mapped to the fields of the JSP. @Component @Scope("session") public class Campaign implements Serializable…
vvra
  • 2,832
  • 5
  • 38
  • 82
0
votes
1 answer

How do you declare and wire a prototype scoped bean using Spring 4 Java based contexts?

I'm a Spring 4 newb. So if I have a Singleton how do I wire beans of various scopes into it? I've seen no examples of this. Is it because it's been abstracted away so that all you have to do is apply @Scope("prototype")? That would explain the…
user447607
  • 5,149
  • 13
  • 33
  • 55
0
votes
1 answer

Spring.io and Tiles 3 - Error 404 when .war file is deployed in Tomcat server

I get error 404 when I deploy the generated .war file to stand alone Tomcat server, but if I deploy the war inside my IDE(IntelliJ) with tomcat server it works fine. This is the Initializer public void onStartup(ServletContext…
Andoy Abarquez
  • 1,119
  • 4
  • 17
  • 30
0
votes
1 answer

Spring 4 - Authentication with preAuthorize & PostAuthorize

NOTE: My application uses the latest version of the Spring framework, 4.0.6, 3.2.4 for security, and, it uses no xml but only Java-Config to configure the application. I have a set of services which I would like to secure with roles and other…
vvra
  • 2,832
  • 5
  • 38
  • 82
0
votes
2 answers

Spring 4 - load property file inside the jar>war

I could not load the db.properties located inside the jar (project.service.jar), which is referred by the war file (project-web.war). The output war has the jar inside WEB-INF/lib/project.service.jar. The services jar has the services and dao…
vvra
  • 2,832
  • 5
  • 38
  • 82
0
votes
1 answer

How to show time depend on timezone in java 8 and spring 4?

I'm working on site that is writing on java 8 and spring 4, we are using java 8 standard time api, now on pages always is shown server time (in user profile is shown date of his registration). With old java time api there was way use …
roman-v1
  • 728
  • 1
  • 9
  • 21
0
votes
0 answers

java.lang.IncompatibleClassChangeError with Struts2 and spring integration

i'm trying to integrate Spring 4.0.6 in a struts 2.3.1.2 application. This is the maven POM:
Medioman92
  • 581
  • 4
  • 10
  • 21
0
votes
0 answers

spring access security context in service

I am trying to access a SecurityContext object in a @Service that is triggered by an @Schedule configuration in a Spring 4 application. This is non-functional within a @Service but works fine for @Controller configurations. How do I load the same…
el n00b
  • 1,957
  • 7
  • 37
  • 64
0
votes
1 answer

How to get JQuery Manipulation and Spring 4 to play nice

I am creating a Spring Boot 4 application and I would like to include the JqueryUI notification widget found here. The problem arises because the example HTML looks like this...
Jackie
  • 21,969
  • 32
  • 147
  • 289
0
votes
1 answer

How to send a STOMP message with Spring4 when controller is mapped

I have the following code... @Controller @RequestMapping("/stomp/**") public class StompController { @MessageMapping("/hello") @SendTo("/topic/greet") public Greeting greet(HelloMessage message) throws Exception{ …
Jackie
  • 21,969
  • 32
  • 147
  • 289
0
votes
2 answers

Spring 4.0 missing validation errors

Not sure what am I doing wrong - but after I submit the person form without any value I am unable to see any validation error in the html output. When I add a breakpoint in the controller I am able to see the "errors" So it is going to…
JavaSheriff
  • 7,074
  • 20
  • 89
  • 159
0
votes
1 answer

No Session found for current thread (Spring 4.0.5.RELEASE and Hibernate 4.3.5.Final)

I've seen several similar questions, but none of the suggested solutions helped me. I am migrating my application from Spring 3.0.5.RELEASE to 4.3.5.Final, and Hibernate 3.6.0.Beta2 to 4.3.5.Final. Application has been working perfectly fine in…
BAhmed786
  • 51
  • 5