facelets

Mixing JSP and XHTML (Facelets) in JSF2 Project - possible?

那年仲夏 提交于 2019-11-30 13:05:02
I have a client who wants to use JSF2 and they like that XHTML is now the default (Facelets). However, they have a huge amount of "legacy" JSP from their JSF1.x codebase. I know it's probably not desirable, but will it be possible to support a mix of both in JSF2, at least for a transition period whilst they port? I know it was possible to mix the two in JSF1.x, but I can't find any information about this in JSF2. I've googled hard but naturally all the JSF2 focus is on Facelets. Also my brief attempt at mixing (I'm not an expert at JSF!) has led to failure. This is answered in the Facelets

Mapping JSF .xhtml files to no extension

前提是你 提交于 2019-11-30 13:01:08
In JSF I can map the Faces Servlet to various URL patterns. E.g. to *.xhtml . What I want however is map the Faces Servlet to no extension. Meaning, if I have a page customers.xhtml in my web root, I would like to request this using http://example.com/customers . I looked at the question How do I configure JSF url mappings without file extensions? and this works to some degree, but it requires me to map each and every file I have individually (correct me if I'm wrong). How can I map all my .xhtml files in one go to the Faces Servlet without having to map them individually? BalusC That's not

Whats the correct way to create multiple instances of managed beans in JSF 2.0

谁说我不能喝 提交于 2019-11-30 08:41:32
问题 If I want to create more than one instance of managed bean in JSF 2.0, under different names in the same scope, how should I proceed? Ideally, I want the equivilant to (for example): @ManagedBeans({name="myManagedBean1",name="myManagedBean2"}) @RequestScoped public class MyManagedBean { } Thanks .. 回答1: You can't. It technically also doesn't make much sense. You're probably looking for a solution in the wrong direction for the particular functional requirement. Your best bet is to have a

JSF - Get the SessionScoped Bean instance

故事扮演 提交于 2019-11-30 07:16:54
I have this configuration on my web application. 2 beans : 1° Bean - It checks the login; @ManagedBean(name="login") @SessionScoped public class Login { private String nickname; private String password; private boolean isLogged; public String getNickname() { return nickname; } public void setNickname(String newValue) { nickname=newValue; } public String getPassword() { return password; } public void setPassword(String newValue) { password=newValue; } public void checkLogin() { ... i check on db the nickname and the password ... if(USER EXIST) { isLogged=true; } else { isLogged=false; } return

Sorting is not working in datatable in PrimeFaces?

萝らか妹 提交于 2019-11-30 07:08:22
问题 Sorting is not working in datatable in PrimeFaces. Please suggest. See below my .xhtml file <h:form> <p:dataTable style="width: 60%" id="dt1" value="#{bean.list}" var="entry" first="0" paginator="true" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" emptyMessage="No cars found with given criteria" > <f:facet name="header"> <h2>Cars View</h2> </f:facet> <p:column

What are the differences between JSP and Facelets? [duplicate]

谁都会走 提交于 2019-11-30 06:40:19
This question already has an answer here: Why Facelets is preferred over JSP as the view definition language from JSF2.0 onwards? 2 answers I just started reading the Java EE 6 Tutorial , and I'm a little confused! I knew about JavaServer Pages (JSP), and even did some coding during my undergraduate studies. But now, in this tutorial, I don't see anything about JSP. Instead I read about Facelets, a new View Definition Framework (as it is described in this tutorial). I searched a little bit over the Internet to clarify the distinction between JSP and Facelets, and I came across with this post

<ui:debug/> tag not working in Facelets (JSF 2.0)

风格不统一 提交于 2019-11-30 03:23:15
I am doing a project using JSF 2.0 and Facelets. I have read documentations that the <ui:debug/> tag gives valuable troubleshooting information upon pressing CTRL-SHIFT-D. But this never works for me. Please anyone tell me what am I missing. (I tried with various hotkeys, still no success. eg: <ui:debug hotkey="a"/> ) BalusC Ensure that you pick a key which isn't reserved by the webbrowser itself. In case of Firefox, a good choice is x . <ui:debug hotkey="x" /> See also: how to debug JSF/EL Unrelated to the problem, I recommend to add a rendered attribute to ensure that it won't pop in a

<c:if test> seems to always evaluate true in JSF2 Facelets

半腔热情 提交于 2019-11-30 02:45:54
I am using JSF2 on Facelets. I define an <ui:param> in a page: <ui:composition template="/WEB-INF/templates/ui.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" > <ui:param name="title" value="OnAir WebDemo" /> ... </ui:composition> in the ui.xhtml template I have: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" > <c:if test=

Partial page update when navigating (PrimeFaces ajax)

有些话、适合烂在心里 提交于 2019-11-29 23:54:40
问题 I have done a basic JSF app, using facelets templates. My template is as follows: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head> <!-- Links to CSS stylesheets... --> <title><ui:insert name="title" /> - FManager</title> </h:head> <h:body> <div id="wrapper"> <div id="header"> <b>FManager</b> Application </div> <div id="content"> <p:growl id="growl" /> <ui:insert

Mixing JSP and XHTML (Facelets) in JSF2 Project - possible?

左心房为你撑大大i 提交于 2019-11-29 18:37:30
问题 I have a client who wants to use JSF2 and they like that XHTML is now the default (Facelets). However, they have a huge amount of "legacy" JSP from their JSF1.x codebase. I know it's probably not desirable, but will it be possible to support a mix of both in JSF2, at least for a transition period whilst they port? I know it was possible to mix the two in JSF1.x, but I can't find any information about this in JSF2. I've googled hard but naturally all the JSF2 focus is on Facelets. Also my