parse « JSTL « JSP-Servlet Q&A

1. fmt:parseDate - a parse index locale can not be established

Does anyone know the root cause of this error? I am feeding known good data to the fmt:parseDate tag (its db driven data controlled by us), and yet this error ...

2. JSTL c:import and x:parse inside of x:forEach

I am trying to use the c:import and x:parse tags within an x:forEach. Is this possible? If not, what is another way to import multiple xml sources depending on parsed data from another ...

3. How can I parse a URL using JSP/JSTL?

I want to capture the base path of a given url so basically i just want this: /mypath/coolpath/favoritepath/ Any ideas how to do this without using straight Java?

4. Parsing string variable with jstl

Here's my problem. I need to set up a process, preferably with jstl/jsp, that depending on what a client enters in a URL parameter, a certain URL will be returned, with the ...

5. JSTL x:out not working with x:parse

I seem to be unable to use x:out to traverse parsed XML. I'm looking for ideas on what to check to get this working. When I take out the ...

6. JSTL - parse not working for elements with namespace

I am trying to parse the following XML using JSTL. I can easily retrieve all the elements in the XML apart from the tags with the "t" prefix, how do ...

7. unable to parse EL function

I am looking at my computer screen for the past 1 hour now trying to debug this error. But I am clueless. Can anyone help me on this? Error Message: JSPG0227E: Exception ...

8. JSTL cannot parse a double variable multiplied by an integer variable?

If I set two variables in my controller:

double doubleAmount = 18.0;
int integerAmount = 2;
And then try to multiply them in my JSTL code:
<c:set var="result" value="${doubleAmount} * ${integerAmount}"/>
I get this error:
javax.servlet.jsp.JspException: ...

9. JDK7 jstl/xml parse problem...

The following code works fine in JDK6, which returns a nodeList... However, run the same code in JDK7... protocolInvolves returns nothing ([])... Tried OpenJDK7 as well...

<x:parse doc="${protocolXml}" var="protocolVar" />
<x:set var="protocolInvolves" select="$protocolVar/protocol/involves/involve" />
My xml ...

10. JSTL xml parsing

I have a small question on the JSTL tab lib. How can we select all the content of an xml tag. Let me show you: XML file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<portlet id="publier">

11. How do I parse through a URL path, get the filename, then replace the file extension using JSTL and Java scriptlet

I need to get "filename" from a URL Here I am declaring

<p:out var="path" value="${webObject.path}" scope="page"/>
<c:set var="string1" value="${path}" />
<p:out value="${string1}" />
this returns "dir1/dir2/dir3/filename.xml" on the webpage What I need is a Java Scriptlet ...

12. Parsing XML file using Java JSTL library; x:out does not display node-specific data

Here is my xml file:

<User xmlns="" xmlns:i="">
<CostCentre i:nil="true"/>
<DeskNo i:nil="true"/>
<KnownAs>Marco l'ancien</KnownAs>

If I do this:

<c:import url="" var="xmlDoc"/>
<x:parse xml="${xmlDoc}" var="output"/>
<x:out select="$output" />
It returns: l'ancien

I want to display a node-specific content using

<c:import url="" var="xmlDoc"/>
<x:parse xml="${xmlDoc}" ...

13. How to parse the templated sentence "#{name} invited you" using expression language

I am a new bee to Java. My intension is to use the template like sentences in Java program (no JSP or any web related pages) Example:

String name = "Jon";

"#{ name } ...

14. JSP c:set to value returned by x:out displays special characters code

I have an xml document. When parsing that doc I want to do

<c:set var="fullName">
<x:out select="$character/fstName"/>.<x:out select="$character/famName"/>
and then later
<c:out value="${fullName}"/>
This displays special characters html code instead of the character itself (ie. apostrophe ...

15. An odd "XML parsing failed" still after using jstl c:out

The jstl c:out tag can escape xml characters. However, I still got the "XML parsing failed" as followed:

XML parsing failed
XML parsing failed: syntax error (Line: 34, Character: 3)

invalid character


32: <a href="someUrl">userA</a>
33: ...

16. JSTL 1.1.1 x:parse tag problem!

Has anyone run into the issue with the tag not recognizing the doc attribute? Attribute doc invalid for tag parse according to TLD This is supposedly the new way to state the document source but it doesn't work. The XML attribute was the old way but that is now deprecated and gives me an error saying it doesn't take any parameters. ...

17. JSTL - x:parse vs. Jakarta - xtags:parse

Hello guys, I've been struggling the last days trying to send and receive data to/from a webservice. Only today I got it up and running 100%, but I there is some questions in my mind that I haven't been able to answer. First I have used the jakarta iolib to send the SOAP envelope and everything turned out alright. I processed ...

18. JSTL unicode xml does not display after x:parse call

Hi all, thanks in advance for this one. I am trying to display an xml file on the web using JSTL xml tags. The file is encoded in utf-8 containing ancient Greek characters (x1f92, etc.). The file displays properly from a servlet + xslt (, but I want to use JSTL. The JSTL produces intricate spaghetti on the screen (e.g. ...

19. JSTL XMl parsing

I am also having problem in parsing data from feed in jsp.I am getting an exception - Content is not allowed in prolog. My code syntax: <%@taglib prefix="c" uri=""%> <%@taglib prefix="x" uri=""%> //feeds located in root directory I am running code in Eclipse IDE,APACHE 6.0,JDK I.6 Exception : root cause org.xml.sax.SAXParseException: Content is ...

22. JSTL not parsing the values

23. parsing and updating html file using JSP.