spring-mvc

How to disable csrf in Spring using application.properties?

爱⌒轻易说出口 提交于 2020-02-26 12:03:06
问题 The following property exists: security.enable-csrf=false BUT csrf protection is still on if I add the property to application.properties . What works is to disable it programatically. But I'd prefer properties configuration. Why could it not be working? @Configuration public class AuthConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth

How to disable csrf in Spring using application.properties?

坚强是说给别人听的谎言 提交于 2020-02-26 12:03:06
问题 The following property exists: security.enable-csrf=false BUT csrf protection is still on if I add the property to application.properties . What works is to disable it programatically. But I'd prefer properties configuration. Why could it not be working? @Configuration public class AuthConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth

How to disable csrf in Spring using application.properties?

匆匆过客 提交于 2020-02-26 12:02:32
问题 The following property exists: security.enable-csrf=false BUT csrf protection is still on if I add the property to application.properties . What works is to disable it programatically. But I'd prefer properties configuration. Why could it not be working? @Configuration public class AuthConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth

What is the difference b/w @RequestParam and @QueryParam Anotation

我与影子孤独终老i 提交于 2020-02-26 08:58:08
问题 What is main difference between @RequestParam and @QueryParam in Spring MVC controller? 回答1: Apart from these mentioned differences in framework, one major difference is @RequestParam will always expect a value to bind. Hence, if value is not passed, it will give error. This is not the case in @QueryParam To explicitly give the option, use required = false while using @RequestParam 回答2: @QueryParam is a JAX-RS framework annotation and @RequestParam is from Spring. 回答3: I'll try to shed some

What is the difference b/w @RequestParam and @QueryParam Anotation

自作多情 提交于 2020-02-26 08:57:06
问题 What is main difference between @RequestParam and @QueryParam in Spring MVC controller? 回答1: Apart from these mentioned differences in framework, one major difference is @RequestParam will always expect a value to bind. Hence, if value is not passed, it will give error. This is not the case in @QueryParam To explicitly give the option, use required = false while using @RequestParam 回答2: @QueryParam is a JAX-RS framework annotation and @RequestParam is from Spring. 回答3: I'll try to shed some

What is the difference b/w @RequestParam and @QueryParam Anotation

五迷三道 提交于 2020-02-26 08:57:04
问题 What is main difference between @RequestParam and @QueryParam in Spring MVC controller? 回答1: Apart from these mentioned differences in framework, one major difference is @RequestParam will always expect a value to bind. Hence, if value is not passed, it will give error. This is not the case in @QueryParam To explicitly give the option, use required = false while using @RequestParam 回答2: @QueryParam is a JAX-RS framework annotation and @RequestParam is from Spring. 回答3: I'll try to shed some

Unable to start Tomcat server with two SpringMVC webapps that are created from same maven archetype

旧城冷巷雨未停 提交于 2020-02-25 07:28:08
问题 I have created two Spring MVC applications using spring-mvc-quickstart-archetype (includes spring mvc, spring security, hibernate) , I could run each of this application seperately on tomcat but not able to together. when I add both the projects on to Tomcat, server will not comeup, I get Aug 30, 2013 8:14:48 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'appServlet' then the next line is error in red text as below and then server gets

Extract and Crete new JSON string

可紊 提交于 2020-02-25 05:20:30
问题 I have some spring MVC based APIs which produces JSON/ XML which represents API output. { "data" : { "users": [ { "id": "001", "name: "abc1", "type": { "id": "P", "name": "Permanent" } }, { "id": "002", "name: "xyz", "type": { "id": "C", "name": "Contractor" } } ] } } I'm passing a parameter with request as url?fields=users.id, users.type.id users.type.id is a sub-node in users node. users node is an array. Now, what I want to do is to filter those only properties and create the response

Boundary in Contenty-type is overwritten by FormHttpMessageConverter

拈花ヽ惹草 提交于 2020-02-24 22:22:48
问题 I'm using FormHttpMessageConverter in Spring Framework. For sending a file by restTemplate, I added FormHttpMessageConverter in my project. The problem is the server where takes the file asked string encrypted Content-type of me. I had to send the file with Content-type: multipart/form-data, but they asked "Content-type: multipart/form-data;" and " boundary:XXXX " . So I tried to make a value for boundary before send the file. However, the boundary value was overwritted when RestTemplate

Boundary in Contenty-type is overwritten by FormHttpMessageConverter

﹥>﹥吖頭↗ 提交于 2020-02-24 22:22:19
问题 I'm using FormHttpMessageConverter in Spring Framework. For sending a file by restTemplate, I added FormHttpMessageConverter in my project. The problem is the server where takes the file asked string encrypted Content-type of me. I had to send the file with Content-type: multipart/form-data, but they asked "Content-type: multipart/form-data;" and " boundary:XXXX " . So I tried to make a value for boundary before send the file. However, the boundary value was overwritted when RestTemplate