el

How do I append a quote to a string in JSF EL

社会主义新天地 提交于 2019-12-11 04:46:15
问题 I got a JSF page with a list of partners. The page is opened in two modes, default and choice mode, that is set with choiceMode request parameter. When choiceMode parameter is undefined it's just a list where I can click a row and it will navigate to the page with the row's details If choiceMode="1" it means that the page is opened in an <iframe> , nested in a parent window When the user clicks a row, it won't open the row's page, but run a JavaScript sending the chosen row parameters to the

Issue with evaluating ${error} in Spring

你说的曾经没有我的故事 提交于 2019-12-11 04:33:10
问题 I have defined an expression as ${error} in my jsp page , and when i am printing the value of the same using <c:out value='${error}' /> , the output is ${error} . Whereas the expression is not being evaluated. I have included the jstl-1.2-api and jstl1.2-impl jar files in my lib directory , and also included the taglib <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> in my JSP. Can anybody please help. 回答1: You need to ensure that your web.xml is declared conform at least

How to evaluate a dynamic/nested Spring property placeholder expression?

最后都变了- 提交于 2019-12-11 04:29:59
问题 I'm working on a JSP tag. Here is the old line that starts looping through items in a model: <c:forEach var="toc" items="${requestScope[formKey].model.sharingTocs}"> But the code has been refactored so the model path ( model.sharingTocs above) is now dynamic rather than fixed. It is now passed into the tag via a JSP @attribute : <%@attribute name="path" required="true"%> So ${path} now evaluates to "model.sharingTocs" . How can items now be assigned? 回答1: Well. Good question. This is a

ServletException When open my application

南笙酒味 提交于 2019-12-11 03:59:07
问题 Iam using JSF 2.1 mojjara and primefaces 3.5 with WAS7 i complete the integration the FacesServlet is loaded from my JSF jar and the other component the problem that iam facing seems now is the following : 回答1: Unless you've added the Mojarra 2.1 jars as a shared library in WAS 7, you'll get the baked-in WAS version (which I think is 1.2). Then when you deploy the application you'll have to configure it to use that shared library. 来源: https://stackoverflow.com/questions/19497633

Two dimensional arraylist with c:foreach jstl tag

随声附和 提交于 2019-12-11 03:45:23
问题 I'm using a two dimension arraylist in two imbricated JSTL <c:forEach> : <select multiple size="30"> <c:forEach var="uri" items="${defaultResult}" varStatus="iterator"> <c:forEach var="cate" items="${defaultResult[iterator.index]}"> <option value="${defaultResult[iterator.index][0]}"> ${cate}[1]</option> </c:forEach> </c:forEach> </select> but the indexes seem not to be working, for example the values returned by ${cate}[1] are all the values of any dimension followed by [1] If you have any

BigDecimal in JSTL, divide by int or double returns integer

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:11:45
问题 <fmt:formatNumber var="instAmount" value="${invoice.amount / offer.getTotalInstallments()}" minFractionDigits="2" /> Where amount is BigDecimal in Java and totalInstallments is int . I tried by setting totalInstallments to double but nothing changes. It returns an Integer , it behaves as when you divide two integers in Java, you get an integer. Am I missing something or is there a workaround? 回答1: The easiest solution is to just do this calculation in the controller/servlet and use the result

Struts 2 and Spring with EL - What are the different types of printing a variable [duplicate]

混江龙づ霸主 提交于 2019-12-11 02:45:24
问题 This question already has answers here : what's the difference between #{} ${} and %{}? (2 answers) Closed 5 years ago . I am obliviously new to EL (with Struts 2 specifically). I am updating the current code and I see different types of entries. Whats the difference? <s:property value="%{obj.field}"/> // With %{} <s:property value="obj.field"/> // Without %{} <s:property value="%{#obj.field}"/> // with %{} and prefixed # ${obj.field} // with ${} // any other types I may have missed... 回答1:

enums are being interpreted as Strings

别来无恙 提交于 2019-12-11 02:17:52
问题 I am setting a sessionScope object when a user logs in, and that bean object is composed of a couple of other beans. One of the properties for these beans was an enum, but I found out that EL cannot get the properties of an enum class, and that it can only get the properties of a java bean object. So I decided to make a bean class for the enum, and have the enum nested in that bean class. the java bean that I made to replace the enum so that I can get its values with EL looks something like

How to send a document data souce to a custom control in XPages?

和自甴很熟 提交于 2019-12-11 01:37:51
问题 I have this computed text bound to a the body field using EL <xp:text escape="true" id="computedField1" value="#{doc.Body}"></xp:text> Now I need to store this computedField in a Custom Control and send in the doc? What property definition should I use, and how do I reference the compositeData to the Body field in the cc thanks Thomas 回答1: Create a custom property on your Custom Control called dataSource and set the type to com.ibm.xsp.model.DataSource Create a second custom property called

How can I update Websphere 7 to use EL2.2?

假如想象 提交于 2019-12-11 00:30:04
问题 This is what I have done: Following this post from Lincoln Baxter I downloaded el-api-2.2.jar and el-impl-2.2.jar Then created isolated shard library and added them there. We are using Myfaces so in web.xml added this bit <context-param> <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name> <param-value>com.sun.el.ExpressionFactoryImpl</param-value> </context-param> This is the issue: I do not think it getting picked up and application is still using one out the the box apache based.