You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Apache Wiki <wi...@apache.org> on 2007/10/26 05:26:35 UTC

[Jakarta-taglibs Wiki] Update of "FrequentlyAskedQuestions" by BjornTownsend

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-taglibs Wiki" for change notification.

The following page has been changed by BjornTownsend:
http://wiki.apache.org/jakarta-taglibs/FrequentlyAskedQuestions

The comment on the change is:
Folded the Standard1.1.3FAQ into this page.

------------------------------------------------------------------------------
  
   * Then download the JSTL 1.1 Specification Maintenance Release from http://java.sun.com/products/jsp/jstl/ and read Appendix A (Compatibility & Migration), specifically A.2 deals which JSTL 1.0 to JSTL 1.1 migration. Make changes to your web application(s) accordingly.
  
+ ==== Using string() on a complex expression in an xml tag is returning an empty string. What's up? ====
+ 
+ This was reported by Yuriy Yatsyk in [https://issues.apache.org/bugzilla/show_bug.cgi?id=33032 #33032] and appears to be due to some oddity in the way the Standard Taglib uses Xalan. The work around is to split your code up so that string() is applied to a simple expression. 
+ 
+ Using Yuriy's example change:
+ 
+ {{{
+ <x:set var="navigationPath" 
+        select="string($content/content/pages/page/url[text() = $contentUrl]/../navigation-path)" 
+        scope="request"/>
+ }}}
+ 
+ to:
+ 
+ {{{
+ <x:set var="navigationPath" 
+        select="$content/content/pages/page/url[text() = $contentUrl]/../navigation-path" 
+        scope="request"/>
+ <x:set var="navigationPath" select="string($navigationPath)" scope="request"/>
+ }}}
+ 
+ 
+ ==== The Standard Taglib depends on Xalan. Why? ====
+ 
+ The original source was coded against Xalan packages and not the XSL specification. It's unlikely that this will be changing any time soon, so you will need to include Xalan with your web applications. See [https://issues.apache.org/bugzilla/show_bug.cgi?id=30050 #30050] to see if any developments occur with this issue.
+ 
+ 
+ ==== The order of columns coming back in my SQL query does not match the order returned by the specification. Why? ====
+ 
+ The underlying code for sql:query uses a TreeMap to hold the row data. Unfortunately the specification limits us and we can't change this to a SortedMap, so there is no way to fix this bug. However if you approach the sql:query differently you can work around this issue. Consider the following code that avoids using the row data:
+ 
+ {{{
+   <%-- Get the column names for the header of the table --%>
+   <c:forEach var="columnName" items="${db.columnNames}">
+     <th><c:out value="${columnName}"/></th>
+   </c:forEach>
+ 
+   <%-- Get the value of each column while iterating over rows --%>
+   <c:forEach var="row" items="${db.rowsByIndex}">
+     <tr>
+       <c:forEach var="column" items="${row}">
+         <td><c:out value="${column}"/></td>
+       </c:forEach>
+   </c:forEach>
+ }}}
+ 
+ For more information concerning this bug, see [https://issues.apache.org/bugzilla/show_bug.cgi?id=33054 #33054]
+ 
+ 
+ ==== I am getting an exception - "An error occurred while evaluating custom action attribute ...". Why? ====
+ 
+ Chances are this is the issue reported by Luca Conte ([https://issues.apache.org/bugzilla/show_bug.cgi?id=34153 #34153]) and solved by Bill Stilwell. If your beans lack setters for the properties being obtained then from JDK 1.4.2_06 onwards this results in an exception. The workaround is to add a set method for the property. 
+ 
+ 
+ ==== The out tag is not handling my paramater named 'param'. Why not? ====
+ 
+ The following parameters should be treated as reserved words and not be used as developer variable names:
+ 
+  * pageContext
+  * pageScope
+  * requestScope
+  * sessionScope
+  * applicationScope
+  * param
+  * paramValues
+  * header
+  * headerValues
+  * initParam
+  * cookie
+ 
+ If you do use them as variable names, your mileage may vary. For more information, please see [https://issues.apache.org/bugzilla/show_bug.cgi?id=40870 #40870]. If you do need to use such a variable, then you can work around the keyword by referring to them within the pageScope as follows:
+ 
+ {{{
+ <c:out value="${pageScope.param}"/>
+ }}}
+ 
+ 
+ ==== My XML tag is resulting in "Content is not in prolog" - why? ====
+ 
+ This is an error from the XML parser and appears to usually mean that the parser junk input. Most likely you have the filename wrong (reported as [https://issues.apache.org/bugzilla/show_bug.cgi?id=41224 #41224]).
+ 
+ ==== The last() and position() functions are not working within x:forEach - why? ====
+ 
+ Not a clue :) It appears to be an aspect of how the Standard Taglib is calling Xalan and the solution is not readily apparent. The bug is tracked in [https://issues.apache.org/bugzilla/show_bug.cgi?id=22765 #22765]. 
+ 
+ ==== When trying to serialize XML using the Xerces (2.3.0) version that ships with JSTL 1.0.5 with JDK 1.3.1.07 I get an InvocationTargetException ====
+ 
+ For example, you might get:
+ 
+ {{{
+ java.lang.reflect.InvocationTargetException: java.lang.NoSuchMethodError
+ 	at 
+ org.apache.xml.serialize.IndentPrinter.breakLineIndentPrinter.java:281). 
+ }}}
+ 
+ when trying to serialize a XML document. 
+ 
+  This is due to a bug in Xerces. It doesn't apply to JSTL 1.1.x, as 1.1.x does not depend on Xerces. There are presently no plans to release a new version of the 1.0.x branch, but a workaround of sorts can be found by by recompiling Xerces with a JDK version higher than 1.3.1_07 (1.3.1_11 is reported to work). Using a later version of Xerces may also suffice.
+ 

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