jstl

how to set session attribute from a hidden field ?

is it possible to set a session attribute using JSTL from a hidden input in the jsp page? ...

How to format a number in Expression Language?

How can I make a formatted output for a number (e.g. long or BigDecimal) in EL? For example, I want to limit a number of decimal digits to 3 in ${result.returnValue.contract.balance} ...

How to use <c:out value=...> taglib

I have the class A: package a; public class A { private int x = 9; public int getX() { return x; } } and the ajsp.jsp file: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional...

How to create templates in JSTL JSP

Say I have a JSP page with JSTL. I'm using c:forEach and looping over 5 different sets of objects, each very similar. Each loop is nearly identical.. lots of duplicated code. I'd like to make that loop a template -- such as a JSP template, but I want to pass the JSTL object(s) in the parameters. How can I do this? Or a more general...

Populating JavaScript Array from JSP List

Ok so perhaps someone can help me with a problem I'm trying to solve. Essentially I have a JSP page which gets a list of Country objects (from the method referenceData() from a Spring Portlet SimpleFormController, not entirely relevant but just mentioning in case it is). Each Country object has a Set of province objects and each province...

template language for ASP.NET MVC

Hi, is there any template language for ASP.NET MVC like JSTL and OGNL? Thanks in advance. ...

foreach loop is not working on opened pop up

For each loop is not working in opened popup while the same collection i can see when I write it on page <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>my cart</title> </head> <body> <% ArrayList cart=(ArrayList)session.getAttribute("Cart"); out.println(cart); //this line is working %> <table> ...

JSTL Tei Not Working

All the jstl tags which do not involve passing back a value(using tei) are working, but whenever I use a tag like <c:forEach var="abc">...<%=abc%></c:forEach> i am getting an error abc cannot be resolved. <c:forEach var="i" begin="0" end="<%=len%>"> <%str+=" Parameter type= " + (String)(tArray[i]) + " Parameter Value= "+ pArray[i]; lo...

JSTL number handling

Hi , I set the session variable like below getSession(true).setAttribute("entriesCount", "10"); then the call below returning nothing in jstl. <c:out value="${#session.entriesCount}"/> ...

jstl foreach omit an element in last record

trying to use this jstl to formulate a json string, how can i make the segment not to put a comma in the end of the last record? note the comma in the end <c:forEach items="${fileList}" var="current"> { id:1001,data:["<c:out value="${current.fileName}" />" , "<c:out value="${current.path}" />" , "<c:out value="${current.size...

How to prepopulate repeating h:selectOneMenu?

Modifying working form with one spot per order to multiple spots per order I met problems with prepopulating h:selectOneMenu. Exception is java.lang.IllegalArgumentException: Value binding '#{spot.deliveryTypes}'of UISelectItems with component-path {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /order.jsp][Class: java...

issue with JSTL Hashset

The below code is not working <c:forEach var="row" varStatus="rowCount" begin="1" end="10"> <c:set var="entry" scope="request" value="${session.entry.mileStones[rowCount.count]}"/> or <c:set var="entry" scope="request" value="${entry.mileStones[rowCount.count]}"/> </c:forEach> where , Entry.getMileStones ====> HashSet is properl...

File path on JSP and javascript

trying to put a file path in javascript. it is a pain \ is an escape character and it always kill the character after the backslash what i am doing is this i am trying to add the file path from a jsp view object attribute window.open("file"+<c:out value="${filePath}" />+fileName); but if there are backslash in the end of filePath,...

JSTL vs Old School JSP EL Conflict?

I have been developing a web application for about six months with no framework or JSTL support. After recent decisions, I have decided that I am interested in integrating JSTL use into my development, but am not sure what the repercussions would be. If I were to begin using JSTL in my application, would I have to go back and refactor al...

Use JSTL to control what content to be used in a table.

Hi all, I would like to use a different ArrayList for the content of a table based on a user selected value. I am using the display:table tag for the display <display:table name="${aVariableName}"> <display:column property="trackNumOfType" title="Track (# of Types)" sortable="true"></display:column> <display:column property=...

How can I create an absolute url in a jsp?

If a have <c:url value="/article"/> in a jsp, I actually want it to produce http://mysite.com/context/article. Is there any simple way to acheive this? ...

Xhtml pages and HttpSession test , no jstl ?

I have a dynamic web application in JEE with JSF, Facelets, Richfaces. My pages are all xhtml pages. So JSTL isn't working in it. For my account pages and all other private pages to be reachable, I want to test if the user got connected, so if the attribute session in HttpSession is not null. If it's null, the user gets redirected in th...

Post parameters in two forms when onchange happens in one of them.

I have dropdown lists in two forms in a single .jsp. I would like the change of any of the lists to trigger a post back to the .jsp itself with the currently selected parameters in both forms. But I couldn't get it work. Here is the relevant part of the code: Both forms are in the SearchBrowse.jsp. This is form1 (form2 will have an iden...

JSP EL expressions not working in tag files

We are trying to move our Java web application from a Tomcat 5.5 server to a more modern Tomcat 6.0.24 one, but we are having some problems with JSP EL. The expressions placed within XML tag files are not recognized by the server, that simply renders them as text (just as in the following example). Any ideas why? <object id="${id}" ...

Is there and shorthand for <fmt:message key="key" />

It's tedious and ugly to write things like: <input type="button" value="<fmt:message key="submitKey" />" /> And in case you want to nest the message tag in another tag's attribute it becomes even worse. Is there any shorthand for that. For example (like in JSF): <h:commandButton value="#{msg.shareKey}" /> (spring-mvc-only solution...