I’m trying getting files from FTP server on Java spring mvc project. I’m study on windows but my tomcat server is in linux machine. Following code returns base64 encoding files and created base64 url for front end side and this files temporarily held. This code works fine windows but works bad on linux machine. Getting pdf files are issueless in
Tag: spring-mvc
ServletContext not able to inject through by passing it as an parameter in Spring MVC
Hi all i am trying to get ServletContext in my following method but it is not getting injected while passing it as an parameter as it should be injected by the spring automatically but its not working don’t know why this is the following code inside which I want servletcontext but when I tried using the autowiring by declaring ServletContext
Spring Security roles issue
I overrode the method in the SpringWebConfig and I want to give all pages of application only for admins. When I try to open page http://localhost:8080/api/v1/skills/ without any authorization I have a correct result instead of 403. Maybe I’m wrong with my config? Full project https://github.com/Wismut/crud_developers Answer Add the following class inside config package
How to create a single instance of object across entire Spring MVC web application?
I have a Spring MVC web application (XML based without annotations). I want to create only one instance of statsDClient object on start of my application and use it across my whole application. I am trying something like below: Later in my controllers I am getting the statsDClient object in the following way: But, this seems to be creating creating
I want to send a List(which is a member of an object) from Postman to Spring REST API
I have an object, and of its attributes is a List. I want to send this object from Postman to my service. I’m using Spring 5.2.7 (Spring MVC, not SpringBoot) and Hibernate 5.4.17 and Java 8. My problem is very similar to this one: I want to send a Postman POST request with an Array: members: [“william”, “eric”, “ryan”] This
How to return CREATED status (201 HTTP) in ResponseEntity
There is a Spring-MVC application. In controllers, when returning the results of methods, I return via ResponseEntity<>. On success, I return (200 statutes) the OK-method. But when creating something, I would like to return the CREATED-method (201 status). I just can’t understand what kind of URL to ask in parentheses when calling through CREATED. How can this be implemented? Now
SpringMVC, why ‘@RequestBody String body’ stops working after adding MappingJackson2HttpMessageConverter
need some help with jackson2 and springMvc. Issue: when adding MappingJackson2HttpMessageConverter jsons fail to parse (previously they did parse) with error below. I have following @Controller method in code: And it have been working just fine until I’ve decided to add MappingJackson2HttpMessageConverter() into converters. Like this: but after I do so, my requests stop to work with the following error
HTTP Status 404 – Not Found: for controller – no view resolvers found in Idea
I have the following Spring MVC code: config files: contollers: I get the following errors when I deploy: Accessing the /api page, however, works just fine. EDIT: After replacing home.html with home, the error is still present – both in IDE and the 404 in browser: Also maybe it’s relevant – I get this pop up at one of the
Cannot pass JWT refresh token as an argument
I’m trying to get a new access token using a refresh token in Spring Boot with OAuth2. It should be done as following: POST: url/oauth/token?grant_type=refresh_token&refresh_token=…. It works fine if I’m using InMemoryTokenStore because the token is tiny and contains only digits/letters but right now I’m using a JWT token and as you probably know it has 3 different parts which
The increment size of the sequence is set to [50] in the entity mapping while the associated database sequence increment size is [1]
I’m following the Learn Spring 5 etc on udemy and I’m at the part where we test our application. Everything worked fine till now, i was able to connect to the postgreSQL database and all but now I’m stuck at this test failing since 2 days. I don’t understand what is causing the Test to fail. The application run but