spring-mvc Questions

21

Solved

I have a spring boot app I got here: https://github.com/christophstrobl/spring-data-solr-showcase/tree/4b3bbf945b182855003d5ba63a60990972a9de72 It compiles and works fine with: mvn spring-boot:run...
Mongolism asked 8/10, 2015 at 17:58

3

I am using Spring Data JPA to manage a JPA entity and Spring Data Rest exports the repository into a REST API. I am also building a custom controller where I want to take the URI of the entity (HA...

5

Solved

I have several beans that implement the same interface. Each bean is annotated with @Component @Order(SORT_ORDER). public class MyClass implements BeanInterface{ ... } At one point I autowire...
Sutra asked 6/6, 2013 at 17:0

4

Solved

I'm a little bit confused about Filter and Interceptor purposes. As I understood from docs, Interceptor is run between requests. On the other hand Filter is run before rendering view, but after C...
Clump asked 7/3, 2016 at 23:51

2

I have a web application that should only be callable from specific IP addresses. Other than that, there is no need for authentication or for authorization; if you're coming from the right IP, you ...
Armond asked 14/11, 2017 at 15:54

4

@RequestMapping(value = "/getSettlements", method = RequestMethod.GET, headers = "Accept=application/json") public @ResponseBody Collection<Settlement> getSettlements (@RequestParam(value ...
Nightstick asked 17/7, 2013 at 7:12

4

Solved

I have following interceptor: public class SecurityInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Obj...
Vacuous asked 16/2, 2018 at 9:37

6

Solved

I have a Spring MVC application.It uses its own custom Login page. Upon successful login, a 'LOGGED_IN_USER' object is placed in the HTTPSession. I want to allow only authenticated users to access...
Aldine asked 11/9, 2012 at 14:14

8

Currently I'm setting autocommit to false in spring through adding a property to a datasource bean id like below : <property name="defaultAutoCommit" value="false" /> But i need to add i...
Calvities asked 8/8, 2014 at 7:7

4

Solved

There are already a few questions about the topic, but no response at all really provides arguments in order to explain why we shouldn't make a Spring MVC controller Transactional. See: Transacti...
Boon asked 16/4, 2014 at 19:46

4

i send a POST request of "application/json" type with 「postman」,set the param "phone" to empty string, normally it should print error for annotation "@NotEmpty", however, it didn't print anything a...
Disruptive asked 16/4, 2017 at 11:36

10

Solved

I'm trying to invoke a protected method from a class that implements the ApplicationListener<AuthenticationSuccessEvent> interface on successful login (Spring 3.2.2 and Spring Security 3.2.0 ...
Equator asked 19/3, 2013 at 13:13

8

When I run this application on built-in server or other tomcat server it gives me following error message. I am using jdk8, STS V-3.9.7. Can someone help me resolve it Simple Springboot applicati...
Rappel asked 10/1, 2019 at 6:0

5

Solved

I am learning spring security from reference material. release 3.1.2.RELEASE. As stated in that I have configured security:http tag like this security-context.xml <security:http auto-config="t...
Licko asked 25/8, 2012 at 16:3

7

Solved

When using Spring with Thymeleaf all my Cyrillic characters are shown as ????? on pages. Using @RequestMapping(value = "/login", method = RequestMethod.GET, produces = "text/html; charset=utf-8"...
Reo asked 4/4, 2016 at 7:52

1

Solved

I'm new at Spring and I'm reading one book "Pro Spring boot 2". It says here that Spring Web MVC has some blocking on each request, and Spring Webflux is a completely non-blocking stack. ...
Garratt asked 5/2, 2022 at 10:23

2

In a spring MVC app , by default all beans are singleton ,but what should be the standard scopes for below classes according to good programming practices: 1.DAO classes 2.Controller classes 3.DTO ...
Libertinage asked 4/2, 2022 at 22:48

0

The SSE using SseEmitter of SpringBoot 2.6.3 is working well, but when there is a timeout, the following error appears : org.apache.juli.logging.DirectJDKLog - : Changing async state from [STARTED]...
Particularly asked 4/2, 2022 at 10:56

7

Solved

According with the official example (Secure Web Content), I have to use a form and a button with the aim to perform a logout with Spring Security. Is there a way to use a link with Thymeleaf instea...
Deafening asked 21/3, 2014 at 11:39

2

I am facing below error while running junit for controller. I have already set content-type as Json, still error is same. Any suggestion what could be the issue ? Error is java.lang.AssertionError:...
Stoffel asked 31/3, 2021 at 6:27

3

Is it possible to create a method level @RequestMapping that is only mapped if a certain profile is active? I know it is possible to have the controller created only if a specific profile is activ...
Chug asked 2/10, 2017 at 20:48

7

Solved

I have implemented Spring Security to my project, but I am getting status 405 when I try to log in. I have already added csrf token in the form. This is the error I am getting when I send username...
Dilution asked 13/2, 2017 at 14:55

2

Solved

I have built a simple Spring Boot Rest Controller that does nothing but return a custom Java Object - Data. Everything compiles and runs normally. When I fetch from the endpoint, I get the data as ...
Cailean asked 3/11, 2021 at 3:43

3

Solved

I have controller as simple as this: @RequestMapping(value="/async/data", method=RequestMethod.GET, produces="application/json") @ApiOperation(value = "Gets data", not...
Strother asked 5/5, 2015 at 7:52

5

i hava aclass InitApp @Component public class InitApp implements ServletContextListener { @Autowired ConfigrationService weatherConfService; /** Creates a new instance of InitApp */ public InitA...
Roselane asked 15/7, 2013 at 13:58

© 2022 - 2024 — McMap. All rights reserved.