-
1. Re: jsp 2 output a variable
peterj Jun 21, 2006 3:25 PM (in response to gurnard)I am using jstl in my jsps. I don't have any extra stuff added to the web-app token in my web.xml file. But the following works for me.
In my jsps, I have the lines:<%@ taglib prefix="f" uri="http://java.sun.com/jstl/fmt"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <h1><c:out value="${some.text}" /></h1>
In my servlet, I have some code that looks like:request.setAttribute("some", obj);
where obj is an object of a class that has a getText method.
Then, I have both standard.jar and jstl.jar in my WEB-INF/lib directory. -
2. Re: jsp 2 output a variable
gurnard Jun 22, 2006 3:52 AM (in response to gurnard)Hello I got it sorted in the end, the declaration I had in web.xml was incorrect.
Thank you for taking the time to read and reply though.
cheers
Martin -
3. Re: jsp 2 output a variable
peterj Jun 22, 2006 10:50 AM (in response to gurnard)Just out of curiousity, what did you have in web.xml and how did you correct it? What I am wondering is if you have any taglib descriptors and if that is what you changed. The reason I ask is that you really don't need any taglib descriptors in web.xml, the two lines declaring the taglib in the jsp files are sufficient.
-
4. Re: jsp 2 output a variable
gurnard Jun 23, 2006 3:47 AM (in response to gurnard)Hello,
Yes I do have taglib descriptors in the web.xml, but, I did not change these. The problem was that I had a typo in the declaration, when copy pasting it the typo was corrected.
I am using the JSTL style of output being<c:out value="${message}"/>
and it is working fine.
Thanks for replying
cheers
Martin