el

why jsp fires a PropertyNotFound?

青春壹個敷衍的年華 提交于 2019-12-10 15:58:38
问题 Writing in a JSP: ${a.b.c} throws 'c' PropertyNotFound, but writing <s:property value="#a.b.c"/> works fine. I'd appreciate if someone can explain why ${a.b.c} doesn't work? UPDATED: In the same JSP, accessing to another bean f such as ${a.f.d} it finds d correctly. I have checked that property c in ${a.b.c} exists. 回答1: Nice Question.If you have not specified getter setters for property c in b then this error will occur Propertynotfound for ${a.b.c} But <s:property value="#a.b.c"/> will not

JSF composite:attribute with f:attribute conversion error

旧时模样 提交于 2019-12-10 15:45:34
问题 I'm implementing a JSF component and need to conditionally add some attributes. This question is similar to a previous JSF: p:dataTable with f:attribute results in "argument type mismatch" error, but with a completely different error message, so I raised a new question. <composite:interface> <composite:attribute name="filter" required="false" default="false" type="java.lang.Boolean"/> <composite:attribute name="rows" required="false" default="15" type="java.lang.Integer"/> ... </composite

immediate vs deferred evaluation for reading bean properties

限于喜欢 提交于 2019-12-10 15:44:17
问题 I am still unclear about the use of JSF immediate evaluation vs deferred evaluation , mainly because the online examples almost never seem to use the former method. I have seen a fair amount of JSF Examples, including those contained in http://docs.oracle.com/javaee/6/tutorial/doc/, and I am a bit puzzled by the fact that I almost only ever see examples with #{} instead of ${} , even when all we're doing is reading a bean property. From my understanding of these two uses, ${} can only be used

tomcat7 and EL in a jsp page; pageContext.request.contextPath empty?

纵饮孤独 提交于 2019-12-10 15:17:26
问题 My JSP page contains: <script> var bt_wd40_appurl = "${pageContext.request.contextPath}"; </script> view/source shows "" for the value. No errors I've found so far. my web.xml specifies version 2.5. 回答1: It will be empty if you deployed the webapp on ROOT. See also its javadoc (emphasis mine): getContextPath java.lang.String getContextPath() Returns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts

How to convert int to char in JSP expression language?

自作多情 提交于 2019-12-10 14:48:01
问题 I need to display incremented single characters to denote footnotes in a table of data in a JSP. In Java I would normally have a char variable and just increment it, or convert an int to a char by casting it (e.g. (char)(i + 97) to convert a 0-based index to a-z). I can't figure out how to do this in expression language short of writing my own JSTL function. Does anyone know how to convert an int to char in EL? Or how to increment a char variable in EL? Or possibly even a better technique to

Accessing the expression language in javascript of a jsp page

我只是一个虾纸丫 提交于 2019-12-10 14:44:32
问题 I have a "jsp" file. In that file I have "Javascript" scripting. Within <script> tags,only javascript is allowed but, how is "Expression Language" executed? <body> <script type="text/javascript"> var b=${requestScope.name}; </script> </body> 回答1: Executed. As "Expression Language" is executed on the server side the statement ${requestScope.name} executed at server side and its value is available to JavaScript at client side. now at the client side the line becomes var b='corresponding

JSF 2.2 interpret empty string submitted values as null not working

佐手、 提交于 2019-12-10 13:27:53
问题 I have migrated from Java EE 6 to Java EE 7, and now with JSF 2.2 the context param INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL seems not work. In JSF 2.1 I set it to "true" and it works perfectly, but now I get always blank strings. <context-param> <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> <param-value>true</param-value> </context-param> Can anyone say something about it? 回答1: The same happens with glassfish 4 with the latest Mojarra-2.2.5 as

JSPG0122E: Unable to parse EL function in Websphere 7

自古美人都是妖i 提交于 2019-12-10 11:18:15
问题 I am moving a web application to Websphere 7 and I am running into an error with my JSP page. JSPG0227E: Exception caught while translating /WEB-INF/jsp/snet/destinationTripReport.jsp: /WEB-INF/jsp/snet/destinationTripReport.jsp(211,8) --> JSPG0122E: Unable to parse EL function ${destForm.flightTable.get(loop.index).tripId}. The portion of the JSP where the error is coming from looks like this. <c:forEach items="${destForm.flightTable}" var="entry" varStatus="loop"> <!-- content --> <tr class

another jsf <f:selectItems> itemValue and message bundle question

杀马特。学长 韩版系。学妹 提交于 2019-12-10 10:55:40
问题 i have a selectOneMenu with selectitems. if i use <f:selectItem itemValue="3" itemLabel="#{hrBundle['phoneType3']}"/> it works well, displaying the localized label. i have more options inside a List and when i use f:selectItems, it stops working. this code: <f:selectItems value="#{values}" var="item" itemLabel="#{hrBundle[item.label]}" itemValue="item.value"/> shows the key('phoneType3') as label, and even <f:selectItems value="#{values}" var="item" itemLabel="#{hrBundle['phoneType3']}"

Use an EL expression to pass a component ID to a composite component in JSF

寵の児 提交于 2019-12-10 10:32:39
问题 Problem: I am passing an EL expression to a composite component, but the EL expression is being evaluated from inside the composite component, rather than before. The intention being that the EL expression evaluates to a string with is sent to the composite component. I have a composite component, MenuTable : <cc:interface> <cc:attribute name="model" type="nz.co.tradeintel.web.MenuTable"/> <cc.attribute name="updateId" /> </cc:interface> <cc:implementation> <h:panelGroup id="menuTable">