el

Get rid of that silly space eclipse generates when you open an EL expression

雨燕双飞 提交于 2019-12-04 02:38:04
When I use an EL expression in Eclipse, I naturally begin by typing ${ . Eclipse, wanting to help out a little, places a close brace } afterward. However, there's a space between them. So if I want ${user.name} I type ${ , followed by user.name but my end result is ${user.name } - that extra space drives me bonkers. I've looked through all the menus and cannot find where this is defined. Clearly I haven't looked through well enough, because it has to be in there. How can I eliminate... no, eradicate , this space? My Eclipse info: Version: Juno Service Release 2 Build id: 20130225-0426 You can

Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver

风流意气都作罢 提交于 2019-12-04 02:31:22
I am trying to integrate Spring into a JSF application. In faces-config.xml , I have included this: <application> <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> but it shows a weird warning which I can't get rid of: Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver Any ideas? From the spring documentation , you will see that for org.springframework.web.jsf.el.SpringBeanFacesELResolver: delegates to the Spring's 'business

How to dynamically generate id in dataTable using ui:repeat tag

╄→гoц情女王★ 提交于 2019-12-03 22:16:17
问题 I am using ui:repeat tag which render images. I have five images i want that on each iteration my image get ids like image1, image2, image3.... imagen. I tried this but it is not working. <div id="imageGallery"> <ui:repeat value="#{countryPages_Setup.images}" var="image" varStatus="status"> <tr> <td> <a href="javascript:void()" class="launchLink"> <p:graphicImage id="image#{status.index}" //problem value="/resources/images/#{image}" width="100" height="100" rendered="#{countryPages_Setup

How do I check two conditions in one <c:if>?

自作多情 提交于 2019-12-03 18:26:19
问题 How do I check two conditions in one <c:if> ? I tried this, but it raises an error: <c:if test="${ISAJAX == 0} && ${ISDATE == 0}"> 回答1: This look like a duplicate of JSTL conditional check. The error is having the && outside the expression. Instead use <c:if test="${ISAJAX == 0 && ISDATE == 0}"> 回答2: If you are using JSP 2.0 and above It will come with the EL support: so that you can write in plain english and use and with empty operators to write your test: <c:if test="${(empty object_1

Is @Produces more efficient that a getter in an EL expression

℡╲_俬逩灬. 提交于 2019-12-03 18:18:07
问题 I'm wondering which of those two code snippets is more efficient. First one In userSearch.xhtml : <rich:dataTable var="user" value="#{userSearchResultList}" rendered="#{not empty userSearchResultList}"> ... </rich:dataTable> In UserSearchAction.java : @Produces @RequestScoped @Named("userSearchResultList") public List<User> getResultList() { return resultList; } Second one In userSearch.xhtml : <rich:dataTable var="user" value="#{userSearchAction.resultList}" rendered="#{not empty

How to show JSF components if list is not null and has size() > 0

倾然丶 夕夏残阳落幕 提交于 2019-12-03 16:55:54
问题 How do I show JSF components if a list is not null and it has a size() > 0 ? 回答1: EL offers the empty operator which checks both the nullness and emptiness of an object. Thus, this should do: <h:dataTable value="#{bean.list}" var="item" rendered="#{not empty bean.list}"> No need for a clumsy double check on both null and size() as suggested by other answers. See also: How do I display a message if a jsf datatable is empty? Conditionally displaying JSF components 回答2: use rendered attribute.

JSF leaking memory through EL and composite components

拥有回忆 提交于 2019-12-03 13:13:14
Note: I'm using mojarra 2.1.20 and rich faces 4.2.2. I've analyzed a heapdump and I've noticed that EL expressions reside in LRUMap in the session. Does anyone know why and what to do to avoid it? The problem I have is related to a composite component containing following line: <rich:select ... valueChangeListener="#{cc.listValuesChangeListener}" with backing bean my.package.MultiComboSelection. Obviously my.package.MultiComboSelection has a method defined named listValuesChangeListener. The problem I see is that LRUMap contains ContextualCompositeMethodExpression (representation of the

Error : javax.el.PropertyNotFoundException: Target Unreachable, 'null' returned null [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-03 12:18:29
问题 This question already has answers here : Identifying and solving javax.el.PropertyNotFoundException: Target Unreachable (14 answers) Closed 4 years ago . I got this error below when I was running my JSF page. javax.el.PropertyNotFoundException: Target Unreachable, 'null' returned null.. Warning: /createStaff.xhtml @33,125 value="#{staffBean.staff.firstName}": Target Unreachable, 'null' returned null javax.el.PropertyNotFoundException: /createStaff.xhtml @33,125 value="#{staffBean.staff

JSP EL and autoCompletion

一世执手 提交于 2019-12-03 11:07:20
In my servlet: request.setAttribute("list", myList); In my Jsp: <c:forEach var="item" items="${list}"> ${item.name} and ${item.address} </c:forEach> How do I get autocompletion for item.name and item.address in IDE (IntelliJ)? Can I use <jsp:useBean> for any other feature to make the type of 'item' explicit? For IntelliJ, you can use comment annotations, such as this: <%--@elvariable id="list" type="java.util.List<your.item.class.Here>"--%> To get this automatically, IntelliJ should be coloring ${items} as a warning, since it wont have any idea what it is. Click on it and when the lightbulb

Concat two String in JSF EL expression [duplicate]

时间秒杀一切 提交于 2019-12-03 10:32:23
问题 This question already has an answer here : How to concatenate Strings in EL expression? (1 answer) Closed 4 years ago . I have the following el expression: <af:outputText value="#{viewArticle.publish ? ('Publish on ' + viewArticle.publishDate + ' by ' + viewArticle.publishFirstName + ' ' + viewArticle.publishLastName) : 'Draft version'}"/> But I am getting java.lang.NumberFormatException: For input string: "Publish on " How can I join the string? 回答1: You can use the String.concat function: