el

How to Escape Character in EL with JSTL tag?

I have this JSP code snippet: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <c:choose> <c:when test="${var1.properties[\"Item Type\"] eq \"Animal's Part\"}"> <c:set var="cssClassName" value="animalpart" /> </c:when> <c:otherwise> <c:set var="cssClassName" value="" /> </c:otherwise> </c:choose> The JS...

JSF, how to use EL in onclick.

Hi, I want to create links using database columns. I have a backing bean where I 'm connecting to the database. There is no problem with the connection and also no problem with the links names. I can see my links on my browser. I want to use onclick function and that's exactly where the problem starts. How can I use or can I use EL in o...

'#' character before EL expression used inside a JSTL tag behaves strangely

I have the following code to set a userId variable: (userId set in prior code) <c:set var="userId" value="(Cust#${userId})" /> Which produces the following string: (Cust#${userId}) The following code works as expected, however: <c:set var="userId" value="(Cust# ${userId})" /> displays the following string (Cust# 0001) . Why does...

How to create a InputText Tag File with a value attribute and a backing bean?

I want to create a Tag (Source) File to get a custom tag in facelets (as described here). I want it to get used like this: <my:inputText value="#{myBean.someString}"/> <my:inputText inputText="#{myBean.inputText}"/> In the first case, one could bind it to a simple String property within my bean. In the second case myBean should provid...

JSF+Facelets treating bean action as property

Guys, for some reason EL is not telling actions from properties. I have this page test.xhtml: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.su...

Whats the difference between "${foo.bar}" and "#{foo.bar}" ?

I can use objects from my Java Beans within .jsp files by using the Expression Language (EL). Therefore I can get my value by typing ${foo.bar}. But I can also use #{foo.bar}. Can anybody explain the difference or provide a link with meaningful information? ...

Is there a way to use EL to get the current value of an h:inputText field?

Hi, I'm new to JSF and EL, and was wondering if there is a way to use EL to get the current value of an h:inputText field. Am I doing it wrong, or is it possible at all? Thanks, -Ben ...

How to do this using java expression language

Let just say i have the following java object that I wish to read in my jsp using el: class A { Map map = new HashMap(); int count; String getAttribute(String attrName) { return map.get(attrName); } String getCount() { return count; } } I can call count ...

How do I round a number in JSTL?

Hi, I'm doing a division in a JSP and I'd like to round the result - how should I do this? i.e. <c:set var="expiry" value="${(expire.time - now.time) / (60 * 1000)}"/> ...how do I round the result? Thanks, ...

Expression language equivalent

what will be corresponding expression language statement for request.getRemoteUser() ? ...

EL expressions won't executed in Tomcat 5.5, but working in tomcat 6.0.20

Hello All... I am developing my application using spring-web-mvc... Now at my Controller it returns like this : public class InterfacesManageController implements Controller { public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> myModel = new Has...

Is it possible to use EL inside page directives?

I have some static html content (included on a dynamically generated page) that I want to localize, i.e., help-en.html, help-fr.html and so on. In the JSP file where it is to be included I have a bean userLocale which is a string containing "en", "fr" and so on. Thus a reasonable way to refer to the localized file would be: help-${user...

JSP EL (Expression Language) causing problems in Eclipse

My system: Ubuntu 9.10. Eclipse 3.5.1 with Java EE 1.2.1 (manual install - NOT from synaptic). Web Developer Tools 3.1.1 I've recently adopted someone else's code (a Dynamic Web Project), and run into lots of errors, warnings and incorrect syntax highlighting in Eclipse. I've narrowed it down to these 4 lines of code (create a new Dynam...

Expression language for IP address...

what is the corressponding expression for getting ip adress of server, as ${pageContext.request.serverName} is for getting the server name ...

What is the difference between #{expr} and ${expr} in jsf? Are there any cases when we should prefer ${expr}?

I've read some time ago about the difference in 'Core JSF' but now I can't find that place. Nevertheless I don't remember that there was a word about cases when we should use ${expr} in jsf. So I'm just curious what is the difference (in a chestnut) and if there a case to use ${expr} in JSF application? ...

JavaServer Pages: How to get a value into an attribute from code without Expression Language?

I am using the MyFaces 1.1 ValidateRegExpr tag to validate the input from a user against a regular expression. I would like to be able to dynamically assign the regex pattern via code, but according to http://myfaces.apache.org/commons11/myfaces-validators11/tagdoc/mcv_validateRegExpr.html the attribute pattern does not support Expressi...

JSPX namespaces not visible for EL functions?

I'm attempting to use JSPX (pure XML syntax for JSP) and running into what seems like it should work, but doesn't. I'm importing taglibs using namespace declarations in the jsp:root element, then using these later on for elements as well as EL functions: <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/ xmlns:c="urn:j...

How to put "new line" in JSP's Epression Language?

What would be right EL expression in JSP to have a new line or HTML's <br/>? Here's my code that doesn't work and render with '\n' in text. <af:outputText value="#{msg.TCW_SELECT_PART_ANALYSIS}\n#{msg.TCW_SELECT_PART_ANALYSIS2}"/> ...

JSF - create a generic confirmation page (dynamic navigation)

Hi everyone, I'll try to explain my problem. I use the JSF 1.2 implementation of IBM in a very very rigid environment (company layer, and strict constraints -don't add library etc.-). I want to create a simple page for confirmation that can be reused (kind of generic). For example : 1-page1.jsp > click on button 2-pageConfirmation.jsp ...

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...