jsf-2

Logging the invoked managed bean action in a PhaseListener

泄露秘密 提交于 2019-12-30 07:01:05
问题 I am using Sun JSF 2.0 and wrote a phase listener extending javax.faces.event.PhaseListener . I am able to log source URI, target URI, total time and so on. But so far unable to log the ManagedBean and corresponding method that would be invoked during that client event. How can I do this? 回答1: Input components send their client ID as request parameter name in case of synchronous requests and as request parameter value of javax.faces.source request parameter in case of asynchronous (ajax)

Logging the invoked managed bean action in a PhaseListener

岁酱吖の 提交于 2019-12-30 07:01:04
问题 I am using Sun JSF 2.0 and wrote a phase listener extending javax.faces.event.PhaseListener . I am able to log source URI, target URI, total time and so on. But so far unable to log the ManagedBean and corresponding method that would be invoked during that client event. How can I do this? 回答1: Input components send their client ID as request parameter name in case of synchronous requests and as request parameter value of javax.faces.source request parameter in case of asynchronous (ajax)

How to mark other components invalid in a custom multi-field validator

青春壹個敷衍的年華 提交于 2019-12-30 06:49:45
问题 I refer to one of BalusC's answers: JSF doesn't support cross-field validation, is there a workaround? I follow the same way, and come out with code as below: in .xhtml <h:form id="form1"> <div> <p:messages globalOnly="true" display="text" /> <h:inputHidden value="true"> <f:validator validatorId="fooValidator" /> <f:attribute name="input1" value="#{input1}" /> <f:attribute name="input2" value="#{input2}" /> <f:attribute name="input3" value="#{input3}" /> </h:inputHidden> <h:panelGrid columns=

How to access the parent Naming Container of Composite?

一世执手 提交于 2019-12-30 06:49:17
问题 I have a JSP 2.0 <ui:component> , within that is a <p:dataTable> with a column that uses a Composite to render a special border about some content. Now I need to identify the <p:dataTabe> in a ajax rendered attribute that is located in the content. <ui:component> <p:dataTable id="dataTable" var="userItem" ... /> <p:column> <my:borderBox id="borderBox"> <p:commandButton action="#{userController.doDelete(userItem.id)}" value="delete" update="?????"/> <!-- How to address the dateTable? --> </my

Value Change listener not working in primefaces calendar

一世执手 提交于 2019-12-30 05:46:47
问题 I am using primefaces 3.2 and JSF 2.0 My scenario is I have file date, last date and next date in my form. When user enters file date I need to update file date value in bean so it's value can be used as minimum date in last date of attribute mindate and so in next date selection. As per my knowledge value change listener can execute at form submission so I can not use it. I have used p:ajax . But still I am not able to set file date. As file date is not set it allows user to select last date

Access JSF and Primefaces version numbers programmatically

你离开我真会死。 提交于 2019-12-30 05:00:34
问题 I use PrimeFaces 3.5.x and Mojarra JSF 2.1.x I would like to access and show the versions of both libraries programmatically. I use the versions as maven2 properties, but I hope there is an easier way to get the versions. I hope to find something like: Primeface.getVersion(); FacesContext.getCurrentInstance(); A JavaScript based solution would be fine too, since I only want to display the version on a status page. 回答1: For JSF: //returns the major version (2.1) FacesContext.class.getPackage()

com.sun.faces.renderkit.html_basic.MenuRenderer createCollection: Unable to create new Collection instance for type java.util.Arrays$ArrayList

给你一囗甜甜゛ 提交于 2019-12-30 04:43:07
问题 I'm trying to use JSF / SelectManyCheckBox tag with an enum : Here is my xhtml code : <h:form id="searchForm"> <h:panelGrid columns="2"> <h:outputText value="Searched queues" /> <h:panelGroup> <h:selectManyCheckbox layout="pageDirection" value="#{jmsErrorController.errorSearchCriteria.searchedQueues}" converter="queueConverter"> <f:selectItems value="#{jmsErrorController.completeQueueList}" /> </h:selectManyCheckbox> </h:panelGroup> </h:panelGrid> <h:commandButton action="#{jmsErrorController

Is primefaces live scrolling compatible with Lazy loading

[亡魂溺海] 提交于 2019-12-30 03:32:07
问题 I have a datatable where huge data sets need to be displayed.So i decided to go with primefaces live scrolling.I also got to know that to improve datatable performance with huge data sets we need to implement lazy loading.With reference to the primefaces showcase example here,what i observed that there in the statement , a LazyDataModel needs to be implemented to query the datasource when pagination, sorting, filtering or live scrolling happens live scrolling is mentioned but i cannot see the

How to use .jsf extension in URLs?

南笙酒味 提交于 2019-12-30 03:14:08
问题 I'm developing a JSF 2 web application. For prestige purpouses I would like that every URL ends with .jsf extension. Now it ends with .xhtml . If I change it directly to .jsf in web browser address bar, then a HTTP 500 error is shown. How can I set it to .jsf ? 回答1: The URL pattern of JSF pages is specified by <servlet-mapping> of the FacesServlet in web.xml . As you mentioned that .xhtml works fine, you have apparently configured it as follows: <servlet> <servlet-name>Faces Servlet</servlet

Linked ViewScoped beans lead to memory leaks

[亡魂溺海] 提交于 2019-12-30 03:13:29
问题 In our JavaEE6 project (EJB3, JSF2) on JBoss 7.1.1, it seems we have a memory leak with @ViewScoped beans. Last tree days I've spent time on this issue investigation. So i've created simple project with two pages to guarantee that after first page leaving @ViewScoped bean will be released. <context-param> //web.xml <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name