[
https://issues.apache.org/jira/browse/MYFACES-2944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924667#action_12924667
]
Jakob Korherr commented on MYFACES-2944:
----------------------------------------
Talking to Leonardo we agreed that we won't revert the current solution, but
build upon it.
Explanation of the current solution:
The geronimo team can provide the web.xml contents, so MyFaces does not have to
parse the file itself. Talking to Ivan we agreed that an additional SPI -
WebXmlProvider - is the best and cleanest solution for this problem. However
there are some problems with making this an SPI:
1) WebXml is on shared and not directly in myfaces impl
2) WebXml provides a static method to get the current instance
Thus I came to the conclusion that the best way to do this is to put all the
SPI classes for WebXml on shared, so that WebXml.getWebXml() and
WebXml.update() can use the SPI to get the right instance and we do not have to
deprecate (or remove) the methods of WebXml.
The decision about which methods should be kept on WebXml and which should be
moved to WebXmlImpl was easy: Those which are needed in the code or by
subclasses of WebXml are on WebXml and those which are just used to add content
to it (like when parsing the file by the WebXmlParser) are moved to WebXmlImpl.
In this way the service provider can implement the content-adding himself while
not having to implement the methods only used by the SPI itself (like e.g.
isOld() which provides the standard algorithm).
Also two new methods were added (isFacesServlet() and
isFacesExtensionsFilter()), because of a request from the Geronimo team.
The advantage of the current solution is that the WebXml implementation and the
WebXml parsing can easily be changed via the new SPI. Furthermore WebXml's
methods were not changed and thus no changes were needed in the code that uses
WebXml, even though getWebXml() now uses the SPI approach. The disadvantage of
the current solution is that all SPI classes are on shared and thus not
directly available in the spi package (but in shared_impl.spi).
Actually I really wanted to put the SPI classes directly into the spi package
on impl, but as it turns out this isn't really possible, because of the fact
that all the WebXml stuff is on shared and also because WebXml provides a
static method which returns the current instance: getWebXml(). There is no way
to support the current synthax and behavior of WebXml with an SPI that is
entirely located in impl. However it would be possible if getWebXml() would be
removed from the WebXml class, but this could mean a lot of changes is all
shared-based projects (like e.g. tomahawk).
Suggestions for improvements are welcome!
> 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.