el

JSF2: Using EL in navigation rules. Redirect on timeout?

I am wondering the following: When a request comes into the JSF servlet, is it possible to redirect to a session timeout page if a session bean indicates that the session has not been logged in? For example: <navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <if>#{not userBean.loggedIn}</if> <to...

What causes a lexical analysis error for eclipse in jsp EL validation?

I've got some EL code inside of a JSP tag. The line starts as follows: <c:if test="${pageContext.request.serverName eq \'localhost\'}"> Eclipse throws up an error on this, saying: Unable to analyze EL expression due to lexical analysis error I'm unsure what this even means. Is this an eclipse bug? Am I mixing EL and the JSTL tag...

JSTL expression evaluation from a string

Is it possible to evaluate a String as EL expression in JSP and get value from it? I need an expression like ${model.${fieldPath}} where fieldPath will contain the required object path from a nested object model. I can get the actual field path by using but I am not sure how to evaluate a string and get the value from it Any help r...

Jersey (Jax-RS) & EL

Hi there! im trying to get a controller to return a view through a Expression Language-Filter, but have no idea on how to get jersey to use EL for filtering a view. View with EL-tags: <html> <title>%{msg}</title> </html> Controller: @GET @Produces("text/html") public Response viewEventsAsHtml(){ String view=null; try { ...

JSF Deferred EL conditional syntax problem

Hello I can't find any resources which can answer why I'm getting an error with this: oncomplete="#{MyBacking.oError ? #{rich:component('oErrorPanel')}.show() : return false;}" in a richfaces a4j:commandButton. oError is referring to a method in my bean called isOError. I'm getting the error SEVERE: Servlet.service() for servlet F...

How to convert an arbitrary object to String with EL + JSTL? (calling toString())

Is there any way to call toString() on an object with the EL and JSTL? (I need the String representation of an enum as index in a map in a JSP EL expression.) I hoped something like ${''+object} would work like in java, but EL isn't that nice, and there does not seem to be any function that does it. Clarification: I have a variable some...

Java: how to name boolean properties

I just had a little surprise in a Webapp, where I'm using EL in .jsp pages. I added a boolean property and scratched my head because I had named a boolean "isDynamic", so I could write this: <c:if test="${page.isDynamic}"> ... </c:if> Which I find easier to read than: <c:if test="${page.dynamic}"> ... </c:if> However the .js...

Assigning outcome of another JSTL tag as value of one JSTL tag

I've got this, which is working: <c:choose> <c:when test="${sometest}"> Hello, world! </c:when> <c:otherwise> <fmt:message key="${page.title}" /> </c:otherwise> </c:choose> And I want to change it to this: <c:choose> <c:when test="${sometest}"> <c:set var="somevar" scope="page" value="Hello...

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 invoke JSF action on an anonymous class? EL cannot access it

I want to have a generic menu in my jsf (myfaces 1.2) application. <h:form> <h:dataTable id="dt1" value="#{portal.actionList}" var="item"> <f:facet name="header"> <h:outputText value="Menu" /> </f:facet> <h:column> <h:commandLink action="#{item.action}"> <h:outputText value="clickme"/> <...

Call HashMap from jsp EL ?

Here is my Entity Class public enum UnitType { HOSPITAL, HEALTHCENTER } public static LinkedHashMap<UnitType, String> unitType = new LinkedHashMap<UnitType, String>() { { put(UnitType.HEALTHCENTER, "Κέντρο Υγείας"); put(UnitType.HOSPITAL, "Νοσοκομείο"); } }; @Id @GeneratedValue(strategy = Generatio...

param : implicit EL (Expression Language) object in JSP

What if I have URL like: servlet.jsp?myparam=myvalue These 2 ELs should return output "myvalue" , but I actually don't understand why?: ${param.values["myparam"]["0"]} ${param.values.myparam[0]} ...

invalidate a session from EL

How can I invalidate a session using EL? ...

JSF Conversion and Validation

I have an .xhtml page that is processed by the faces servlet in Tomcat. GET requests to the page look like this /module.xhtml?mod=6. I need to validate the integer parameter 'mod'. 'mod' is the ID of the Module object which is to be displayed on the module.xhtml page. Here's what I have far in module.xhtml: <f:metadata> <f:viewPara...

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}"/> ...

What is the correct way to bind input value to JSF managed bean property?

I am new to JSF and managed beans. I have a managed bean with some private property with public setter and getter methods. Now when I add the managed bean's properties to JSF forms, should I add the private methods directly or should I use call the property by getter methods? For example: <h:inputText value="#{BeanName.userName}"/> <h...

tr:inputText submitting value 0 instead of null

We are using a tr:inputText in a JSP page and when there is no value written in the inputText the form is submitting a 0 instead of null. We are using Trinidad 1.2.2 and Tomcat 6.0.20 (we also tried with Tomcat 6.0.14 as we read that this could happen with certains Tomcat versions). we reproduced this problem with an h:inputText too. Th...

Combining a string with the value of a variable to be the name of another variable in EL

Hi all, I want to do something like this: <display:table name="${summary${index}}"> But it does not work throws exception: "${summary${selChrm}}" contains invalid expression(s). I would like the user to use a drop down list to choose a selection and put in the variable index. Then the table will display the corresponding list of java...

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

nested el in jsf

I am having a problem with nested EL for <t:inputText> required Attribute. I am using tomahawk implementation. I have a dataTable with 2 columns of inputText. I have forceId=true for both the inputText boxes. When you look at view source of page, id's looks as postal[0] and zone[0] where postalCode and zone are the id's of textBox and th...