I am aware that Java EE 8 MVC is shiny and new and might not have everything I hoping there is a way to call a view from a controller on startup
@Path("home")
@Controller
public class HomeController {
@Inject
Models models;
@Inject
public UIAccess uiaccess;
@GET
@Path("index")
public String index() {
models.put("sidebar", uiaccess.sideBar());
return "home/index.xhtml";
}
}
Is there any way that the web.xml can be setup to call the view
<welcome-file-list>
<welcome-file>app/home/index.xhtml</welcome-file>
</welcome-file-list>
This does not work app/controller_name/view when place in the web.xml
I know servlet class can be called in startup but want about controllers.
I encountered same problem before, web.xml seems doesn't support for MVC path yet.
My opinion you may select 2 option below