Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Component/s: Sample Apps
-
Labels:None
-
Environment:ICEfaces
Description
There is a hard-code reference to the "component-showcase" context in the StyleBean.changeStyle() method:
FacesContext.getCurrentInstance().getExternalContext().redirect("/component-showcase/index.jsp");
This means that if the app is deployed to a different context, changing styles will cause an exception.
FacesContext.getCurrentInstance().getExternalContext().redirect("/component-showcase/index.jsp");
This means that if the app is deployed to a different context, changing styles will cause an exception.
The solution is to programmatically get the application context and use that instead:
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
ec.redirect(ec.getRequestContextPath() + "/index.jsp");