jstl

Using variables in JSTL param.

Is there any way to specify a variable as a parameter name in JSTL, i.e: <c:set var='myVar' value='dynamicParameterName' /> <c:out value='${param.(dynamicParameterName)}' /> ...

How to get the url of the client

I'm sending the request from Display.jsp to TrialShow.jsp page, but whenever I call ${pageContext.request.requestURL} in TrialShow JSP page, I'm getting http://localhost:8081/newjsp1/TrialShow.jsp as an output. How can I display http://localhost:8081/newjsp1/Display.jsp in TrialShow JSP page? ...

Overwriting variables in JSP/JSTL

I have the following code: <c:forEach items="${mergeList}" var="sublist" varStatus="index"> <c:forEach items="${sublist}" var="item" varStatus="row"> So my intention is to display each 'item' in a list. When the user does click over a row, open a floating window with the full item description. I set the variables with ...

Problem with expression language functions in Tomahawk tags

I'm using: Tomcat 6.0 Jsf 1.2 - Mojarra Implementation Tomahawk 1.1.9 I imported the taglib <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> when i call: <h:outputText value="#{fn:indexOf('ciao','i')}"></h:outputText> Output is 1 when i use <t:outputText value="#{fn:indexOf('ciao','i')}"></t:outputText> ...

conditional check in c:if always fails

The c:if test always fails for me and it never gets inside the loop. I am using the following namespaces xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:c="http://java.sun.com/jstl/core" The string ('array') to be split is "Tom and Jerry are GAP1 friends" <s:decorate template="/layout/display-text.xhtml"> <c:set var="arra...

JSP page not reading submitted for values

I am working on the front end of a jsp based app. We're using spring running on weblogic. I have a page with a form that submits to itself and I am trying to access the values of hidden fields that I set with javascript. <form method="post"> <input type="hidden" name="choosenDateFrom" value="test1" /> <input type="hidden" name="...

How to iterate an Arraylist inside a HashMap using jstl?

I am having map like this, Map<Integer,ArrayList<Object>> myMap = new LinkedHashMap<Integer,ArrayList<Object>>(); Now i have to iterate this Map and then the ArrayList inside the map. How can i do this using jstl. ...

Accessing Map value in a separate JSTL loop

Assume that a query result exists called resultSet having a field available as templateId. Also, a map 'templateMap' exists with keys of templatedId. I am not able to get any result from the following, any help appreciated. <c:foreach var="row" items="${resultSet.rows}"> <c:out value="${templateMap[row.templateId]}" /> </c:foreach> ...

Using var in XPath expression inside c:foreach

Hi all, this is my first question here, so please be gentle ;) I'm trying to loop through a list of items, and use the value of each item in an XPath expression: Works: <c:forEach var="item" items="${items}"> <x:out select="$some_xml//results[@attr1='some_val']/@attr" /> </c:forEach> Fails: <c:forEach v...

Accessing java-based DOM tree directly from JSF/richfaces

Based on this question I have a couple of other questions: 1) the map in this question which is made available to jsf is actually one of a number, so i'm now not sure what the backing bean method's return type should now be. if i modify it's current Array<String> return type to Array<Map Integer, Map<String, String[]>>> (or ArrayList<M...

Java List use through use of JSTL <c:forEach>

Hello If I have a JSF backing bean return an object of type ArrayList, I should be able to use to iterate over the elements in the list. Each element contains a map and although the question of how to access the map content through JSTL has been answered here, if I pass an array of such maps, I can't find how to iterate over them and ...

cannot load JSTL taglib within embedded Jetty server

I am writing a web application that runs within an embedded Jetty instance. When I attempt to execute a JSTL statement, I receive the following exception: org.apache.jasper.JasperException: /index.jsp(1,63) PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed wit...

Backing bean String[] access in JSF

First, apologies if you've been involved with my recent questions. As this isn't a discussion forum, and comments are limited, my last hope is to ask a specific question with actual code in the hope that somehow I can reach the bottom of my problem. OK. I've a backing bean called PrismBacking with this pertinent code: public clas...

c:forEach doesn't render inside rich:dataTable

I am using c:forEach inside rich:dataTable. But c:forEach doesn't substitute the values for answer.choices variable and hence nothing is rendered. Is it wrong to use c:forEach inside a rich:dataTable? ...

Using a4j:repeat or ui:repeat inside rich:dataTable doesn't render radio buttons properly

While using <c:forEach> the items values is not substituted properly. If i use <a4j:repeat> or <ui:repeat> instead of <c:forEach> inside a <rich:dataTable>, radio button is not rendering properly. I also found reason for this in http://community.jboss.org/wiki/Cantusea4jrepeattoiteratethemenuItemstabsetc How do I resolve this issue? <f...

Is the "c" prefix required in JSTL <c:forEach>?

I am studying JSTL part of JSP, I have a question about the <c:forEach> loop tag. Is that c prefix required? Does it indicate any specification? ...

Custom tag - get access to data in model?

I am creating a custom JSP tag by extending SimpleTagSupport. Normally in the view, I could do something like <c:out value="${key.attr}" /> using jstl to pull data from the model. My question is: when creating custom tags (by using SimpleTagSupport), how do I gain access to the data from the model? Thanks. Just to clarify, I need a c...

h:inputText return a empty string instead of NULL

Hello, i make a JSF 2.0 Application and i use many h:inputText fields to input data in my database. Some fields are not required <h:inputText value="#{registerBean.user.phoneNumber}" id="phoneNumber" > <f:validateLength maximum="20" /> </h:inputText><br/> When the user leave this fie...

Use <c:forEach> with HashMap

I have a java class that sets an servlet attribute to a HashMap object: request.setAttribute("types", da.getSecurityTypes()); where request is an HttpServletRequest Object, and da.getSecurityTypes() returns a HashMap Object. Is there a way to go through the HashMap collection using c:foreach or some other JSTL tags? I was thinking: ...

forEach tag having problem

Hi All i am facing a problem while using the forEach for iteration i am giving the complete code please tell me whats wrong with this. index.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/ht...