I'm having trouble with getRequest. When I click the button, the ajax is able to fetch the data from the controller, It displays "success" in the console along with the list of Book objects. But my DIV and UL inside it is not populated. What do I do ?
Upload a video using spring security, auth with JWT, and RESTFul API for consume from the vuejs frontend, login page, register (user management), please master ;)
please help.. when i try run this project.... it is trying to create the bean .......trying to access the application.properties file and throwing the following error Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class
Hello, I tried to run the code from your GitHub, and I get a 500 bad request error when I try to post/get the books. I didn't make any changes to the code. Could you give me any solution?
Awesome..... I used your code. But, after starting the server . when I am hitting localhost:8080/home ,the home page is not coming out. Only Whitelevel Error page is showing. What's the reason for this issue? Could you please let me know?
Hi Prashant , Thanks for sharing the video. I am getting below error when I am trying to use your code in RestController : The constructor ServiceResponse(String, Book) is undefined. Can you help please . Waiting for your prompt reply.
Make sure to mention same http method in both client and server . Also inspect your browser and verify whethe initialr put call is happening from client or not
Hi, great tutorial learned a lot. However, no matter what I try (and I am new to all this) I cannot get around the HTTP 400 Bad Request, specifically " Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986". Doing some research online, more than a few Stack Overflow discussions on the error seem to point to newer versions of Tomcat not permitting certain characters in the HTTP request, such as {},[], and | characters. One solution suggested adding -Dtomcat.util.http.parser.HttpParser.requestTargetAllow=|{} to the VM start up, or adding it to Tomcat properties, but the first option didn't work, and wouldn't know how to set Tomcat properties for an embedded Tomcat server in a Spring eclipse project (don't see the files an external Tomcat would expose). Also, supposedly requestTargetAllow was deprecated apparently in the lastest versions. So not sure what to do at this point. Any suggestions??
@@Javatechie Hi, I just sent a reply, hopefully you received it with the github link. But just in case github.com/rlongo-dev/demo I tried to copy your code exactly as you presented it, but there are a few changes i made after several errors. First, I kept getting errors that the server expected the controller for "saveBook" to be an HTTP GET request, which confused me. No matter what I tried, it seemed it would not accept a post, so I set the mapping to @GetMapping in class BookController, then changed the postrequest.js to use a Get. That got rid of the issue with expecting a GET. But then I got the HTTP 400 Bad Request, specifically " Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986" when it attempted the GET. I am not very familiar with Tomcat, but the stack overflow answers were claiming the {} brackets were unacceptable for Tomcat 8 and later?
@@Javatechie Can you provide an example for this? I have created a dynamic form and it can be multiple rows and the data will be pass via ajax call. My data is looks like Ex: {name:["A", "B"], age:["23","21"]}
Please add below snippet of code in your spring boot config or main class @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE").allowedOrigins("*") .allowedHeaders("*"); } }; }