You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Ali Ok (JIRA)" <de...@myfaces.apache.org> on 2010/02/05 11:00:28 UTC

[jira] Issue Comment Edited: (MYFACES-2504) Google App Engine Support

    [ https://issues.apache.org/jira/browse/MYFACES-2504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804170#action_12804170 ] 

Ali Ok edited comment on MYFACES-2504 at 2/5/10 9:59 AM:
---------------------------------------------------------

----IGNORE THIS Comment----

In order to run MyFaces on Google App Engine with this patch, you must
1. Use Facelets.
2. Set org.apache.myfaces.config.annotation.LifecycleProvider context param to org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider. Since AllAnnotationLifecycleProvider and ResourceAnnotationLifecycleProvider providers need javax.naming.Context which is a restricted class on GAE, we must use NoInjectionAnnotationLifecycleProvider or NoAnnotationLifecyleProvider.

Reasons for code changes:
1. In Jsp21FacesInitializer.initContainerIntegration() method, I got AbstractMethodError. It seems like GAE container passes the JSP 2.1 test, but the JSP engine implementation fails to implement javax.servlet.jsp.JspFactory.getJspApplicationContext method. So, if server is detected as GAE, container is treated like JSP 2.0 (or less).
2. I got java.security.AccessControlException on method org.apache.myfaces.config.FacesConfigurator.getLastModifiedTime(). Google App Engine does not allow to get last modified time of a file and when an application is running on GAE there is no way to update faces config xml file. Thus, no need to check if the config file is modified.


Example configuration:
<context-param>
	<param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
	<param-value>org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider</param-value>
</context-param>


Please review it.
Since this is my first patch, I would appreciate your long explanations.


Edit: I changed my comment. 
Please see " 2504-doc.diff " for the configuration.

      was (Author: aliok-com-tr):
    In order to run MyFaces on Google App Engine with this patch, you must
1. Use Facelets.
2. Set org.apache.myfaces.IS_GOOGLE_APP_ENGINE context param to true in web.xml. MyFaces is initialized like JSP 2.0 (or less) if this is set, and some other controls are disabled.
1. Set org.apache.myfaces.config.annotation.LifecycleProvider context param to org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider. I didn't want to override this with org.apache.myfaces.IS_GOOGLE_APP_ENGINE param. Since AllAnnotationLifecycleProvider and ResourceAnnotationLifecycleProvider providers need javax.naming.Context which is a restricted class on GAE, we must use NoInjectionAnnotationLifecycleProvider or NoAnnotationLifecyleProvider.

Reasons for code changes:
1. In Jsp21FacesInitializer.initContainerIntegration() method, I got AbstractMethodError. It seems like GAE container passes the JSP 2.1 test, but the JSP engine implementation fails to implement javax.servlet.jsp.JspFactory.getJspApplicationContext method. So, if the new org.apache.myfaces.IS_GOOGLE_APP_ENGINE context param is set to true, container is treated like JSP 2.0 (or less).
2. I got java.security.AccessControlException on method org.apache.myfaces.config.FacesConfigurator.getLastModifiedTime(). Google App Engine does not allow to get last modified time of a file and when an application is running on GAE there is no way to update faces config xml file. Thus, no need to check if the config file is modified.


Example configuration:
<context-param>
	<param-name>org.apache.myfaces.IS_GOOGLE_APP_ENGINE</param-name>
	<param-value>true</param-value>
</context-param>
<context-param>
	<param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
	<param-value>org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider</param-value>
</context-param>


Please review it.
Since this is my first patch, I would appreciate your long explanations.
  
> Google App Engine Support
> -------------------------
>
>                 Key: MYFACES-2504
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2504
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-252, JSR-314
>    Affects Versions: 1.2.8, 2.0.0-alpha
>         Environment: Google App Engine 1.3
>            Reporter: Ali Ok
>            Priority: Minor
>         Attachments: 2504-4.diff, 2504-doc.diff
>
>
> Support for Google App Engine for MyFaces 1.2 and 2.0.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.