jstl

converting strings to Title case in JSTL

Hi, Is there any way to convert a string to Title case, using JSTL tags? Thanks in Advance. ...

Java web application properties

Does Java and/or Spring have the concept of properties? I have bunch of domain models, each of which has several properties. Example: public class Person { private String name; private Date dateOfBirth; private float height; private float weight; // getters and setters not shown } When displaying a person, the prop...

Printing formatted date in JSTL

Hi I am pulling a column from database which contains date.In DB it is character value.I want to print the date in formatted way. I have used following code for printing the date in formatted manner. where ${Po[1]} contains date value. But above statement prining null value. Any advice Thanks in advance Sas ...

JSP - Saving a collection

[Warning] I'm new to JSP/Struts/JSTL. This is probably a newbie question :) I have a form that contains a collection: public class ServiceForm extends AbstractForm { private List<SrvDO> allSrv = new ArrayList<SrvDO> (); } I can see the object data correctly in my form using the JSP. The page displays 5 input box with the dat...

Why do I get an AbstractMethodError when setting a JSTL variable?

I am trying to set a variable that I will refer to in a custom JSP tag, so I have something like this in my JSP: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <c:set var="path" value="test"/> However, I am getting this error when The JSP runs: java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContex...

Spring MVC Webapp: Where to store paths to common images?

I'm building a Spring MVC web application with Tiles/JSP as the view technology. Previously I stored the paths to common images in class Common: public final static String IMG_BREADCRUMBS_NEXT = "/shared/images/famfam/bullet_arrow_right.png"; Then I would use this class in jsp to get the image src like <img src="<%= Common.IMG_BREA...

Jasper in Jetty 6 throws exception for JSTL tag

I'm trying to run an application in jetty that runs fine in Tomcat 5.5. The app uses servlet 2.4 and JSP 2.0. Jetty/Jasper is throwing this exception: org.apache.jasper.JasperException: /WEB-INF/tiles/layout/main.jsp(85,55) PWC6340: According to the TLD, rtexprvalue is true, and deferred-value is specified for the attribute items of t...

Removing unnecessary whitespace in a J2EE/Struts Application in WebSphere

Is anyone familiar with a technique for removal of whitespace that results from the use of tag libraries such as JSTL? I know that you can do this in Tomcat via a trimSpaces initialization parameter, but does anyone have similar experience doing this type of thing within WebSphere App Server? ...

JSF JSTL problem with nested forEach

Inside a nested foreach, accessing the same variable is returning different values. This happens when the page is reloaded, not on first load. <ui:composition xmlns="http://www.w3.org/1999/xhtml" (...) xmlns:c="http://java.sun.com/jstl/core" xmlns:h="http://java.sun.com/jsf/html"&gt; (...) <c:forEach items="#{controller.av...

Using JSP code in JavaScript

I want to use JSTL's fmt tag in javascript to localize my alert messages. My javascript file is a standalone file and when I include fmt tag in js file browser gives javascript errors, is it possible to treat .js file as .jsp file using web.xml configuration? Can anyone please suggest me how can I do that? ...

Forcing Compile of .tag files

How can I force Websphere to compile my .tag files? Cleaning the project, publishing, restarting the server, adding and removing projects all don't help - the .class file for the tag file is not being recompiled. If I delete the .class files, I get an error that the class is missing, but it does not recompile ...

XSLT/Java: ERROR: 'Cannot find external method 'max' (must be public).'

I am copying an example from XSLT Cookbook: 2nd Edition (O'Reilly: Mangano, 2006) where Mangano creates a tree diagram with SVG. As a way to quickly test this code, I am simply transforming the XML using JSTL's <x:transform/> tag, and running it in Jetty 6. The XSLT seems to be getting hung on calling java:java.lang.Math:max, saying: ...

JSTL <c:out> where the element name contains a space character...

I have an array of values being made available, but unfortunately some of the variable names include a space. I cannot work out how to simply output these in the page. I know I'm not explaining this well (I'm the JSP designer, not the Java coder) so hopefully this example will illustrate what I'm trying to do: <c:out value="${x}"/> ...

Method calls in EL

Hi there, When I write Java webapps, I usually use JSTL tags. I think that these tags are great, except for one thing that pisses me off: while the expression language allow you to access bean properties, it does not allow you to call its methods. In release 1.0, it was not even possible to obtain the length of a string or the number o...

Custom rendering in JSP based on type of class without instanceof

How would you properly render a list of objects in jsp with differing types? Say, for example, I have to render these different objects in a specified order. One way could be to use a common type variable or instanceof but that means having a big switch/if statement to manage them all: <c:forEach var="o" items="${bigListofObjects}" >...

How to do a OR in a c:if statement in jsp.

How do I properly declare a or statement i try this without success: <c:forEach var="route" items="${map.street}"> <c:if test="${route.value.type == 'road' || route.value.type == 'street'}"> ...

How to show a group of 3 elements of a collection using JSTL in JSP?

I have a list of n elements that I want to output in a group of 3. The size of the collection can vary a lot, but the output must be grouped in 3. <ul> <li> <div>element 1</div> <div>element 2</div> <div>element 3</div> </li> <li> <div>element 4</div> <div>element 5</div> <div>element 6</div...

JSTL forEach reverse order

Using JSTL's forEach tag, is it possible to iterate in reverse order? ...

Jasper in Equinox - does not resolve jstl core uri

I'm currently researching OSGi with Spring, and working through a couple of examples from Pro Spring Dynamic Modules for OSGi. My example web-app has a single controller like: @Controller public class HelloWorldController { private HelloWorldService helloWorldService; @RequestMapping(method = RequestMethod.GET) @ModelAttri...

JSTL format tag?

I have a custom java.text.Format and would like to use it in my JSP. Is there a JSP/JSTL tag that can format an object using a custom java.text.Format? I'm looking for something similar to <fmt:formatNumber> and <fmt:formatDate> except that an custom format can be used. I know that I can write my own tag but am curious if there's an exi...