MyFaces Core
  1. MyFaces Core
  2. MYFACES-1682

MyFaces 1.2 not work properly with value parameter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Tomcat 6.0.10
      MyFaces 1.2

      Description

      <%@ page import="javax.faces.context.FacesContext" %>
      <%@ page import="javax.faces.application.FacesMessage" %>
      <%@ taglib prefix="jsf" uri="http://java.sun.com/jsf/core" %>
      <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
      <%-<%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>-%>
      <%-<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j" %>-%>
      <%--
      Date: Mar 15, 2007
      Time: 4:46:53 PM
      --%>
      <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      <jsf:view>
      <%
      FacesContext.getCurrentInstance().addMessage(null,new FacesMessage("test"));
      %>
      <html>
      <head><title>Simple jsp page</title></head>
      <body>Place your content here
      <h:form>
      <h:messages/>
      <h:outputText value="#

      {s.valuetest}

      "/>
      </h:form>
      </body>
      </html>
      </jsf:view>

      libs in lib directory:
      commons-beanutils-1.7.0.jar
      commons-codec-1.3.jar
      commons-collections-3.2.jar
      commons-digester-1.8.jar
      commons-discovery-0.4.jar
      commons-el-1.0.jar
      commons-logging-1.1.jar
      jstl-1.2.jar
      myfaces-api-1.2.0.jar
      myfaces-impl-1.2.0.jar

      web.xml config:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>

      <context-param>
      <param-name>com.sun.faces.expressionFactory</param-name>
      <param-value>org.apache.el.ExpressionFactoryImpl</param-value>
      </context-param>

      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
      </web-app>

      and finally faces config:
      <?xml version='1.0' encoding='UTF-8'?>
      <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

      <faces-config>
      <managed-bean>
      <managed-bean-name>s</managed-bean-name>
      <managed-bean-class>test.Bean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
      </faces-config>

      if page contains simple message output all work fine!
      If any value in tag then i got this error:
      javax.servlet.ServletException: /test.jsp(21,7) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)

      root cause
      javax.faces.FacesException: /test.jsp(21,7) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
      org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:340)
      org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:254)
      org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

      root cause
      org.apache.jasper.JasperException: /test.jsp(21,7) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
      org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
      org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
      org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
      org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1172)
      org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:819)
      org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
      org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
      org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:838)
      org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
      org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
      org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:838)
      org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
      org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
      org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
      org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
      org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
      org.apache.jasper.compiler.Validator.validate(Validator.java:1737)
      org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:334)
      org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:254)
      org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)

      i'm try new installation og myfaces-1.2 and got another exception:
      SEVERE: Servlet.service() for servlet jsp threw exception
      org.apache.jasper.JasperException: Unable to convert string "Test" to class "javax.el.ValueExpression" for attribute "value": Property Editor not registered with the PropertyEditorManager
      at org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:887)
      at org.apache.jsp.test_jsp._jspx_meth_h_005foutputText_005f0(test_jsp.java:138)
      at org.apache.jsp.test_jsp._jspx_meth_f_005fview_005f0(test_jsp.java:102)
      at org.apache.jsp.test_jsp._jspService(test_jsp.java:65)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:334)
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:254)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
      at java.lang.Thread.run(Thread.java:595)

      So finally:
      if jsp page has value with EL expr i got: According to TLD or attribute directive in tag file, attribute value does not accept any expressions
      if wihout EL expr: org.apache.jasper.JasperException: Unable to convert string "Test" to class "javax.el.ValueExpression" for attribute "value": Property Editor not registered with the PropertyEditorManager

      1. myfaces_core.tld
        41 kB
        Andreas Gärtner
      2. h.tld
        187 kB
        Andreas Gärtner

        Activity

        Hide
        Vitaly Smyk added a comment -

        with SUN RI 1.2 all work good

        Show
        Vitaly Smyk added a comment - with SUN RI 1.2 all work good
        Hide
        Werner Punz added a comment - - edited

        I could reproduce it on a Tomcat 6.0.13 in JSP mode, with facelets which do not go into JSP everything works as expected.

        My personal guess, and this is a guess, is that the dependency into the jstl has anything to do with it in combination with other serveral sideffects.
        Facelets eliminates the jstl dependencies and jasper, so it is very likely that one of the two components do trigger this for whatever reason.

        Show
        Werner Punz added a comment - - edited I could reproduce it on a Tomcat 6.0.13 in JSP mode, with facelets which do not go into JSP everything works as expected. My personal guess, and this is a guess, is that the dependency into the jstl has anything to do with it in combination with other serveral sideffects. Facelets eliminates the jstl dependencies and jasper, so it is very likely that one of the two components do trigger this for whatever reason.
        Hide
        Werner Punz added a comment -

        added comment from Matthias from the mailinglist

        >so, I noticed the TLD thing on ([1]) in tomcat 6.0.13 with and without tomahawk.
        >Not in Jetty 6.1.2rc0 .

        Show
        Werner Punz added a comment - added comment from Matthias from the mailinglist >so, I noticed the TLD thing on ( [1] ) in tomcat 6.0.13 with and without tomahawk. >Not in Jetty 6.1.2rc0 .
        Hide
        Vitaly Smyk added a comment -

        Do you planing fix this bug in short period?
        It's very critical IMHO.

        Show
        Vitaly Smyk added a comment - Do you planing fix this bug in short period? It's very critical IMHO.
        Hide
        Jeroen Benckhuijsen added a comment -

        myfaces-impl.jar seems to contain to TLD files for the same taglib (HTML components): META-INF/h.tld and META-INF/myfaces-html.tld. Removing the latter seems to solve this problem, however afterwards f:loadBundle doesn't seem to work correctly as the basename attribute is interpreted as a ValueExpression (perhaps related?).

        Snippet of the compiled JSPX:

        org.apache.myfaces.taglib.core.LoadBundleTag _jspx_th_f_005floadBundle_005f1 = (org.apache.myfaces.taglib.core.LoadBundleTag) _005fjspx_005ftagPool_005ff_005floadBundle_005fvar_005fbasename_005fnobody.get(org.apache.myfaces.taglib.core.LoadBundleTag.class);
        _jspx_th_f_005floadBundle_005f1.setPageContext(_jspx_page_context);
        _jspx_th_f_005floadBundle_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fview_005f0);
        // /index.jspx(18,89) name = basename type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_f_005floadBundle_005f1.setBasename((javax.el.ValueExpression)org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(javax.el.ValueExpression.class, "basename", "nl.atosorigin.jsfadvanced.banking.VoResource"));
        // /index.jspx(18,89) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
        _jspx_th_f_005floadBundle_005f1.setVar("voBundle");

        Show
        Jeroen Benckhuijsen added a comment - myfaces-impl.jar seems to contain to TLD files for the same taglib (HTML components): META-INF/h.tld and META-INF/myfaces-html.tld. Removing the latter seems to solve this problem, however afterwards f:loadBundle doesn't seem to work correctly as the basename attribute is interpreted as a ValueExpression (perhaps related?). Snippet of the compiled JSPX: org.apache.myfaces.taglib.core.LoadBundleTag _jspx_th_f_005floadBundle_005f1 = (org.apache.myfaces.taglib.core.LoadBundleTag) _005fjspx_005ftagPool_005ff_005floadBundle_005fvar_005fbasename_005fnobody.get(org.apache.myfaces.taglib.core.LoadBundleTag.class); _jspx_th_f_005floadBundle_005f1.setPageContext(_jspx_page_context); _jspx_th_f_005floadBundle_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_005fview_005f0); // /index.jspx(18,89) name = basename type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_f_005floadBundle_005f1.setBasename((javax.el.ValueExpression)org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(javax.el.ValueExpression.class, "basename", "nl.atosorigin.jsfadvanced.banking.VoResource")); // /index.jspx(18,89) name = var type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_f_005floadBundle_005f1.setVar("voBundle");
        Hide
        Andreas Gärtner added a comment - - edited

        I ran into the exact same problem. My personal solution (since it seems to be a misbuild of the .tld-files):

        • a subversion check-out of MyFaces 1.2.1-snapshot
        • download of maven
        • building of Myfaces 1.2.1 with maven
        • using newly built SNAPSHOT.jars.

        It did solve the the first mentioned problem 'According to TLD or attribute directive in tag file, attribute value does not accept any expressions'. A f:loadBundle statement seems to work fine, too.
        Maybe the newly built .tlds could be backported to 1.2.0, but I haven't checked so far. Jeroen Benckhuijsen seems to be correct, as version 1.2.1 only builds h.tld and myfaces_core.tld.

        Show
        Andreas Gärtner added a comment - - edited I ran into the exact same problem. My personal solution (since it seems to be a misbuild of the .tld-files): a subversion check-out of MyFaces 1.2.1-snapshot download of maven building of Myfaces 1.2.1 with maven using newly built SNAPSHOT.jars. It did solve the the first mentioned problem 'According to TLD or attribute directive in tag file, attribute value does not accept any expressions'. A f:loadBundle statement seems to work fine, too. Maybe the newly built .tlds could be backported to 1.2.0, but I haven't checked so far. Jeroen Benckhuijsen seems to be correct, as version 1.2.1 only builds h.tld and myfaces_core.tld.
        Hide
        Andreas Gärtner added a comment - - edited

        If anyone wants to try those with 1.2.0, above linked files are the .tld built from the 1.2.1 snapshot.

        Show
        Andreas Gärtner added a comment - - edited If anyone wants to try those with 1.2.0, above linked files are the .tld built from the 1.2.1 snapshot.
        Hide
        Fabrício Luis added a comment -

        I use NetBeans 6.0M10 with Tomcat 6.0.14 and MyFaces 1.2.
        In Code Editor, highlight an red error without run application and
        several "Unfinished Tag".

        Show
        Fabrício Luis added a comment - I use NetBeans 6.0M10 with Tomcat 6.0.14 and MyFaces 1.2. In Code Editor, highlight an red error without run application and several "Unfinished Tag".
        Hide
        Michael Abele added a comment -

        I've put the 1.2.2 tld files into myfaces-impl-1.2.0.jar. Then my login-Testpage reportet some "javax.el.ELException: Not a Valid Method Expression:
        " Exceptions for value and action attributes without a value (e.g. value=""; this works with MyFaces 1.1.5). But after removing those empty attributes I do not get the "According to TLD or attribute directive in tag file, attribute value does not accept any expressions" error any more and my application seems to work fine.

        Show
        Michael Abele added a comment - I've put the 1.2.2 tld files into myfaces-impl-1.2.0.jar. Then my login-Testpage reportet some "javax.el.ELException: Not a Valid Method Expression: " Exceptions for value and action attributes without a value (e.g. value=""; this works with MyFaces 1.1.5). But after removing those empty attributes I do not get the "According to TLD or attribute directive in tag file, attribute value does not accept any expressions" error any more and my application seems to work fine.
        Hide
        Bruno Aranda added a comment -

        So, as far as I understand, this is not an issue for myfaces-1.2.1-SNAPSHOT anymore?

        Show
        Bruno Aranda added a comment - So, as far as I understand, this is not an issue for myfaces-1.2.1-SNAPSHOT anymore?
        Hide
        Sidney Leal added a comment -

        I had the same problem and replaced the tld's with the linked files, and also deleted the myfaces_html.tld as suggested here. It worked. Thanks.

        Show
        Sidney Leal added a comment - I had the same problem and replaced the tld's with the linked files, and also deleted the myfaces_html.tld as suggested here. It worked. Thanks.
        Hide
        Matthias Weßendorf added a comment -

        could not reproduce in latest 1.2.1 SNAP

        Show
        Matthias Weßendorf added a comment - could not reproduce in latest 1.2.1 SNAP

          People

          • Assignee:
            Unassigned
            Reporter:
            Vitaly Smyk
          • Votes:
            7 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development