el

How to concatenate Strings in EL expression?

北慕城南 提交于 2019-12-27 12:22:07
问题 I need to create a callback for <h:commandButton> while as a parameter I need to pass an argument that is string-concatenated with an external parameter id: I tried nesting an EL expression something like this: <h:commandButton ... action="#{someController.doSomething('#{id}SomeTableId')}" /> However this failed with an EL exception. What is a right syntax/approach to do this? 回答1: If you're already on EL 3.0 (Java EE 7; WildFly, Tomcat 8, GlassFish 4, etc), then you could use the new +=

For each loop with Expression Language

随声附和 提交于 2019-12-26 01:06:12
问题 I want to print out every Item of my list "sorts" with Expression Language in a JSP File like that: Try: Pizza-Margherita Try: Cheese-Pizza So it works if i use a normal expression like this Try: ${sorts[0]} Try: ${sorts[1]} But i have to write it for every Item in the List So I tried to use following two Loops: <c:forEach items="${sorts}" var="item"> Try: ${item}<br> </c:forEach> <c:forEach var="item" items="${sorts}"> <td> Try: <c:out value="${item}" /> </td> </c:forEach> It didn't work and

EL expression in c:choose, can't get it working

落花浮王杯 提交于 2019-12-25 18:35:39
问题 I'm trying something (JSF2) like this: <p>#{projectPageBean.availableMethods}</p> <c:choose> <c:when test="${projectPageBean.availableMethods == true}"> <p>Abc</p> </c:when> <c:otherwise> <p>Xyz</p> </c:otherwise> </c:choose> But this doesn't seem to work, although the EL expression in the top paragraph changes from false to true, the next paragraph always shows Xyz? I also tried to change the test to: ${projectPageBean.availableMethods} But still the same problem! 回答1: First and foremost:

use case for FacesConverter

纵然是瞬间 提交于 2019-12-25 18:33:29
问题 Referencing a previous question of mine, why is the @PostConstruct method not runnable? glassfish gives: INFO: MessageBean.. INFO: MessageBean.getModel.. INFO: SingletonNNTP.getMessages.. INFO: MessageBean.getModel.. INFO: SingletonNNTP.getMessages.. INFO: SingletonNNTP.setIndex..2,205 INFO: SingletonNNTP.setIndex..2,205 INFO: SingletonNNTP.setIndex..2,206 INFO: SingletonNNTP.setIndex..2,206 INFO: SingletonNNTP.setIndex..2,207 INFO: SingletonNNTP.setIndex..2,207 INFO: SingletonNNTP.setIndex.

parameter with <f:viewParam> and FacesConverter from CDI

ε祈祈猫儿з 提交于 2019-12-25 11:50:24
问题 It's not clear to me why I'm getting this particular exception, it's a red-herring I think. The underlying problem could be related to the last line of the exception: MessageConverter.getAsObject..0 which should actually be 1501 (the Message ID). So, why does MessageConverter.getAsObject have the wrong id? I think that this could be related to the Detail constructor, which is probably passing the wrong parameters to MessageConvert.getAsObject(), in particular the UIComponent object --

ELResolver cannot handle a null base Object - Weblogic 10.3.x, Facelets 1.1.14, RichFaces 3.3.2

岁酱吖の 提交于 2019-12-25 04:47:04
问题 I'm having trouble using RichFaces 3.3.2 and Facelets 1.1.14 under Weblogic 10.3.4 and 10.3.5 (aka 11g). I have an xhtml file with the expression #{empty messages} , and on the console I get the following exception: SEVERE: Error Rendering View[/index.xhtml] javax.el.ELException: //media/DADOS/data/java/wl1034/user_projects/domains/wlrep1034/autodeploy/SimpleJSFa/index.xhtml: ELResolver cannot handle a null base Object with identifier 'messages' at com.sun.facelets.compiler.TextInstruction

How to get the value of a value in <c:forEach>

谁说胖子不能爱 提交于 2019-12-25 04:34:21
问题 This is my model Student public class Student { List<Subject1> class1SubjectList=new ArrayList<Subject>(); List<Subject2> class2SubjectList=new ArrayList<Subject>(); List<Subject3> class3SubjectList=new ArrayList<Subject>(); List<Subject4> class4SubjectList=new ArrayList<Subject>(); List<Subject5> class5SubjectList=new ArrayList<Subject>(); List<Subject6> class6SubjectList=new ArrayList<Subject>(); List<Subject7> class7SubjectList=new ArrayList<Subject>(); List<Subject8> class8SubjectList=new

Passing request scoped variable passed as EL action method parameter does not work

不打扰是莪最后的温柔 提交于 2019-12-25 04:33:49
问题 I am using JSF 2.2 on Glassfish 4.1. I am trying to pass in a query parameter to as an action method argument as follows: // Example 1. This does not work. // at url http://localhost:8080/app/order.xhtml?email=test@email.com <p:commandButton value="Place order" action="#{orderManager.placeOrder(param['email'])}" /> (Know that param is an implicit EL object.) In the server log I have configured it to print the method parameter, but I can see that an empty string was passed-in, not "test@email

Iterate hashmap stored in Model in javascript

ぐ巨炮叔叔 提交于 2019-12-25 04:13:57
问题 While trying to iterate a map in a javascript function by passing key as below: <html> <head> <script type="text/javascript"> function demo(tmp){ <c:forEach var="user" items="${usermap}"> <c:out value="${usermap.get(\"+'tmp'+\").name}"></c:out> </c:forEach> } </script> <title>Insert title here</title> </head> <body> <h1 onclick="demo('user1')">User VO</h1> <c:forEach var="user" items="${usermap}"> Key: ${user.key} - Name: ${user.value.name} - Id: ${user.value.userid}<br/><br/> </c:forEach> <

Troubleshooting java.lang.AbstractMethodError in portlet development

不羁的心 提交于 2019-12-25 03:39:29
问题 I'm having this issue while developing portlets: Caused by: javax.servlet.ServletException: java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; I don't know anymore, what I can do. My portlet set-up is as follows: in web.xml: <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" in my jsp: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> I also have some Maven dependencies in the POM file including portlet-api 2.0, jsp-api 2.1