English 中文(简体)
JSF 2 : can EL do such as this?
原标题:JSF 2 : can EL do something like this?
  • 时间:2010-12-28 10:12:25
  •  标签:
  • jsf
  • jsf-2
  • el

这项工作:

<h:outputText value="Active Locale : " /> 
#{view.locale}

但是,如何用EL实现这样的东西?

<h:outputText value="Active Locale Decimal Separator : " /> 
#{new DecimalFormat(view.locale).decimalFormatSymbols.groupingSeparator}
最佳回答

我想知道你在<条码>中究竟指的是什么?

The standard java.text.DecimalFormat has neither a getGroupingSeparator nor groupingSeparator field or method. So I m a bit in the dark what you re actually trying to achieve. Would you like to have the _ printed? So if the local is en_uk, that the result is "_"?

无论你真的希望如何,你们都可以通过建设自己的EL functon来做很多事情。 在EL中,它希望这样:

#{my:someFormatting(view.locale)}

部分 格式随后作为静态 Java法实施,然后由你指定自己的名称空间(“米”)。 如果你需要的话,研究辅导,帮助你做到这一点。

还有少数标准EL功能可供面对面使用。 这些职能由以下名称空间界定:

xmlns:fn="http://java.sun.com/jsp/jstl/functions"

视你确实需要多少帮助。

问题回答

暂无回答




相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签