el

EL in struts 2 not working

杀马特。学长 韩版系。学妹 提交于 2019-12-08 07:06:37
问题 I have a search form(name = studentForm) that is submitted to struts2 action which fetches data from db and returns to a JSP with a form (name = studentListForm). When I use s:property, I'm able to get a property from the action form, whereas with EL is empty. Action private int pageNumber; /** some code here **/ setPageNumber(1); public int getPageNumber() { return pageNumber; } public void setPageNumber(int pageNumber) { this.pageNumber = pageNumber; } JSP <%@ page language="java"

JSF: Resource bundle key (name) as EL expression?

会有一股神秘感。 提交于 2019-12-08 05:30:45
问题 How to make work something like that: <c:forEach items="#{bean.data}" var="key" > <h:outputText value="#{m[#{key}]}" /> </c:forEach> I need to get value from messages.properties, but dynamically using #{} expression. 回答1: Does this work? <h:outputText value="#{m[key]}" /> 来源: https://stackoverflow.com/questions/3683545/jsf-resource-bundle-key-name-as-el-expression

JSF 2.0 EL tags don't render in browser

江枫思渺然 提交于 2019-12-08 05:14:13
问题 The following is my index.html file which contains the JSF: http://pastie.org/3755252 When I choose Run as > Run on Server (Tomcat 7.0.12) in Eclipse Indigo I get a page which says only the following: You have login attempts left. The same happens in Chrome. Although after looking at the source of the page, it displayed just as I have it written in Eclipse (the previous pastie file), but it seems like it should be translated to html. This is my Member.java file: http://pastie.org/3755277 And

How to access Map in JSF

萝らか妹 提交于 2019-12-08 05:09:29
I have try to access the map in jsf using C:foreach.But i can't access that in jsf by using"#" symbol.But i can access it using "$" symbol.But i need to access to displayed using jsf component h:outputtext.My sample code is h:form binding="#{MapInJsf.initForm}"> <c:forEach items="#{MapInJsf.nameMap}" var="nameMap"> <%--<li>${nameMap.key}</li>--%> I cann access it <%--<h:outputText value="#{nameMap}"/>--%> <h:outputText value="Name2 : #{nameMap.key}"/> <h:outputText value="Last Name1 : #{nameMap.value}"/> </c:forEach> </h:form> what i do wrong and how can i access that?My Ref link is Dynamic

How to pass an argument to method from rendered h:outputText?

扶醉桌前 提交于 2019-12-08 04:26:15
问题 I am displaying a table of data from an sql query and want to render a section of code based on one of the field values from this sql query. View: records.xthml <table> <thead> <tr> <td>#{messages['table.header.id']}</td> <td>#{messages['table.header.name']}</td> <td>#{messages['table.header.date.added']}</td> <td> </td> </tr> </thead> <tbody> <a4j:repeat value="recordListBean.records" var="listedRecord" rowKeyVar="index"> <tr> <td><h:outputText value="#{listedRecord.id}</td> <td><h

Using EL in attribute of composite component

痴心易碎 提交于 2019-12-08 03:52:43
问题 My JSF custom component code: <composite:interface name="translation"> <composite:attribute name="fieldName"/> <composite:attribute name="required" default="true" /> </composite:interface> <composite:implementation> <h:inputText required="#{cc.attrs.required}" requiredMessage="Please enter #{cc.attrs.fieldName} in english"/> </composite:implementation> This works fine if I specify the required attribute as follows: <comp:translation fieldName="myTranslation" required="true" /> But does not

How to access Map in JSF

隐身守侯 提交于 2019-12-08 03:43:53
问题 I have try to access the map in jsf using C:foreach.But i can't access that in jsf by using"#" symbol.But i can access it using "$" symbol.But i need to access to displayed using jsf component h:outputtext.My sample code is h:form binding="#{MapInJsf.initForm}"> <c:forEach items="#{MapInJsf.nameMap}" var="nameMap"> <%--<li>${nameMap.key}</li>--%> I cann access it <%--<h:outputText value="#{nameMap}"/>--%> <h:outputText value="Name2 : #{nameMap.key}"/> <h:outputText value="Last Name1 : #

Item value in JSTL foreach loop not working in Portlet

…衆ロ難τιáo~ 提交于 2019-12-08 03:06:08
问题 Given the following Portlet Code: ArrayList nameList = new ArrayList(); nameList.add("Willi Willisch"); nameList.add("Seppi Seppisch"); renderRequest.setAttribute("names", nameList); And the following JSP Code: <c:forEach var="aName" items="${names}"> <tr> <td>${aName} </td> </tr> </c:forEach> Prints out: ${aName} ${aName} I don't have any clue why a $(aName) isn't evaluated. The forEach loops works, because ${aName} is printed out twice .... 回答1: <c:out value="${aName}"/> works!! But shouldn

NumberFormatException when accessing collection in JSP EL

冷暖自知 提交于 2019-12-08 02:38:03
问题 I'm using spring MVC and I want to access to my Employe's roles from my jsp file but i have this error. Here is my controller and my jsp file and also my entities : AdminStockController : @RequestMapping(value="/saveEmploye") public String enregistrerE(@Valid Employe e,BindingResult bindingResult,Model model, @RequestParam(value="roleEmploye") Long idR){ if(bindingResult.hasErrors()){ model.addAttribute("employes", metier.getAllEmployes()); return "adminEmploye"; } metier.addEmploye(e);

how to access a EL variable and pass it as an argument to a function in EL?

时光毁灭记忆、已成空白 提交于 2019-12-08 02:23:37
问题 I want to call a function on a bean with an argument passsed to it in jsp using EL. The problem is it does not allow something like: " ${teacherBean.certificationFor(${particularField}) " the thing is i want to iterate over an array and call the function certificationFor for all the values in the array passed as an argument. I am getting the values in array by: So Basically i want to do something like: ${teacherBean.certificationFor(${particularField}) but i cant do that. can i do this in any