Let FacesViews support MultiViews #20

BalusC opened this Issue Apr 17, 2014 · 1 comment


None yet

1 participant

BalusC commented Apr 17, 2014


It would be useful if FacesViews supported the following:

  • /foo/bar is requested
  • /foo/bar.xhtml doesn't exist, but /foo.xhtml does
  • instead of 404, forward to /foo.xhtml, preferably with "/bar" as request.getPathInfo()

This rather useful feature is in Apache HTTPD+PHP world known as "MultiViews".

BalusC commented Aug 14, 2016 edited

MultiViews support is added. It's basically a matter of suffixing the org.omnifaces.FACES_VIEWS_SCAN_PATHS value with /* like so


The path parameters are due to technical limitations unfortunately not available by request.getPathInfo() (as JSF itself internally uses it). But @Param has been enhanced to support injecting path parameters via new @Param(pathIndex) attribute.

Given an URL of http://example.com/context/foo/bar/baz on which neither /foo/bar/baz.xhtml nor /foo/bar.xhtml exist but /foo.xhtml does exist will forward to /foo.xhtml and path parameters are injectable in associated managed bean as below

@Inject @Param(pathIndex=0)
private String bar;

@Inject @Param(pathIndex=1)
private String baz;

@Param built-in conversion/validation is also supported on them.

@BalusC BalusC closed this Aug 14, 2016
@BalusC BalusC added a commit that referenced this issue Aug 14, 2016
@BalusC BalusC #20 fix javadoc error 5e2f04b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment