spring-mvc Questions
2
Solved
There is an application on Spring Web stack. I faced an unusal problem after the upgrading to the lastest Spring Boot 2.6.1.
The following code
@RestController
@RequestMapping("sample")
c...
Saddlebow asked 8/12, 2021 at 6:48
6
Solved
Having the following code:
@RequestMapping(value = "/greeting", method = POST, consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public String greeting...
Ramulose asked 25/7, 2013 at 19:24
2
Solved
I am using @SessionAttributes in spring, but I don't know how to end the session, I tried the below code but I am getting error, Please give me some example.
Thanks.
@RequestMapping(value = "/...
Stillbirth asked 20/6, 2013 at 5:20
4
Solved
I'm trying out the new Spring Boot 1.4 MVC testing features. I have the following controller.
@Controller
public class ProductController {
private ProductService productService;
@Autowired
pu...
Middling asked 28/6, 2016 at 19:36
2
Solved
I have a Spring Boot 2 MVC application that returns async results. Notice that although I'm using Mono it is not a webflux app but webmvc, so the result will be treated as a Spring MVC async result...
Express asked 26/12, 2018 at 13:36
3
Solved
I am wondering is it good practice to write all forms in spring tags or can I mix spring form tags with html form tags?
Uniformitarian asked 22/2, 2011 at 13:39
7
Solved
I want to add this header "Access-Control-Allow-Origin", "*" to every response made to the client whenever a request has made for rest controllers in my application to allow cross origin resource s...
Unthinking asked 24/4, 2013 at 11:23
4
Solved
This has been asked once before but the solution did not solve the issue. I am creating a JUnit test:
@Test
@Transactional
@Modifying
public void updateMaterialInventory() throws Exception{
...
Wiley asked 19/7, 2015 at 15:58
7
Update:
Now looking back more than a year later, I am giving an update hope that will help someone else.
Spring IO recommend using CSRF protection for any request that could be processed by a bro...
Beverlybevers asked 10/2, 2016 at 12:17
3
Solved
In an REST API generated with JHipster, I want to throw some 404 exceptions. It is normally done with
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
which actualy results in a 404 resp...
Tuck asked 25/4, 2016 at 18:40
5
I am trying to implement Spring Condition org.springframework.context.annotation.Conditionas follows:
public class APIScanningDecisionMaker implements Condition {
@Override
public boolean match...
Karolkarola asked 25/9, 2015 at 20:24
2
Freemarker (by default) uses the locale to build the file names it looks for when loading and including templates. For example, loading tos.ftl (the template) with the en_US locale would look for:
...
Collbaith asked 29/3, 2016 at 21:45
5
Solved
I see a number of answers to this question previously but none of the solutions I have tried worked.
My login.css is not getting applied to login.html in my Spring Boot application. I am also usin...
Loo asked 6/4, 2017 at 22:44
2
Solved
I have a spring boot webapplication with a angular frontend. When i send a request using the angular app while the webapplication is still starting up it may occur that the webapplication can accep...
Revengeful asked 7/9, 2020 at 14:26
5
Solved
I have spent a few days looking and have been unable to find a solution, most example deal with spring boot and gradle, I am only using spring mvc and maven.
If I remove the springfox-swagger-ui d...
Dupree asked 27/4, 2015 at 13:50
3
Solved
I have a Joda-DateTime field in my model and want to display it formatted in a JSP view. I have annotated it with the new @DateTimeFormat annotation:
public class Customer {
private DateTime date...
Varlet asked 11/8, 2010 at 9:46
13
Solved
I'm using Spring MVC for a simple JSON API, with a @ResponseBody based approach like the following. (I already have a service layer producing JSON directly.)
@RequestMapping(value = "/matches/...
Humanly asked 26/4, 2013 at 9:16
2
Solved
I am trying to implement unit test for a Websocket in Springboot with JUnit.
I am following this link and it runs fine but gets null in the result, when i test my websocket with a browser it sends ...
Oxidation asked 13/7, 2020 at 6:24
2
Solved
I am using spring rest controller.
Here is the code.
@RequestParam(value = "status", required = false, defaultValue = StatusEnum.STATUS.toString())
If i use enum as a defaultValue i am getting ...
Holmic asked 19/7, 2012 at 5:37
2
Solved
The following annotations are included in the Spring Framework:
@GetMapping, @PostMapping, @PutMapping, @DeleteMapping and @PatchMapping for standard Spring MVC controller methods. However @HeadMap...
Eby asked 13/7, 2017 at 7:24
7
Solved
I'm using Sping MVC in my application and writing JUnit test cases for a DAO. When I run the test, I receive the error: java.lang.ClassNotFoundException: javax.servlet.ServletContext.
In the stac...
Nightgown asked 30/10, 2013 at 17:49
2
code is as below
QContinent continent = QContinent.continent;
JPAQuery query = new JPAQuery(entityManager);
query.from(continent).where(continent.name.eq("www"));
List<Object> fetch =...
Serrano asked 31/5, 2020 at 6:12
16
Solved
Is it necessary to wrap in a backing object? I want to do this:
@RequestMapping(value = "/Test", method = RequestMethod.POST)
@ResponseBody
public boolean getTest(@RequestBody String str1, @Reques...
Swine asked 15/10, 2012 at 10:17
4
Solved
I am new to Spring MVC - and I am trying to pass a date from my javascript as a request Param
My controller looks something like -
public @ResponseBody List<RecordDisplay> getRecords(
@Re...
Exerciser asked 8/2, 2013 at 6:18
0
Hello I'm trying to develop spring boot service. And I'm using WebMvcConfigurer class
to create custom argument resolver. But now I need security context so I implemented keycloak. But there is cir...
Analogy asked 29/11, 2021 at 21:52
© 2022 - 2024 — McMap. All rights reserved.