jstl

Getting wrong characters in parameter

In files.jsp I am using following anchor and JSTL c:url combination - <c:url value="downloadfile.jsp" var="dwnUrl" scope="request"> <c:param name="fileType" value="PDF"/> <c:param name="fileId" value="${file.fileId}"/> <c:param name="fileName" value="${file.fileName}"/> </c:url> <a href="${dwnUrl}">Download</a> On downloadfile...

Is anyone still using JSTL?

I was about to pick up some Java web programming since not having touched Java for a couple of years. I picked up an fairly old O'Reilly book that was sitting on my bookshelf (Java Server Pages 3rd Edition, covers JSP 2.0 & JSTL 1.1) and started skimming the pages. I went over to download the latest JSTL libraries and noticed that they a...

Spring MVC form:options tag not wiring into my objects Id?

I am trying to display my command objects collection field inside a list box. Inside said collection is a field, id and name. I want use the id as the html option value and the name as the option text. See the code below; <form:select id="customCollection" path="customCollection" size="10"> <form:options items="${command.customColle...

Redirection from jsp:include page

I want the user to be redirected to Login.jsp if the "role" stored in Session Scope doesn't match with the Request Parameter "accessRole" HomePage.jsp <jsp:include page="Header.jsp"> <jsp:param value="d" name="accessRole" /> </jsp:include> Header.jsp <c:if test="${sessionScope.role!=param.accessRole}"> <c:redirect url="Login.jsp"/> ...

Assigning values from JavaScript to Java variable

How to assign a value from JavaScript to Java variable in the JSP page? Is it possible to do this? The following is the javascript function: function loadGroupMembers(beanArrayVal){ document.getElementById("beanVal").value=beanArrayVal; ------------I have mentioned my requirement below -------------- %%%%%%%%%%%%%%% in...

Sed script for find/replace inside .jsp files. (from Struts to JSTL EL syntax)

I want a sed script that I can use for 1) finding instances, and 2) printing this string: <bean:write name='iframesrcUrl'/> <bean:write name="iframesrcUrl"/> <bean:write name="currentPage" property="title" filter="false"/> or similar. name and property values can differ. property and filter attributes are optional. Both single quotes...

Replacing EL in JSP with SpEL from Spring 3.0

Tired of old EL in JSP not being able to invoke methods on beans etc. Can I use SpEL from Spring 3.0 in my JSP:s? ...

pre-compile jsp files happend exceptions

I pre-compile some jsp files through ant task of jspc,but it built failed. errers: info.jsp(35,2) The attribute prefix fn does not correspond to any imported tag library info.jsp line 35 : <c:if test="${fn:length(requestScope.checkDetailInfoList) gt 1}"> ant task xml: <jasper validateXml="false" uriroot="${basedir}/WebRoot" ...

How can i use JSTL variable in scriptlet?

I have to access the JSTL variable which is calculated inside the iterator. Excerpt of code: <c:forEach var="resultBean" items="${resultList}" varStatus="status"> card: ${resultBean.cardNum} </c:forEach> i would like to access ${resultBean.cardNum} in the scriptlet code. what i am doing right now is: <c:forEach var="resultBe...

row counter for html table row

I have HTML table in JSF web application. I am generating rows dynamically using <ui:repeat>. I want a counter for each row. How can I get this? Any help? Ssimilar to rowKeyVar in rich faces dataTable. ...

Should i use JSTL in JSF 2 xhtml pages?

Hi, I would like to bind a backing bean's field to the selected value of a selectOneListbox. This value could be null, so i want to convert this to 0. This will set the selected value to the "default" selectItem. I'm using JSF2 I'm planning to do this with the http://java.sun.com/jstl/core taglib (using <c:if test="#{empty...}>) My q...

Passing bad string as javascript parameter

I'm having a problem passing parameters that I think I should be able to solve elegantly (with 1 line of code) but I can't seem to solve the issue. I have a link to delete items, like so: <a href="javascript:confirmDelete('${result.headline}',${result.id});"> The problem arises when result.headline contains characters like ' or " o...

The ultimate Java version table (J2EE, JEE, Servlet, JSP, JSTL)

I'm looking for a component break down of Java EE (or previously know as J2EE) and J2SE E.g. J2EE 1.3: Servlet 2.3, JSP 1.2. JSTL 1.0, ... J2EE 1.4: Servlet 2.4, JSP 2.0, JSTL 1.1, ... JEE 1.5: Servlet 2.5, JSP 2.1, JSTL 1.2, ... In a simple table It can be extracted from: http://java.sun.com/j2ee/1.3/docs/ , http://jav...

JSTL: iterate list but treat first element differently

Hi Everyone I'm trying to process a list using jstl. I want to treat the first element of the list differently than the rest. Namely, I want only the first element to have display set to block, the rest should be hidden. What I have seems bloated, and does not work. Thanks for any help. <c:forEach items="${learningEntry.samples}...

Have multiple submit buttons in a form and determine which was pressed in a controller

In my Spring application, I have a jsp that has a form where I want to have multiple submit buttons that go to the same controller. I need to be able to determine which button was pressed in the controller. The form displays a number of items to the user and they can select one of the items with the only difference being the ID of the ...

Logging every jsp:include

I want to log every <jsp:include> tag. Does the JavaServer Pages Standard Tag Library (JSTL) support logging and if so, how do I enable it? ...

rich:datatable rowspan issue

Hi all, I need to create a rich:dataTable (or even extended) with the following features: I have a class Company having a collection of Product objects. I want to show the following table: I still have not figured out how to do this with a subtable (in all the examples I found the subTable has the exact same columns as the master ta...

Issue updating a dynamically-binded AutoPopulatingList in Spring/JSTL

Hello, I am having an issue updating a select box's value that was created from a dynamically-binded AutoPopulatingList. Here's what I have: An AutoPopulatingList "basicList" that contains "BasicDefinition" objects that I created. Each BasicDefinition object contains: String value OperatorType object (the OperatorType object contains...

set var value from input field value

Hi! I started short time ago with JSP, JSTL, HTML and JavaScript so here is my problem: I need to set the value of a var the value of an input hidden. Other option is if it possible to compare using <c:if test="...."> the value of a variable that I sent with the request with the value of the hidden input. Thanks. Update I've been ...

difference between eq and == in JSP

What is the difference, if any, between the keyword 'eq' and the operator '==' in JSP Expression Language? In code, what is the difference between: <c:if test="${var1 eq var2}">some code</c:if> and <c:if test="${var1 == var2}">some code</c:if> ...