jsf-2

JSF 2.0 Facelets template inheritance

假如想象 提交于 2019-12-21 20:14:07
问题 This is an extended repost of JSF 2.0 Facelets nested templates inheritance, which was loosely asked and formally answered. Here is my easy_to_earn question: template_base.xhml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head><!-- header stuff --></h:head> <h:body> <!-- Lot of html here --> <div id="main"> <ui:insert name="main_content"/> </div> <!-- Lot of html here --> </h:body> </html> Next, I want

JSF with facelets in Tomcat7

巧了我就是萌 提交于 2019-12-21 20:00:07
问题 I am trying to deploy a JSF 2.0 application with Facelets 1.1.14 to Tomcat7. I am getting the following exceptions: INFO: Initializing Mojarra 2.0.0 (FCS b23) for context '/AdminUI' 3 Aug, 2011 7:44:32 PM com.sun.faces.spi.InjectionProviderFactory createInstance INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed. 3 Aug, 2011 7:44:33 PM com.sun.faces.config.ConfigManager initialized INFO:

jsf difference between implicit objects cc and component

隐身守侯 提交于 2019-12-21 19:53:09
问题 Maybe this is a dumb question, but I use cc to refer to the composite component, for instance cc.attrs.randomAttr but I have also seen the component implicit object and I have used it because I was told to but I don't really understand what it is for. Can anyone explain please? 回答1: cc refers to the top level composite component that is being processed at the time of evaluation. component simply is the ui component being processed. So when inside a composite component, cc refers to the

<meta http-equiv=“X-UA-Compatible” content=“IE=8” /> ignored in RichFaces webapp

◇◆丶佛笑我妖孽 提交于 2019-12-21 19:28:12
问题 I'm using JSF 2.0 and RichFaces 3.3.3 on Glassfish 2.1. I've created a web application with a modal panel that works great in my computer (local server). Because of IE9 incompatibility of the specific RichFaces version, I'm using the X-UA-Compatible: IE=8 meta tag in my HTML head: <meta http-equiv="X-UA-Compatible" content="IE=8" /> The modal panel look like this when I deploy in my local environment: But when I deploy in the production server, I've a problem. If I use IE with compatibility

Primefaces Calendar component & date conversions

自古美人都是妖i 提交于 2019-12-21 18:02:04
问题 I am using primefaces' calendar component. I have a corresponding string in VO. While saving in database, I need to convert the string to java.sql.date. xhtml : <p:calendar value="#{articlePromo.startDate}" id="vendorStartDateInputTxt" pattern="dd/MM/yyyy" mode="popup" showOn="button"> <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" /> </p:calendar> The startDate (String) has the value : Sat Apr 21 05:30:00 IST 2012 Java method to get sql Date public static Date

How to refresh parent jsf page from richfaces popup

十年热恋 提交于 2019-12-21 17:50:24
问题 I have a JSF page with a few fields. I followed this tutorial from BalusC and all is good. I then added RichFaces support to it, which is working fine. I can see popups etc working. Now what I am trying to do is that once a person has been registered, I want to show the name in the popup (this is also fine I can see that in the popup). Then I want to be able to change that name inside the popup and have that reflected in the parent, but I have no clue how to do that. Please have a look. XHTML

Change the image of a JSF commandbutton with DHTML event onmouseover

烂漫一生 提交于 2019-12-21 17:49:29
问题 I want to change the image of my button when the mouse goes over it. I rode the DHTML event onmouseover, can do that for me, but how? Do i need to create a javascript also for it? What should i do to make it work? This is my current code: <h:commandButton class="btn" image="/resources/images/mainbtn1.png" onmouseover="/resources/images/mainbtn2.png"/"> 回答1: The <h:commandButton image="foo.png"> generates a HTML <input type="image" src="foo.png"> . The onmouseover attribute (like as all on*

what is the purpose of including empty beans.xml in CDI implemenations projects?

て烟熏妆下的殇ゞ 提交于 2019-12-21 17:43:38
问题 I am using weld ,a RI of CDI as dependency injection component in my JSF-EJB-JPA web app. I see in my project we have empty beans.xml in META-INF/beans.xml in ejb.jar and WEB-INF/beans.xml in my WAR. I don't get it why we need to keep empty beans.xml when there nothing defined in that file? 回答1: CDI needs to scan all the classes of a bean archive at start-up and fire a bunch of events because almost any class is automatically a managed bean (read more here), even if it doesn't have any

Glassfish taking 20s to do hot deployment, is that right?

痴心易碎 提交于 2019-12-21 17:24:47
问题 I'm working in a JSF project with Eclipse and Glassfish 3.1.2 . Every time I did a minor change and save it, Glassfish do the hot deployment , but is taking too much time to do that, about 20s , at least. Can I do something do deacrease this time ? Is horrible develop something where you have to wait all time time everytime I change something. UPDATE This is how my project settings. Just open the folder below, this surprise me, is this so many .jar files, is this correct ? And this one: My

How to detect whether user have reached a page by JSF navigation rule redirect or by typing the URL?

只愿长相守 提交于 2019-12-21 17:24:39
问题 Is there any way in JSF which can be used to find out whether an user reached a page by the Navigation rule of the JSF or user has typed the URL directly to reach that page? Actully I want to prevent user to go to a page directly by typing the URL for that directly in the Browser, rather I want to restrict the user to use the application navigation bar to go to an page. 回答1: There is a way: check the presence of the referer header (yes, with the misspelling). if (externalContext