Dear All,

I am in the process of porting/migrating a "working" web app from JRun 4 to
Tomcat 5 and have come across a custom tag processing problem that I am
ignorant about how to solve.  I've looked through the tomcat docs and a
number of mail archives but haven't found anything pertinent to this
problem.  Any help would be gratefully appreciated.  

Basically under tomcat the class generated from my JSP fails by throwing a
JasperException:

org.apache.jasper.JasperException: jsp.error.beans.property.conversion
        at
org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManage
r(JspRuntimeLibrary.java:885)
        at org.apache.jsp.jsp.OADList_jsp._jspService(OADList_jsp.java:3508)


When examining the offending code I see that my custom tag has been expanded
into: 

com.servicepower.servicemanager.tags.dates.IsAllDayTag
_jspx_th_spDate_allDay_0 =
(com.servicepower.servicemanager.tags.dates.IsAllDayTag)
_jspx_tagPool_spDate_allDay_targetDate_second_first.get(com.servicepower.ser
vicemanager.tags.dates.IsAllDayTag.class);
_jspx_th_spDate_allDay_0.setPageContext(_jspx_page_context);
_jspx_th_spDate_allDay_0.setParent((javax.servlet.jsp.tagext.Tag)
_jspx_th_logic_iterate_4);
_jspx_th_spDate_allDay_0.setFirst("actStartDate");
_jspx_th_spDate_allDay_0.setSecond((java.util.Date)org.apache.jasper.runtime
.JspRuntimeLibrary.getValueFromPropertyEditorManager(java.util.Date.class,
"second", "actEndDate"));
_jspx_th_spDate_allDay_0.setTargetDate((java.util.Date)org.apache.jasper.run
time.JspRuntimeLibrary.getValueFromPropertyEditorManager(java.util.Date.clas
s, "targetDate", "nowDate"));

And line 3508 is the call to setSecond.  I don't understand why
tomcat/jasper has decide to call getValueFromPropertyEditorManager for
properties "second" and "targetDate" and not simply passed in the strings
that have been set up (as it did in the setFirst call).


The corresponding code from JRun generation is:

IsAllDayTag isalldaytag =
(IsAllDayTag)jrunpagecontext.getTagHandlerInstance(257,
com.servicepower.servicemanager.tags.dates.IsAllDayTag.class);
isalldaytag.setPageContext(jrunpagecontext);
isalldaytag.setParent(iteratetag6);
isalldaytag.setFirst(__constantTable.getString(120));
isalldaytag.setSecond(__constantTable.getString(122));
isalldaytag.setTargetDate(__constantTable.getString(117));

And this is what I would have expected.  Could anyone shed some light on
this please?  After fixing a number of JSP tag inconsistencies in my code
(that JRun hadn't picked up) this has suddenly become a bit of a show
stopper for me.


Other information, my TLD looks like:

<taglib>
  <tlibversion>1.0</tlibversion>
  <jspversion>1.1</jspversion>
...
  <tag>
    <name>allDay</name>
 
<tagclass>com.servicepower.servicemanager.tags.dates.IsAllDayTag</tagclass>
    <bodycontent>JSP</bodycontent>
    <!-- inputs -->
    <attribute>
      <name>first</name>
      <required>true</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
      <name>second</name>
      <required>true</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
      <name>targetDate</name>
      <required>true</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>
  </tag>
</taglib>

My IsAllDayTag implementation has public setFirst, setSecond and
setTargetDate and "works" quite happily within my JRun environment.


The outline of my JSP is:

<%@ taglib uri="/WEB-INF/sm-dates.tld" prefix="spDate" %>
...
<bean:define id="actStartDate" name="record" property="expectedStart"/>
<bean:define id="actEndDate" name=" record" property="expectedEnd"/>
<bean:define id="nowDate" name=" record" property="now"/>
...
<spDate:allDay first=" actStartDate" second=" actEndDate"
targetDate="nowDate">
  <%-- do all day dependent presentation here --%>
</spDate:allDay>

Any help/thoughts/suggestions greatly appreciated.

Jonathan


Reply via email to