Unable to compile class for JSP

From the error it seems that you are trying to import something which is not a class. If your MyFunctions is a class, you should import it like this: If it is a package and you want to import everything in the package you should do like this: Edit: There are two cases which will give you … Read more

What is the difference between response.sendRedirect() and request.getRequestDispatcher().forward(request,response)

To simply explain the difference, doesn’t prepend the contextpath (refers to the application/module in which the servlet is bundled) but, whereas will prepend the contextpath of the respective application Furthermore, Redirect request is used to redirect to resources to different servers or domains. This transfer of control task is delegated to the browser by the container. That … Read more

What does request.getParameter return?

// index.jsp In backend.jsp what does request.getParameter(“one”); return? request.getParameter(“one”).getClass().getName(); returns java.lang.String, so it must be a String right? However I cannot do or This is obvious, because variable one does not return null. Is only way to go, or are there better solutions or a better approach? I am considering both solutions to be on … Read more

getting error HTTP Status 405 – HTTP method GET is not supported by this URL but not used `get` ever?

The problem is that you mapped your servlet to /register.html and it expects POST method, because you implemented only doPost() method. So when you open register.html page, it will not open html page with the form but servlet that handles the form data. Alternatively when you submit POST form to non-existing URL, web container will … Read more

Spring Boot – Unable to resolve Whitelabel Error Page

Please define method in your controller: You may define @RequestMapping(value = “/”, method = RequestMethod.GET) or you may directly use @GetMapping there might be some more conflicts in your pom, like no need add tomcat dependency as its already embedded so below can be removed. To enable support for JSP’s, add a dependency on tomcat-embed-jasper. and after … Read more