dev@javaserverfaces.java.net

RestoreViewPhase modifies viewId and breaks backward compatibility

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 03 Aug 2006 19:16:18 -0700

Previously in JSF (version included w/ the FCS release of GlassFish / AS
9) the behavior of the RestoreViewPhase.execute() method was to pass an
*unmodified* version of the viewId to the ViewHandler.restoreView() or
createView() method. This now passes a modified viewId. In the case of
an extension mapping such as ".jsf", it will replace ".jsf" with ".jsp"
(or whatever the "DEFAULT_SUFFIX" is defined to be).

First, this breaks backward compatibility. I have a view handler that
used the viewId to locate the file. It did not enforce any particular
extension such as ".jsp". When the code runs under the new behavior it
no longer works.

2nd, this limits an application to a single extension for writing JSF
pages. So... if I use .jsf then .jsp files will no longer be found and
vice-versa. My users will no longer be able to use multiple extensions
and Servlet mappings.

I notice that the intent seems to be to define a "DEFAULT" suffix.
However, the implemention (and the way the spec seems to be written) do
not provide a way to allow for more than 1 suffix per application. I
doubt this was the intent of changing the behavior. Am I missing something?

IMO, the changing of the suffix should *only* happen in the
ViewHandler.renderView() method (as it used to). And if a configurable
default suffix is desired, the ViewHandler impl's should be responsible
for this and possibly means to obtain a modified viewId should be
provided for convenience.

Comments?

Ken