spring-mvc

Adding a custom filter to be invoked after spring-security filter in a Servlet 3+ environment

落花浮王杯 提交于 2020-01-14 10:07:52
问题 I'm using Spring-Security 3.2.4 and Spring Boot 1.1.0 (and it's related dependencies versions 4.X). I'm writing a web application that will be run in an embedded tomcat. I'm trying to add two additional filters(not related to Spring security) that one of them will be invoked before the Spring-Security-FilterChainProxy and the other one will be invoked after the Spring-Security-FilterChainProxy. My Spring-Security configuration files: @Configuration @EnableWebMvcSecurity public class

Adding a custom filter to be invoked after spring-security filter in a Servlet 3+ environment

血红的双手。 提交于 2020-01-14 10:07:39
问题 I'm using Spring-Security 3.2.4 and Spring Boot 1.1.0 (and it's related dependencies versions 4.X). I'm writing a web application that will be run in an embedded tomcat. I'm trying to add two additional filters(not related to Spring security) that one of them will be invoked before the Spring-Security-FilterChainProxy and the other one will be invoked after the Spring-Security-FilterChainProxy. My Spring-Security configuration files: @Configuration @EnableWebMvcSecurity public class

Adding a custom filter to be invoked after spring-security filter in a Servlet 3+ environment

蹲街弑〆低调 提交于 2020-01-14 10:06:09
问题 I'm using Spring-Security 3.2.4 and Spring Boot 1.1.0 (and it's related dependencies versions 4.X). I'm writing a web application that will be run in an embedded tomcat. I'm trying to add two additional filters(not related to Spring security) that one of them will be invoked before the Spring-Security-FilterChainProxy and the other one will be invoked after the Spring-Security-FilterChainProxy. My Spring-Security configuration files: @Configuration @EnableWebMvcSecurity public class

Spring service and repository layer convention

霸气de小男生 提交于 2020-01-14 09:38:07
问题 I start working with Spring and have some confusions about its conventions. Is it fine to put Repositories in Controller? In a Service class, If I want to reuse code could I inject other Services and other Reposities ? is it the best practice to name Service And Repository class is based on Entity name i.e: User -> UserRepository -> UserService ? 回答1: No, don't use Repositories in the Controller. Only in the Services. And don't use Entities in your Controller. Create Dto (Data Transfer

Returning JSONObject from spring controller gives 406 error

℡╲_俬逩灬. 提交于 2020-01-14 09:07:12
问题 My Spring Controller of Spring JSON application returns a JSONObject. On accessing the url, i am getting 406 error page. It works when i return String or ArrayList. Spring Controller: package com.mkyong.common.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util

Using Spring loaded in spring mvc framework

China☆狼群 提交于 2020-01-14 09:07:08
问题 I am having some issues using spring loaded with spring mvc. I added the spring loaded jar as a java agent on the server. Now when I added new methods for instance in my case I added a new method testHomes(), and it gives me with this dialog. Below is my config I also checked Build Automatically I am using spring framework 4.2.5.RELEASE. I checked from the following link SpringLoaded Unlike 'hot code replace' which only allows simple changes once a JVM is running (e.g. changes to method

Using Spring loaded in spring mvc framework

帅比萌擦擦* 提交于 2020-01-14 09:05:36
问题 I am having some issues using spring loaded with spring mvc. I added the spring loaded jar as a java agent on the server. Now when I added new methods for instance in my case I added a new method testHomes(), and it gives me with this dialog. Below is my config I also checked Build Automatically I am using spring framework 4.2.5.RELEASE. I checked from the following link SpringLoaded Unlike 'hot code replace' which only allows simple changes once a JVM is running (e.g. changes to method

Hard-coded @RequestMapping URL in Spring MVC Controller

巧了我就是萌 提交于 2020-01-14 08:43:26
问题 I'm studying Spring 3 and I'm using it in a simple web-application. Now I'm implementing a Spring MVC Controller using annotations, and I'm wondering: Is there any best practice using @RequestMapping annotation? I mean: I've seen that usually the URL mapped in this annotation is hardcoded in the class... Is there a way to pass the URL in a 'loosely coupled way' (to obtain a more reusable class)? I know that there are some wild cards that can be used, but I think that isn't the solution... Am

Deploy Spring Boot to Wildfly 10

ぃ、小莉子 提交于 2020-01-14 08:29:08
问题 Has anyone try to deploy an springboot application to wildfly 10 succesfully? i have look for examples but i only found for wildfly 8.2 This is my application class: @SpringBootApplication @EnableEurekaServer @EnableDiscoveryClient public class ServereurekaApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(ServereurekaApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder

Jsp page gives me a List, but my class want a Set

…衆ロ難τιáo~ 提交于 2020-01-14 05:38:06
问题 I have a class called Menu, with a field called voceMenuList, that contains the menu items like "Home", "contact" etc. public class Menu implements Serializable{ private Set<VoceMenu> voceMenuList; public void setVoceMenuList(Set<VoceMenu> voceMenuList) { this.voceMenuList = voceMenuList;} public Set<VoceMenu> getVoceMenuList() { return voceMenuList;} } This is my jsp page, where I print in a input-text the fields of the object VoceMenu, in order to edit the value <c:forEach items="${menu