jstl

How to hide application context from urls ?

I am using JSTL c:url tag to define my URL's in the application, something like: <c:url value"/home" /> But the problem is that it appends the application context to the url, so the link becomes http://appName.come/appName/page while it should be http://appName.come/page. The link had to be with slash, because it's not relative. I wa...

Iterate over Map object using JSTL

Is it possible to implement the following using plain JSTL: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <table> <% java.util.Map msgMap = (java.util.Map) request.getAttribute("messageMap"); for(int loopCount=1;loopCount>0;loopCount++) { if(msgMap.containsKey("/p...

JSTL C taglib on Tomcat 5.0

Hi, I'm using the jstl c taglib in a web application which I deployed on Tomcat 6.0.26. I need to run this web application on Tomcat 5.0.28... the problem is that the jstl tags are not being interpreted. For example, I'm getting ${status.errorMessage} written on my login page whereas this should be empty unless the password entered is ...

How iterate over a potentially infinite collection of collections using JSTL

Preface: I am a long-time fan of SO, read stuff here almost everyday -- but this is my first question -- thank you to everyone who has made SO such a fantastic resource! Environment: Spring/JSTL/Java ; the constraints of this project are such that I cannot accept a solution which requires abandoning Spring/Java, though I could probably...

Why does this PrettyTime custom tag produce 11 lines of blank text before the "pretty" date in the HTML output?

<%@ tag language="java" pageEncoding="utf-8" isELIgnored="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ tag import="com.ocpsoft.pretty.time.PrettyTime, java.util.Date"%>...

How do JSPs render

Let say I have something like this in a JSP: <li> <c:set var="sectionId" scope="request" value="${userSession.sect['Utilities'].id}" /> <a class="header" href="#category-2">Cat 2</a><c:import url="/resources/softwareCategoriesAccordion.jsp"/> </li> <li> <c:set var="sectionId" scope="request" value="${userSession.sect['Games'...

how to decouple data from business logic

Here is the scenario, Let's say I have a user class like so: public class User{ private String firstName; private String lastName; //... // setter, getters } Then I have a class like so to handle user Comments: public class Comments{ // some fields public static loadComments(User user, int count){...} } So far very basic s...

Only fraction digits with fmt:formatNumber?

Is it somehow possible to only display the fraction digits with fmt:formatNumber? I basically need to render a price-like double in two fields: decimal and fraction digits (123.456 -> 123 456) and I want to avoid string splitting etc. :-) The solution has also to work with a minimum number of fraction digits in order to create for inst...

Accessing constants in JSP using EL

Possible Duplicates: accessing constants in JSP (without scriptlet) Reference interface constant from EL Hi, I am having a class which contains all the constants used in my application. Eg: public class AppConstants { public static final String USER_TYPE_ADMIN = "Administrator"; } Now in one of my jsp page, i need t...

Spring MVC: Relative URL problems

I have a controller bound the URL: "/ruleManagement". Inside my JSP, I have a form that forwards (on submit) to "ruleManagement/save" url. When there are errors with the input fields, I want it to return back the original form View. This is where the problem starts... Problem 1) Now that the URL is "/ruleManagement/save", my form sub...

Passing non-string attribute to custom JSTL tag

Hello, is it possible to create a custom JSTL tag that accepts a non-string attribute? I would like to create a tag that would be handle pagination using PagedListHolder from Spring MVC. <%@tag body-content="scriptless" description="basic page template" pageEncoding="UTF-8"%> <%-- The list of normal or fragment attributes can be spec...

How can i do a multiselect in jsp/jstl with selected value?

Hello I have an User with some Roles User.class public class User { private Long id; private String firstName; private String lastName; private Set<Role> roles = new HashSet<Role>(0); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getFirstName() { return this.firstName; } pu...