jsf-2

Why do we need beans.xml while working with JSF web application?

…衆ロ難τιáo~ 提交于 2020-01-13 02:12:32
问题 I started web development using JSF, after studying JSP and Servlets for a while. When you create a JSF web application you always(may be often but I am not sure if it always or not) have to create beans.xml and you don't write anything in it. But, if that file doesn't exist the JSF web app will not work. What is the reason behind that? Why we need that file? Please, detailed explanation. 回答1: Adding to the answer of Micheal; CDI is not only useful in combination with JSF because of the

JBoss Weld + java.lang.OutOfMemoryError: PermGen space

亡梦爱人 提交于 2020-01-12 13:46:28
问题 I've just switched to Weld to make use of CDI JSF 2 Beans + conversation scope. Here's my maven dependency : <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>1.0.1-Final</version> <type>jar</type> <scope>compile</scope> </dependency> Here's the entry in my web.xml : <listener> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> </listener> One thing i noticed immediately is i just need to reload my tomcat 7 for like

JBoss Weld + java.lang.OutOfMemoryError: PermGen space

雨燕双飞 提交于 2020-01-12 13:44:05
问题 I've just switched to Weld to make use of CDI JSF 2 Beans + conversation scope. Here's my maven dependency : <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>1.0.1-Final</version> <type>jar</type> <scope>compile</scope> </dependency> Here's the entry in my web.xml : <listener> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> </listener> One thing i noticed immediately is i just need to reload my tomcat 7 for like

Linking Images in CSS of a JSF Component

a 夏天 提交于 2020-01-12 10:42:09
问题 I implemented a jsf 2.0 component which should display jQuery's Datepicker. It works just fine but the images referenced in the css are not found. The *.js and the *.css are found but the links to images are not. Here's the code of my component <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"

JSF2: limiting cc:attribute to a given object type within a List

非 Y 不嫁゛ 提交于 2020-01-12 05:53:33
问题 If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example { private List<String> stringList; private List<Long> longList; // getters, setters, etc. down here } and had a custom component which accepted a List as an attribute: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf

JSF2: limiting cc:attribute to a given object type within a List

假装没事ソ 提交于 2020-01-12 05:53:13
问题 If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example { private List<String> stringList; private List<Long> longList; // getters, setters, etc. down here } and had a custom component which accepted a List as an attribute: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf

JSF2: limiting cc:attribute to a given object type within a List

与世无争的帅哥 提交于 2020-01-12 05:53:05
问题 If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example { private List<String> stringList; private List<Long> longList; // getters, setters, etc. down here } and had a custom component which accepted a List as an attribute: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf

JSF HTML5 tag tutorials / guides?

天涯浪子 提交于 2020-01-11 17:03:11
问题 I'm on the hunt for some more reading on JSF's HTML5 tag H5 . I saw IBM's JSF 2 fu articles on it , but haven't really seen much else except presentations and slide shows on 'the promises of html5' and such. Can anyone suggest some recommended technical reading ? 回答1: I'll bet that you're talking about this article. The h5 taglib just points to composite components which wraps some HTML5 specific elements. Composite components are just Facelet files which can be declared and used as a single

when i click on the p:selectBooleanCheckbox, it works but for the second click it doesn't work,why?

守給你的承諾、 提交于 2020-01-11 14:42:15
问题 I have a " p:selectBooleanCheckbox " in my xhtml page. I have inserted this code selected="true" to make it checked by default. SO when i run the page, and click for the first time it becames "unchecked" , but since then when i click on it it still unchecked , it doesn't change. So to reseume =>my p:selectBooleanCheckbox is clickable just once after that when i click on it, it doesn't change (it still unchekeced) this is the code in my xhtml page: <div class="row"> <p:outputLabel for="spec

when i click on the p:selectBooleanCheckbox, it works but for the second click it doesn't work,why?

余生长醉 提交于 2020-01-11 14:42:11
问题 I have a " p:selectBooleanCheckbox " in my xhtml page. I have inserted this code selected="true" to make it checked by default. SO when i run the page, and click for the first time it becames "unchecked" , but since then when i click on it it still unchecked , it doesn't change. So to reseume =>my p:selectBooleanCheckbox is clickable just once after that when i click on it, it doesn't change (it still unchekeced) this is the code in my xhtml page: <div class="row"> <p:outputLabel for="spec