I try to build Spring Boot with JSP to jar packaging. I build project and it works fine when I run it with this commands
$ mvn package
$ java -jar target/mymodule-0.0.1-SNAPSHOT.jar
but when I go to target directory ($cd target) and try
$java -jar mymodule-0.0.1-SNAPSHOT.jar
the application runs fine but when I open browser and try to open the page I get error "There was an unexpected error (type=Not Found, status=404).
/WEB-INF/jsp/index.jsp"
I found this question, but when I try it I met the same problem
Is it possible with Spring Boot to serve up JSPs with a JAR packaging
My questions is Why it works when I try
$ java -jar target/mymodule-0.0.1-SNAPSHOT.jar
and doesn't work when I try
$cd target
$java -jar mymodule-0.0.1-SNAPSHOT.jar
How can I solve it?
EDIT
There is not WEB-INF directory into jar or target directory and when I put it there it doesn't help
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…