[jira] Commented: (MYFACES-2952) Improve Atmosphere Meteor support of MyFaces
[ https://issues.apache.org/jira/browse/MYFACES-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12928316#action_12928316 ] Leonardo Uribe commented on MYFACES-2952: - Just as a small comment and by historical purposes, the final name for this param is org.apache.myfaces.INITIALIZE_ALWAYS_STANDALONE, as corrected by Matthias Improve Atmosphere Meteor support of MyFaces Key: MYFACES-2952 URL: https://issues.apache.org/jira/browse/MYFACES-2952 Project: MyFaces Core Issue Type: Improvement Affects Versions: 2.0.3-SNAPSHOT Reporter: Matthias Weßendorf Assignee: Leonardo Uribe Fix For: 2.0.3-SNAPSHOT Currently MyFaces aborts the initialization when there is no configured FacesServlet. While this does make sense in almost all cases, there are options when we do want the framework to initialize in a proper way: Atmoshpere's Meteor framework to support comet/websocket -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
MYFACES-2952 - Improve Atmosphere Meteor support of MyFaces
Currently MyFaces stops initializing when there is no (My)FacesServlet configured in the (present) web.xml. I am sure this is in 99.99% of all cases right. However there is a chance that a wrapping framework will instantiate the (My)FacesServlet, inside a wrapping Servlet. An example of that is the WebSocket/Comet Framework Atmosphere. As mentioned in [1] a typical configuration looks like: servlet descriptionMeteorServlet/description servlet-nameMeteorServlet/servlet-name servlet-classorg.atmosphere.cpr.MeteorServlet/servlet-class init-param param-nameorg.atmosphere.servlet/param-name param-valuejavax.faces.webapp.FacesServlet/param-value /init-param init-param param-nameorg.atmosphere.useWebSocket/param-name param-valuetrue/param-value /init-param init-param param-nameorg.atmosphere.useNative/param-name param-valuetrue/param-value /init-param /servlet So in order to enable the AbstractFacesInitializer.java to see that it can continue the initialization work, I thought about adding the following to shared WebXml.java: Index: src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java === --- src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java (revision 1028633) +++ src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java (working copy) @@ -107,6 +107,11 @@ public abstract boolean isErrorPagePresent(); /** + * Determines, if the web.xml contains the Atmosphere Meteor Servlet + */ +public abstract boolean isAtmosphereMeteorServletPresent(); + +/** * Returns true if the given servlet class is a valid FacesServlet. * This is the FacesServlet itself or any DelegatedFacesServlet. * The AbstractFacesInitializer would be changed to something like: Index: impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java === --- impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java (revision 1028633) +++ impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java (working copy) @@ -79,6 +79,7 @@ * application. */ public void initFaces(ServletContext servletContext) { + try { if (log.isLoggable(Level.FINEST)) { log.finest(Initializing MyFaces); @@ -102,7 +103,9 @@ } return; -} else if (webXml.getFacesServletMappings().isEmpty()) { +} else if (webXml.getFacesServletMappings().isEmpty() !webXml.isAtmosphereMeteorServletPresent()) { +// IF the + // check if the FacesServlet has been added dynamically // in a Servlet 3.0 environment by MyFacesContainerInitializer Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE); What do you think? Noteof course - today we have Atmoshpere, tomorrow we may have different use cases to see if a different Servlet (and/or Filter) is present. Hence we could have something like instead: WebXml_API public abstract boolean containsServlet(String fullQualifiedClassName); /WebXml_API (we want String here, since (with Atmosphere) we can't compile against it (-(L)GPL))... but we can use the String-based name as a constant in our code) Oh yes... a similar change would be needed for the MyFacesContainerInitializer.java from our implee6 module. -Matthias [1] https://issues.apache.org/jira/browse/MYFACES-2952 -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
Re: MYFACES-2952 - Improve Atmosphere Meteor support of MyFaces
Or a ctx param : o.a.m.INIT_ALWAYS default = false sent from my Android phone On Oct 29, 2010 12:41 PM, Matthias Wessendorf mat...@apache.org wrote: Currently MyFaces stops initializing when there is no (My)FacesServlet configured in the (present) web.xml. I am sure this is in 99.99% of all cases right. However there is a chance that a wrapping framework will instantiate the (My)FacesServlet, inside a wrapping Servlet. An example of that is the WebSocket/Comet Framework Atmosphere. As mentioned in [1] a typical configuration looks like: servlet descriptionMeteorServlet/description servlet-nameMeteorServlet/servlet-name servlet-classorg.atmosphere.cpr.MeteorServlet/servlet-class init-param param-nameorg.atmosphere.servlet/param-name param-valuejavax.faces.webapp.FacesServlet/param-value /init-param init-param param-nameorg.atmosphere.useWebSocket/param-name param-valuetrue/param-value /init-param init-param param-nameorg.atmosphere.useNative/param-name param-valuetrue/param-value /init-param /servlet So in order to enable the AbstractFacesInitializer.java to see that it can continue the initialization work, I thought about adding the following to shared WebXml.java: Index: src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java === --- src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java (revision 1028633) +++ src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java (working copy) @@ -107,6 +107,11 @@ public abstract boolean isErrorPagePresent(); /** + * Determines, if the web.xml contains the Atmosphere Meteor Servlet + */ + public abstract boolean isAtmosphereMeteorServletPresent(); + + /** * Returns true if the given servlet class is a valid FacesServlet. * This is the FacesServlet itself or any DelegatedFacesServlet. * The AbstractFacesInitializer would be changed to something like: Index: impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java === --- impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java (revision 1028633) +++ impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java (working copy) @@ -79,6 +79,7 @@ * application. */ public void initFaces(ServletContext servletContext) { + try { if (log.isLoggable(Level.FINEST)) { log.finest(Initializing MyFaces); @@ -102,7 +103,9 @@ } return; - } else if (webXml.getFacesServletMappings().isEmpty()) { + } else if (webXml.getFacesServletMappings().isEmpty() !webXml.isAtmosphereMeteorServletPresent()) { + // IF the + // check if the FacesServlet has been added dynamically // in a Servlet 3.0 environment by MyFacesContainerInitializer Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE); What do you think? Noteof course - today we have Atmoshpere, tomorrow we may have different use cases to see if a different Servlet (and/or Filter) is present. Hence we could have something like instead: WebXml_API public abstract boolean containsServlet(String fullQualifiedClassName); /WebXml_API (we want String here, since (with Atmosphere) we can't compile against it (-(L)GPL))... but we can use the String-based name as a constant in our code) Oh yes... a similar change would be needed for the MyFacesContainerInitializer.java from our implee6 module. -Matthias [1] https://issues.apache.org/jira/browse/MYFACES-2952 -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
Re: MYFACES-2952 - Improve Atmosphere Meteor support of MyFaces
+1 for: Or a ctx param : o.a.m.INIT_ALWAYS. Nothing meteor-specific, I would say. best regards, Martin On 10/29/10, Matthias Wessendorf mat...@apache.org wrote: Or a ctx param : o.a.m.INIT_ALWAYS default = false sent from my Android phone On Oct 29, 2010 12:41 PM, Matthias Wessendorf mat...@apache.org wrote: Currently MyFaces stops initializing when there is no (My)FacesServlet configured in the (present) web.xml. I am sure this is in 99.99% of all cases right. However there is a chance that a wrapping framework will instantiate the (My)FacesServlet, inside a wrapping Servlet. An example of that is the WebSocket/Comet Framework Atmosphere. As mentioned in [1] a typical configuration looks like: servlet descriptionMeteorServlet/description servlet-nameMeteorServlet/servlet-name servlet-classorg.atmosphere.cpr.MeteorServlet/servlet-class init-param param-nameorg.atmosphere.servlet/param-name param-valuejavax.faces.webapp.FacesServlet/param-value /init-param init-param param-nameorg.atmosphere.useWebSocket/param-name param-valuetrue/param-value /init-param init-param param-nameorg.atmosphere.useNative/param-name param-valuetrue/param-value /init-param /servlet So in order to enable the AbstractFacesInitializer.java to see that it can continue the initialization work, I thought about adding the following to shared WebXml.java: Index: src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java === --- src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java (revision 1028633) +++ src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java (working copy) @@ -107,6 +107,11 @@ public abstract boolean isErrorPagePresent(); /** + * Determines, if the web.xml contains the Atmosphere Meteor Servlet + */ + public abstract boolean isAtmosphereMeteorServletPresent(); + + /** * Returns true if the given servlet class is a valid FacesServlet. * This is the FacesServlet itself or any DelegatedFacesServlet. * The AbstractFacesInitializer would be changed to something like: Index: impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java === --- impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java (revision 1028633) +++ impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java (working copy) @@ -79,6 +79,7 @@ * application. */ public void initFaces(ServletContext servletContext) { + try { if (log.isLoggable(Level.FINEST)) { log.finest(Initializing MyFaces); @@ -102,7 +103,9 @@ } return; - } else if (webXml.getFacesServletMappings().isEmpty()) { + } else if (webXml.getFacesServletMappings().isEmpty() !webXml.isAtmosphereMeteorServletPresent()) { + // IF the + // check if the FacesServlet has been added dynamically // in a Servlet 3.0 environment by MyFacesContainerInitializer Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE); What do you think? Noteof course - today we have Atmoshpere, tomorrow we may have different use cases to see if a different Servlet (and/or Filter) is present. Hence we could have something like instead: WebXml_API public abstract boolean containsServlet(String fullQualifiedClassName); /WebXml_API (we want String here, since (with Atmosphere) we can't compile against it (-(L)GPL))... but we can use the String-based name as a constant in our code) Oh yes... a similar change would be needed for the MyFacesContainerInitializer.java from our implee6 module. -Matthias [1] https://issues.apache.org/jira/browse/MYFACES-2952 -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
[jira] Resolved: (MYFACES-2952) Improve Atmosphere Meteor support of MyFaces
[ https://issues.apache.org/jira/browse/MYFACES-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leonardo Uribe resolved MYFACES-2952. - Resolution: Fixed Fix Version/s: 2.0.3-SNAPSHOT Assignee: Leonardo Uribe Added org.apache.myfaces.INITIALIZE_ALWAYS param as suggested on the list. Improve Atmosphere Meteor support of MyFaces Key: MYFACES-2952 URL: https://issues.apache.org/jira/browse/MYFACES-2952 Project: MyFaces Core Issue Type: Improvement Affects Versions: 2.0.3-SNAPSHOT Reporter: Matthias Weßendorf Assignee: Leonardo Uribe Fix For: 2.0.3-SNAPSHOT Currently MyFaces aborts the initialization when there is no configured FacesServlet. While this does make sense in almost all cases, there are options when we do want the framework to initialize in a proper way: Atmoshpere's Meteor framework to support comet/websocket -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (MYFACES-2952) Improve Atmosphere Meteor support of MyFaces
Improve Atmosphere Meteor support of MyFaces Key: MYFACES-2952 URL: https://issues.apache.org/jira/browse/MYFACES-2952 Project: MyFaces Core Issue Type: Improvement Affects Versions: 2.0.3-SNAPSHOT Reporter: Matthias Weßendorf Currently MyFaces aborts the initialization when there is no configured FacesServlet. While this does make sense in almost all cases, there are options when we do want the framework to initialize in a proper way: Atmoshpere's Meteor framework to support comet/websocket -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (MYFACES-2952) Improve Atmosphere Meteor support of MyFaces
[ https://issues.apache.org/jira/browse/MYFACES-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12923381#action_12923381 ] Matthias Weßendorf commented on MYFACES-2952: - A typical Meteor configuration would look like: servlet descriptionMeteorServlet/description servlet-nameMeteorServlet/servlet-name servlet-classorg.atmosphere.cpr.MeteorServlet/servlet-class init-param param-nameorg.atmosphere.servlet/param-name param-valuejavax.faces.webapp.FacesServlet/param-value /init-param init-param param-nameorg.atmosphere.useWebSocket/param-name param-valuetrue/param-value /init-param init-param param-nameorg.atmosphere.useNative/param-name param-valuetrue/param-value /init-param /servlet Inside the initFaces() method of the AbstractFacesInitializer we could stop aborting if the org.atmosphere.servlet of the org.atmosphere.cpr.MeteorServlet does point to the (My)FacesServlet(s). Improve Atmosphere Meteor support of MyFaces Key: MYFACES-2952 URL: https://issues.apache.org/jira/browse/MYFACES-2952 Project: MyFaces Core Issue Type: Improvement Affects Versions: 2.0.3-SNAPSHOT Reporter: Matthias Weßendorf Currently MyFaces aborts the initialization when there is no configured FacesServlet. While this does make sense in almost all cases, there are options when we do want the framework to initialize in a proper way: Atmoshpere's Meteor framework to support comet/websocket -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.