Description
I am using Tapestry for some new pages in my admin section. I have other pages that are jsps that I want to have contain links to Tapestry pages. I used the "page" tag and it worked great. I need to pass a service parameter to one page so I tried using the external tag and made my page implement IExternalPage. To pass the parameter, which is an object ID, as an int and not a string, I tried using the "parameters" parameter in the external tag like this:
<tapestry:external page="AdViewer" parameters="ognl:getAttribute(\"nlAd\").id"><%=nlAd.getId()%></tapestry:external>
This gave me the following error:
javax.servlet.jsp.JspException: Unable to evaluate OGNL expression 'etAttribute("nlAd").id': Unable to read expression '<parsed expression>' of org.apache.jasper.runtime.PageContextImpl@a5fd35.
at org.apache.tapestry.jsp.AbstractTapestryTag.evaluateExpression(AbstractTapestryTag.java:156)
at org.apache.tapestry.jsp.AbstractTapestryTag.convertExpression(AbstractTapestryTag.java:135)
at org.apache.tapestry.jsp.AbstractTapestryTag.convertParameters(AbstractTapestryTag.java:127)
at org.apache.tapestry.jsp.AbstractTapestryTag.constructExternalServiceParameters(AbstractTapestryTag.java:81)
at org.apache.tapestry.jsp.ExternalTag.getURLRetriever(ExternalTag.java:38)
at org.apache.tapestry.jsp.AbstractLinkTag.doStartTag(AbstractLinkTag.java:105)
Notice the ognl expression in the error message is missing the 'g' in the beginning. When I added an extra character like this:
<tapestry:external page="AdViewer" parameters="ognl:ggetAttribute(\"nlAd\").id"><%=nlAd.getId()%></tapestry:external>
it worked. The tag is stripping the ognl: off the expression improperly, losing the first character. I tested with 3.0.3 also (it was high time I upgraded!) and it still did the same thing.
Greg