I am trying to create a spring boot app with jsf and gradle.
So far, during development everything was fine. When I wanted to run my App I just typed gradle bootRun, the app started and I was able to access it under 'localhost'.
Now I am at a point of time, where I want to deploy the app, therefore I run the command 'gradle clean distTar' which creates the tar file to deploy.
After running the generated script and accessing my app via Browser I just get an 404 with the message.
index.xhtml Not Found in ExternalContext as a Resource
Also in the jar file, there aren't any html files included. I included them in the jar with the command
from ("${projectDir}/src/main/webapp/"){
into('resources')
}
Referring to https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot this files should be accessible. But still nothing changed.
Does anyone else have a clue? What am I doing wrong?
BR
I've been also struggling with this thing and finally managed to come up with a working solution.
As stated in: https://stackoverflow.com/a/9473487/4250114 if you use Servlet3.x (and you probably are with SpringBoot).
For me structure in maven looks like below worked:
src
|-main
| ...
|-resources
|-META-INF
|-faces-config.xml
|-resources
|-test.xhtml
So in jar it should be:
|-META-INF
|-faces-config.xml
|-resources
|-test.xhtml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With