3 Replies Latest reply on Jun 11, 2003 4:53 AM by henkmeulekamp

    JSP jetty(jboss-3.2.1)  JSP:setProperty problem with static

    henkmeulekamp


      HI,
      i'm having a problem with public static fnal int's from a javabean. If i do this (setting the property via a static final int property on the class:

      <jsp:useBean id="personBean" scope="page" class="com.denkk.jblearning.web.personBean" />
      <jsp:setProperty name="JB_Page" property="required_acces_level" value="<%=com.denkk.jblearning.web.jblearningPage.ACCESS_LEVEL_STUDENT%>" />


      org.apache.jasper.JasperException: argument type mismatch
      at org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(JspRuntimeLibrary.java:547)
      at org.apache.jsp.top_jsp._jspService(top_jsp.java:90)


      Then convert it to this (hardcoded numbers in it), it works..
      <jsp:useBean id="JB_Page" scope="page" class="com.denkk.jblearning.web.jblearningPage" />
      <jsp:setProperty name="JB_Page" property="required_acces_level" value="0" />

      And If i do this it also works:


      <jsp:useBean id="personBean" scope="page" class="com.denkk.jblearning.web.personBean" />
      <%
      JB_Page.setRequired_acces_level(com.denkk.jblearning.web.jblearningPage.ACCESS_LEVEL_STUDENT);
      %>

      So there seems to be a problem with setting properties... I have an app, original for Oracle9ias, where it runs fine, which i want to convert to Jboss. Only this is bugging me....

      does anyone know what's going wrong? (also tested it with jboss 3_2_tomcat) same problem there, so it may be the case that i'm doing something wrong.. But why does it work on Oracle9ias then?

      Regards
      Henk J Meulekamp

        • 1. Re: JSP jetty(jboss-3.2.1)  JSP:setProperty problem with sta
          jonlee

          This is a JSP compiler issue. Both Tomcat and Jetty use the same JSP compiler, Jasper from the Jakarta Apache group. That is why you have the same issue with both implementations.

          The construct you provide creates a problem for the compiler as it needs to recursively interpret the expressions within tags. This can make things much more complicated for the compiler. I'm not sure that the spec allows tags to have expressions substitued for values. I suspect that since Tomcat and the underlying Jasper compiler is the Sun reference implementation, that this is not the case. Oracle may have made their own interpretation and included this enhancement.

          Please note that JBoss incorporates many other technologies and these components and their operation are not governed by the group, nor may the questions be adequately covered in these forums. You may need to raise this with the Tomcat group if you feel that the compiler does not meet the JSP 1.2 spec.

          Hope that helps.

          • 2. Re: JSP jetty(jboss-3.2.1)  JSP:setProperty problem with sta
            henkmeulekamp

            ok thanx..That would make sense.

            I'm going to read the specs of 1.2 on this issue.

            • 3. Re: JSP jetty(jboss-3.2.1)  JSP:setProperty problem with sta
              henkmeulekamp

              following the specs this is a bug in the jakarta project..