facelets

Which XHTML files do I need to put in /WEB-INF and which not?

那年仲夏 提交于 2019-11-26 00:20:19
问题 After these questions: https://stackoverflow.com/questions/8589315/jsf2-dynamic-template Dynamic ui:include How can I retrieve an object on @WindowScoped? How can I check if an object stored with @WindowScoped is stored correctly? ICE Faces and error in creation of a bean in WindowScoped that I wrote all to resolve a \"stupid\" issue for the JSF2 framework, the fact that I can\'t link directly to a page stored in a /WEB-INF subfolder. After that I did some research on Google and Stackoverflow

How to use JSF generated HTML element ID with colon “:” in CSS selectors?

喜你入骨 提交于 2019-11-26 00:13:18
问题 I\'ve been working with a simple Java EE project using JSF. <h:form id=\"phoneForm\"> <h:dataTable id=\"phoneTable\"> </h:dataTable> </h:form> I tried to set CSS via #phoneTable { ... } , however it doesn\'t work. Upon inspection of the HTML source in client side, it appears that the JSF-generated HTML table gets a client ID in form of id=\"phoneForm:phoneTable\" . I can\'t apply CSS via #phoneForm:phoneTable { ... } , because the colon indicates the start of a pseudoselector and causes an

When to use <ui:include>, tag files, composite components and/or custom components?

三世轮回 提交于 2019-11-25 23:56:34
问题 I started using JSF 2.0 with Facelets recently and got puzzled by new composite components knowing existing <ui:include> and other templating techniques offered by Facelets 1.x. What is the difference between those approaches? Functionally they seem to offer about the same: <ui:param> vs <cc:attribute> , <ui:insert> + <ui:define> vs tag files, reuse of the existing templates. Is there anything besides syntax and clear interface specification in case of composite components? Could performance

How to send form input values and invoke a method in JSF bean

跟風遠走 提交于 2019-11-25 22:58:35
问题 I am building a JSF application. I defined the GUI and did the select statements query the database using select. Now I must do the insert statements, but I don\'t know how to read the value of a JSF input component like <h:inputText> and send it to my bean which performs the insert. Should <h:inputText> value be mapped through faces-config.xml , so I can have it in my Java code? 回答1: You need to put all <h:inputXxx> / <h:selectXxx> components in a <h:form> and bind their value attribute to a

How to reference CSS / JS / image resource in Facelets template?

痞子三分冷 提交于 2019-11-25 22:55:27
问题 I\'ve done tutorial about Facelets templating. Now I\'ve tried to create a page that isn\'t in same directory as the template. I\'ve got problems with page style, because of styles are referenced with relative path like so: <link rel=\"stylesheet\" href=\"style_resource_path.css\" /> I can use absolute referencing by starting with / : <link rel=\"stylesheet\" href=\"/project_root_path/style_resource_path.css\" /> But this will bring me troubles when I\'ll be moving application to a different

EL proposals / autocomplete / code assist in Facelets with Eclipse

倖福魔咒の 提交于 2019-11-25 22:53:27
I tried to activate EL proposals in a Facelets page, but when I hit Ctrl+Space, it doesn't work. I managed to activate JSF tag proposals thank to other questions, but EL proposals aren't working. How can I activate this feature in Eclipse? Is it a known issue? For example: <h:inputHidden id="id" value="#{Ctrl+Space not working!}"/> Eclipse doesn't support this out the box. Even the support in JSP is very limited. Only the properties of <jsp:useBean> and managed beans hardcoded as <managed-bean> in faces-config.xml are available by autocomplete. There are however plugins which supports EL

JSTL in JSF2 Facelets… makes sense?

依然范特西╮ 提交于 2019-11-25 22:51:16
问题 I would like to output a bit of Facelets code conditionally. For that purpose, the JSTL tags seem to work fine: <c:if test=\"${lpc.verbose}\"> ... </c:if> However, I\'m not sure if this is a best practice? Is there another way to achieve my goal? 回答1: Introduction JSTL <c:xxx> tags are all taghandlers and they are executed during view build time , while JSF <h:xxx> tags are all UI components and they are executed during view render time . Note that from JSF's own <f:xxx> and <ui:xxx> tags

Why do I need to nest a component with rendered=“#{some}” in another component when I want to ajax-update it?

大憨熊 提交于 2019-11-25 21:57:52
问题 So I\'ve found a few answers close to this, and I\'ve found enough to fix the problem I had. But even so, I\'m curious as to understand the workings around this. Let me illustrate with an example : I have a facelet .xhtml page that looks like this (shortned). <h:form id=\"resultForm\"> <h:panelGroup class=\"search_form\" layout=\"block\"> <h:inputText id=\"lastname\" value=\"#{search.lastname}\"/> <h:commandButton action=\"#{search.find}\" value=\"Find\"> <f:ajax execute=\"lastname\" render=\

Sometimes I see JSF URL is *.jsf, sometimes *.xhtml and sometimes /faces/*. Why?

冷暖自知 提交于 2019-11-25 21:53:28
问题 Been try to learn JSF, and sometimes I see the URL is *.jsf and sometimes is *.xhtml or /faces/* . Can someone fill my knowledge, please? When I create a JSF using Facelet, the file extension is .xhtml , so where does .jsf URL extension come from? 回答1: The .jsf extension is where the FacesServlet is during the JSF 1.2 period often mapped on in the web.xml . <servlet-mapping> <servlet-name>facesServlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> The .xhtml extension is

How to ajax-refresh dynamic include content by navigation menu? (JSF SPA)

≯℡__Kan透↙ 提交于 2019-11-25 21:47:09
问题 I\'m just learning JSF 2 thanks to this site I had learned a lot in such a short time. My question is regarding how to implement a common layout to all my JSF 2 pages and have only the content part of the page refresh not the whole page whenever I click a link/menu from a different panel. I am using the Facelets approach it does what I want except that each time I click a link from a panel (e.g. menu items from left panel) the whole page is refreshed. What I am looking for is a way to refresh