jsf-2

JSF display HTML comment

我们两清 提交于 2020-01-22 13:48:27
问题 I am using JSF 2.0 and have defined property javax.faces.FACELETS_SKIP_COMMENTS to skip comments in JSF code because there is a lot of other code, deveploping comments etc. But I need to print some HTML comments into client's browser eg. for defining alternative conditioned stylesheet for other browsers. Please is there any way how to do it? Because all my attempts failed. 回答1: Use <ui:remove> to remove comments instead of the context parameter. 回答2: This is crude but it does work (under JSF

Figuring out why JSF getters are called when I don't expect them to be called

你。 提交于 2020-01-22 00:01:46
问题 I'm working with jsf 2 and I'm getting some behaviour which I find hard to explain or understand. I have several independent h:form s. one of which looks like this: <h:form> <h:commandButton value="#{text.General_Wipe_Now}" action="#{bean.doThate}" > <f:ajax execute="@form" render="@form" /> </h:commandButton> <h:selectBooleanCheckbox value="#{bean.ignoreErrors}">Ignore Errors</h:selectBooleanCheckbox> </h:form> My question/issue is that whenever I press the aformentioned button, I see other,

How to use view-params with JSP?

时光毁灭记忆、已成空白 提交于 2020-01-20 09:32:55
问题 I would like to use view parameters to get bookmarkable URLs with JSF 2, but I use JSPs and all the help and examples I can find, uses facelets. Here is want I have done so far: search.jsp (calling page): <t:commandLink action="..."> <f:param name="param1" value="foo"/> <h:outputText value="..."/> </t:commandLink> faces-config.xml: <navigation-rule> <navigation-case> <from-outcome>go_edit</from-outcome> <to-view-id>/views/edit.jsp</to-view-id> <redirect> <view-param> <name>param1</name>

Content Assist for JSF2 + CDI (weld) beans + Eclipse Helios

烂漫一生 提交于 2020-01-20 04:06:56
问题 Im trying JSF2 CDI (weld) beans in eclipse helios instead of ManagedBeans , but can't do the auto completion inside the expression language for my Named beans (the #{myNamedBean. Ctrl + Space } thingy) But OTOH with ManagedBeans, the content assist works well .. Is the content assist for CDI beans supported yet in Eclipse Helios? Anybody got experiences in this ? 回答1: Install JBoss tools. Then by adding <nature>org.jboss.tools.jsf.jsfnature</nature> to the natures section of the .project file

How to customize h:head when using ui:composition template?

£可爱£侵袭症+ 提交于 2020-01-19 09:56:08
问题 I am using JSF to render an HTML page. I design the page like it : <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="language" content="fr" /> <title><ui:insert name="title">My app</ui:insert></title> </h:head> <h:body> <div id="top"> <ui:include src="

Allow user to login after session times out JSF 2.0

99封情书 提交于 2020-01-17 07:57:10
问题 The requirement is to allow user to login after sitting on the login page for a long time and even after the session times out without a page refresh. Is there a way to create a new DOM whenever session times out? 回答1: There is no such way. Just set the JSF state saving method to client . This way the view will never expire. <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> This will only trade memory usage for network

Primefaces p:cache

我们两清 提交于 2020-01-17 05:40:07
问题 I'm having some problem with Primefaces p:cache component This is example how its used on testpage/index.xhtml <h:form> <p:panel header="Testsite"> <p:cache region="testsite2" key="testsite2#{user.id}#{user.defaultLanguage}"> <p:commandButton action="#{testBean.hello}" value="btn" rendered="#{testBean.renderedButton}"> </p:commandButton> </p:cache> </p:panel> </h:form> and this is back end bean @ManagedBean(name = "testBean") @ViewScoped public class TestBean { @PostConstruct public void init

Show up a panel with slide effect when there is focus on specific input box

百般思念 提交于 2020-01-17 04:04:07
问题 I need to implement (vertical slide in) show effect on a output panel when there is a focus on a textbox. (Initially the outputPanel should not be visible on screen, but when there is a focus on the input box, the outputPanel must show up with a slide in effect.) <p:inputTextarea> <p:effect event="focus" for="inputPanel" type="slide"/> </p:inputTextarea> <p:outputPanel id="inputPanel" style="display: none;" > ...... </p:outputPanel> Using: Primefaces 3.0 M3 Snapshot JSF 2.0 with Facelets 回答1:

RequestContext throws NPE from a different context than FacesContext

两盒软妹~` 提交于 2020-01-17 02:39:29
问题 Why calling RequestContext rq = RequestContext.getCurrentInstance() from a different context than FacesContext throws a NullPointerException ? I am not able to do something like : RequestContext rq = RequestContext.getCurrentInstance() //NPE is thrown if (rq != null) { .. } What I am trying to do is to retrieve a bean inside a WebFilter and call a method. This method uses above snippet; so it throws NullPointerException . Thank you for your help. 回答1: Instance of RequestContext is saved as an

Conditional Navigation of rich:dataTable using rich:dataScroller

☆樱花仙子☆ 提交于 2020-01-17 01:01:55
问题 When the user tries to switch on to the next page of the rich:dataTable using rich:dataScroller, basing on a JS condition, an Alert will be displayed. If OK'd then only the 2nd page has to be shown. If Cancel'd then the first page itself should be displayed. In richfaces3.3, there was onPageChange event on dataScroller, which is not available in richfaces 4.3. Pls suggest. 来源: https://stackoverflow.com/questions/20370046/conditional-navigation-of-richdatatable-using-richdatascroller