hgbdelphi
asked on
about jstl in tomcat!
this is my some cod in my project:
<jsp:useBean id="idCommunity" class="com.beltino.communi tymedical. community. Community" scope="page" />
<c:set var="id" value="${param.id}"/>
<c:set var="action" value="${param.action}"/>
<c:set var="retList"/>
<c:if test="${empty id}">
<c:set var="action" value="new"/>
</c:if>
<c:if test="${!empty id}">
<c:set var="action" value="edit"/>
<c:set var="idCommunity" value="${idCommunity.getCo mmunityInf ormation(i d)}"/> //有问题
<c:set var="retList" value="${idCommunity.getCo mmunityChi ldByPId(id )}"/>
</c:if>
........
now <c:set var="idCommunity" value="${idCommunity.getCo mmunityInf ormation(i d)}"/> is error,and the error message is:
org.apache.jasper.JasperEx ception: /webapp/community/editComm unity.jsp( 24,3) The function getCommunityInformation must be used with a prefix when a default namespace is not specified
but when i use this page in resin3.0.8 ,it can work well ,but when in tomcat5.0.28,it can not work!
thanks!
<jsp:useBean id="idCommunity" class="com.beltino.communi
<c:set var="id" value="${param.id}"/>
<c:set var="action" value="${param.action}"/>
<c:set var="retList"/>
<c:if test="${empty id}">
<c:set var="action" value="new"/>
</c:if>
<c:if test="${!empty id}">
<c:set var="action" value="edit"/>
<c:set var="idCommunity" value="${idCommunity.getCo
<c:set var="retList" value="${idCommunity.getCo
</c:if>
........
now <c:set var="idCommunity" value="${idCommunity.getCo
org.apache.jasper.JasperEx
but when i use this page in resin3.0.8 ,it can work well ,but when in tomcat5.0.28,it can not work!
thanks!
I don't think you can call methods with parameters in JSTL. Tomcat is confusing the method call with the JSP 2.0 feature of functions. You need to call using the following syntax:
${prefix:methodName(param1 , param2, ...)}
and also include the TLD
<function>
<name>methodName</name>
<function-class>className< /function- class>
<function-signature>
returnType methodName(param1Type, param2Type, ...)
</function-signature>
</function>
See this tutorial:
http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag-p2.html
${prefix:methodName(param1
and also include the TLD
<function>
<name>methodName</name>
<function-class>className<
<function-signature>
returnType methodName(param1Type, param2Type, ...)
</function-signature>
</function>
See this tutorial:
http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag-p2.html
ASKER
thanks to MogalManic!
but i can do it in resin,so i help this can work in tomcat,can help me again,if i do this like you say,i will change my code much more,can help me again.
Best Regard!
but i can do it in resin,so i help this can work in tomcat,can help me again,if i do this like you say,i will change my code much more,can help me again.
Best Regard!
Tomcat is closer to the standard so my guess is that you are using a feature that is specific to resin. If you use the JSTL functions they should work in Resin.
ASKER
hi MogalManic ,
thanks for your help,
<c:set var="idCommunity" value="${idCommunity.getCo mmunityInf ormation(i d)}"/>
to
<c:set var="idCommunity" value="<%=idCommunity.getC ommunityIn formation( id)%>"/>
it can work ,but i will change all my code.
Best Regard!
thanks for your help,
<c:set var="idCommunity" value="${idCommunity.getCo
to
<c:set var="idCommunity" value="<%=idCommunity.getC
it can work ,but i will change all my code.
Best Regard!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
i will change some code like you,and another i will do this
<c:set var="idCommunity" value="<%=idCommunity.getC ommunityIn formation( id)%>"/>
i will change some code like you,and another i will do this
<c:set var="idCommunity" value="<%=idCommunity.getC
ASKER
${idCommunity.getCommunity
but it can in resin,how can i do it????
thanks!