You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2011/05/24 02:46:47 UTC

[jira] [Commented] (MYFACES-3078) performance: allow to disable JSP support

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

Leonardo Uribe commented on MYFACES-3078:
-----------------------------------------

The patch still needs some work. I tried with jetty and this configuration:

  <context-param>
    <param-name>org.apache.myfaces.SUPPORT_JSP</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
  </context-param>

and the following exception is thrown:

javax.faces.FacesException: java.lang.IllegalStateException: unknown scope defined: null
	at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
	at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:258)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Caused by: java.lang.IllegalStateException: unknown scope defined: null
	at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:75)
	at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:116)
	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
	at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:86)
	at com.sun.el.parser.AstValue.getValue(AstValue.java:127)
	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206)
	at org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:85)
	at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:243)
	at javax.faces.component.UIOutput.getValue(UIOutput.java:71)
	at javax.faces.component.UIInput.getValue(UIInput.java:142)
	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getValue(RendererUtils.java:343)
	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:291)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderInputBegin(HtmlTextRendererBase.java:169)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:158)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:75)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:540)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:316)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:151)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:628)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:624)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:624)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:624)
	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1329)
	at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:264)
	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)

In theory the code on ApplicationImpl is not necessary, because Jsp21FacesInitializer.configureResolverForJSP and initContainerIntegration are skipped.

This optimization needs to be checked more carefully. I'll revert the "patch available" state to "unresolved", to indicate the patch is not complete and can't be applied as is in the code. Anyway, I attached another up to date patch, disabling jsp vdl too.

I don't like the part that just skip initContainerIntegration. The right thing to do is create another initializer and change the code on org.apache.myfaces.webapp.FacesInitializerFactory, to use it if jsp support is disabled. Inside that initContainerIntegration, do the ExpressionFactory stuff.

> performance: allow to disable JSP support
> -----------------------------------------
>
>                 Key: MYFACES-3078
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3078
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: General
>    Affects Versions: 2.0.5-SNAPSHOT, 2.1.0-SNAPSHOT
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3078-core-2.patch, MYFACES-3078-shared-2.patch, MYFACES-3078.patch
>
>
> Since JSF 2.0 JSP are deprecated. Allow:
> o.a.m.SUPPORT_JSP=false|true
> if this flag is false myfaces will not install FacesCompositeELResolver
> and will skip JSP initializer during startup
> see full discussion here:
> http://www.mail-archive.com/dev@myfaces.apache.org/msg49177.html

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira