I’m using Spring and Spring Boot framework with Spring Security for a simple login projects with simple UI. In all my projects, using STS, after starting my application and run the localhost address without errors, i receive a popup login window and not my html page. If i use user and default security password i always get a Whitelabel Error
Tag: spring-mvc
How to get user id with Spring MVC?
I using the POST method for add Item to the database with Spring MVC. But each Item has field userId, it FOREIGN KEY to users table. Need to know user’s id for this. I using Spring security for auth. May be there is a possibility get current user’s id with ServletContext or HttpSession, may be spring security save user’s id
Maven not found in Jenkins
I am running my Maven/Spring project in Jenkins (just testing it out, first time) using the shell script option with: mvn spring-boot:run I get the build error: /Users/Shared/Jenkins/tmp/jenkins8087926087546049217.sh: line 2: mvn: command not found How can I fix this? Its a Spring-boot app. It works fine when I run mvn spring-boot:run via command line. Answer Try this, Navigate to Manage
Spring Security UserDetailsService must be set Error
Just i dont understand, why customUserDetailsService doesn’t autowire There are 2 classes i use ================= And there is stackTrace Please explain me, how it’s possible. These classes have the same package, i included this package @ComponentScan annotation. And spring still complains that he cant find @Service Component. There is something easy, but i cant get it. Please help. Answer I
Clarify a situation with a cleaning Spring Prototype-beans from memory
I would like to understand whether I should clean prototype-beans from memory manually by myself. In the Spring documentation you can see: “The client code must clean up prototype-scoped objects and release expensive resources that the prototype bean(s) are holding.” So from this it seems that you should clean prototype-beans by yourself. However. I’m using VisualVM memory profiler. I have
How to set rate limit for each user in Spring Boot?
I am developing a Spring Boot Rest API which handles a lots of incoming request calls. My Controller is something like below: So now I wanted to set a ratelimit for each user. Say every user can only request 5 request per minute or something like that. How to set the rate limit for each user to make only 5
Could not exec java with Spring+Maven exit code 1
I am new to Spring/Maven, and am following this tutorial: Serving Web Content with Spring MVC. Everytime I run mvn spring-boot:run, I get this error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.2.RELEASE:run (default-cli) on project gs-serving-web-content: Could not exec java: Application finished with exit code: 1 -> I tried to add classpath, tried to run mvn install clean spring-boot:run, did a lot
Spring Security – 405 Request Method ‘POST’ Not Supported
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 and password: HTTP Status 405 – Request method ‘POST’ not supported Spring version: 4.0.2.RELEASED Security Configuration: Controller: Almost every topic
What causes “java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name ‘command’ available as request attribute”?
This is meant to be an extensive canonical question & answer post for these types of questions. I’m trying to write a Spring MVC web application where users can add movie names to an in-memory collection. It’s configured like so and There’s a single @Controller class in the com.example package WEB-INF/jsps/index.jsp contains The application is configured with context path /Example.
rest template returns 500 internal server error exception
I’m making an app and trying to get json written on the web page. So, I can see this page in browser: it contains only json. But when I start a request with the RestTemplate it returns ma only 500 internal server error. My caode is very simple: I cannot understand what is wrong: I have an access, it is