[
https://issues.apache.org/jira/browse/MYFACES-2944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925258#action_12925258
]
Leonardo Uribe commented on MYFACES-2944:
-----------------------------------------
I investigated about why we need to provide a SPI interface to handle
information
retrieved by WebXml interface and this is the results:
- In MyFaces core 1.1.x, this is used to calculate faces mapping
(prefix/suffix)
and calculate the physical viewId (see 1.1.x JspViewHandlerImpl for details).
This happened on ViewHandler.renderView() and ViewHandler.getActionUrl()
- In JSF 1.2, the way to calculate faces mapping was specified:
see JSF 1.2 spec section 7.5.2. Since a web config param is used to pass
that
information (javax.faces.DEFAULT_SUFFIX), there is no reason to parse web.xml
file, but MyFaces keeps doing it because nobody notice it before, and that
code is used by tomahawk to check if ExtensionsFilter is correctly configured.
- In Myfaces Core 2.0, two new uses were added:
1. org.apache.myfaces.renderkit.ErrorPageWriter.handleThrowable(FacesContext,
Throwable) now requires check if an error page is configured and if so
just save the view so it can handle there.
2.
org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(ServletContext)
for check if there is a mapping configured and if it is not, do not
initialize
MyFaces
Now the reasons becomes clear. If the need to parse web.xml file is by the
previous
two points, it is clear we just need two methods to provide:
public abstract class WebConfig
{
public List<ServletMapping> getFacesServletMappings();
public boolean isErrorPagePresent();
}
We don't need to provide the methods used by tomahawk, because tomahawk will
never
be able to retrieve that information, remember that myfaces package for shared
is
org.apache.myfaces.shared_impl and tomahawk one is
org.apache.myfaces.shared_tomahawk,
so it is just not possible without introduce a compile dependency with
myfaces-impl
and that's just not viable.
All other methods are just implementation details, and should not be present on
the
interface to provide.
My proposal is the default implementation just call WebXml related methods, and
do not
use WebXml directly from ErrorPageWriter and AbstractFacesInitializer, instead
use
WebConfig interface. ServletMapping interface will be copied to
org.apache.myfaces.spi
package, because in that part we should prevent use shared interfaces (because
shared
is private for myfaces).
I'll propose a patch for this one soon.
> Make those add*** methods public in WebXml
> ------------------------------------------
>
> Key: MYFACES-2944
> URL: https://issues.apache.org/jira/browse/MYFACES-2944
> Project: MyFaces Core
> Issue Type: Improvement
> Components: General
> Affects Versions: 2.0.2
> Reporter: Ivan
> Assignee: Jakob Korherr
> Fix For: 2.0.3-SNAPSHOT
>
> Attachments: MYFACES-2944-core.patch, MYFACES-2944-shared.patch,
> MYFACES-2944.patch
>
>
> In the Geronimo integration work, we have an internal structure for the
> parsed web.xml file, and we hope to use that instance to fill in the
> org.apache.myfaces.shared.webapp.webxml.WebXml, so that myfaces does not need
> to parse the web.xml file again, But those add*** method are package scope.
> Is it possible to make those methods public, I did not see it will break
> anyting.
> Thanks
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.