-
Notifications
You must be signed in to change notification settings - Fork 41.2k
when i use jsp,i cant find error.jsp #12802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry, but it's not clear to me what the problem is from a few snippets of code. Can you please describe what you want to be able to do? Once we understand that, we'll be able to tell if your approach is wrong or if your approach is correct and you've found a bug. |
when i use freemarker or thymeleaf, make a request to an HTTP server spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp i use this,can find WEB-INF/jsp/welcome.jsp new ModelAndView("/welcome"); but i use this or throw any RuntimeException ,i cont find WEB-INF/jsp/error.jsp new ModelAndView("error"); |
Both throwing a runtime exception and returning a |
This is my learn demo project linkspring boot learn - jsp project folder
-src
-main
-java
-resources
-webapp
-WEB-INF
-jsp
-error.jsp
-error2.jsp
-welcome.jsp code @GetMapping("/test/error")
public String error() {
//cant return error.jsp
throw new RuntimeException("one error");
}
@GetMapping("/to/error")
public ModelAndView toError() {
//find WEB-INF/jsp/error.jsp
//correct
//return new ModelAndView("/error");
//error
//return new ModelAndView("error");
//spring - BasicErrorController user new ModelAndView("error") cant find error.jsp
//find WEB-INF/jsp/error2.jsp
//correct
//return new ModelAndView("error2");
return new ModelAndView("/error2");
} so,i think BasicErrorController user new ModelAndView("error") error to find error.jsp |
Thanks, but that's not quite what I was looking for. I've been able to identify a problem, but I can't tell if it's the problem that you have as you haven't told me what steps to take to reproduce the problem you're seeing. Your sample still looks like an attempt to diagnose a problem rather than to simply reproduce it. I've opened #12805 for the problem that I've been able to identify. Hopefully this is the same problem as you're seeing. If it's not, please provide the necessary information in this issue and we can re-open it and investigate further. |
`pom.xml
my project

my aplication.properties
when i use
i cant find WEB-INF/jsp/error.jsp

when i use
i can find WEB-INF/jsp/error.jsp

in spring-boot source code
BasicErrorController
,it usei guess it is a problem
The text was updated successfully, but these errors were encountered: