You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Romain Thouvenin <rt...@sfwan.com> on 2005/07/21 14:53:10 UTC

[Jasper/Orion] compile JSP servlets

I'm trying to write an ant task to pre-compile JSP pages, but I have the 
following problem.

Here is a piece of page :
# <form:input type="hidden" name="idy" value="<%= itlBean.getIdy() %>"/>
(itlBean.getIdy() returns a Long.)

Then I try to transform the JSP page into a servlet with the jasper 
task, which gives the following java code :
#      _jspx_th_form_input_0.setParent(null);
#      _jspx_th_form_input_0.setType("hidden");
#      _jspx_th_form_input_0.setName("idy");
#      _jspx_th_form_input_0.setValue( itlBean.getIdy() );

But the value field in the tag handler is a String and so the setter is 
void setValue(String value), therefore javac refuses to compile the 
corresponding servlet.
Unlike jasper, Orion (the server I'm using) generate the following java 
code for the same page :
#            __tag1.setParent(null);
#            __tag1.setName("idy");
#            __tag1.setType("hidden");
#            __tag1.setValue(com.orionserver.util.ObjectUtils.toString( 
itlBean.getIdy() ));

Great ! Orion recognized the problem and convert the Long to a String.
And now my question :
Is jasper able to do that ? How ?
If not, does this way of proceeding conforms exactly to JSP spec. ?
Can my problem be solved ?

Thanks for your help.
Romain Thouvenin



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org