jsf-2

Show success message and then redirect to another page after a timeout using PageFlow

ε祈祈猫儿з 提交于 2019-12-12 07:56:43
问题 How can I show a success message and then redirect the user to another page after a timeout of e.g. 5 seconds? I need this for the login page after a successful login. I tried the following and I can see the warning message on login failure, but not the success message on login success. It shows immediately the target page. public String check(){ if (username.equals("test") && password.equals("test")) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY

Is It Possible to Bind An HTML5 Component ( <input type=“date”>) To A Managed Bean Property?

纵然是瞬间 提交于 2019-12-12 07:33:18
问题 I would like to use the new HTML5 <input type="date"> and bind its value to a managed bean: <input type="date" value="#{bean.date}"/> I want to do this, because I like this more than the one offered by PrimeFaces. How can I achieve this? 回答1: This is only possible since JSF 2.2. This feature is known as "passthrough elements". <html xmlns:jsf="http://xmlns.jcp.org/jsf"> ... <input type="date" jsf:value="#{bean.date}" /> Alternatively, use "passthrough attributes". <html xmlns:a="http://xmlns

h:link/h:button outcome methods automatically called during page load without any clicks

隐身守侯 提交于 2019-12-12 07:27:52
问题 I have 3 pages with 3 links that I tried implementing with h:link or simply an <a> tag. But in both cases the methods connected to these links are getting called whenever I navigate to the page. Here's the <a> tag implementation: <a href="#{bean.gotoMySrchie()}"> <h:graphicImage library="images" name='vo2/FavPlus.png' /> </a> <a href="#{bean.gotoMySearches()}"> <h:graphicImage library="images" name='vo2/SearchesPlus.png' /> </a> <a href="#{bean.gotoMyBids()}"> <h:graphicImage library="images"

How to put JSF message bundle outside of WAR so it can be edited without redeployment?

纵然是瞬间 提交于 2019-12-12 07:26:55
问题 We have a JSF application on WildFly 8 which uses the traditionally mechanism with internationalizing text by having message bundles for German and English in the WEB-INF\classes folder of the WAR and a configuration in faces-config.xml mapping a name to it and listing the locales. The application does not have a database connection, but uses REST services to communicate with a 2nd application. Now we need to be able to change text more easily, meaning not having to build a new WAR file and

Mojarra 2.1.0 - FCS doesn't work with tomcat 7

馋奶兔 提交于 2019-12-12 07:24:00
问题 i am using JSF 2.1 ( Mojarra 2.1.0 - FCS ) with tomcat 7 as follows: <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>2.1.0-b11</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.1.0-b11</version> <scope>compile</scope> </dependency> when i tried to run it on tomcat 7 i got the following exception: java.lang.InstantiationException: com.sun.faces.application

Navigate to external URL from a backing bean?

给你一囗甜甜゛ 提交于 2019-12-12 07:19:19
问题 I'm trying to implement proper logout for my Java EE / JSF2 application. It requires two things: I need to logout from JAAS and invalidate the session I then have to navigate to an external URL to fire Siteminder logout The Siteminder logout URL (configured on the Policy server -> I cannot change it) is outside my applications context. Eg. if my webapp URL is https://localhost:8080/sm/MyWebApp then the logout URL is https://localhost:8080/anotherwebapp/logout.html. This is the current local

Mapping JSF .xhtml files to no extension

蓝咒 提交于 2019-12-12 07:15:15
问题 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

JSF forms when submit

核能气质少年 提交于 2019-12-12 06:36:24
问题 If we have several forms like below and when i finally press submit button, it should send all the values from "froms1 to forms3" to the server. Is it something possible? I am using primefaces. <h:form id="forms1"> <inputText ......... </h:form> ...... <h:form id="forms2"> ...... </h:form> ....... <h:form id="forms3"> ..... </h:form> <p:commandButton value="submit" action="#{bean.action}" onSubmit="this.forms1,this.forms2,this.forms3" partialSubmit="true" /> 回答1: it is not a good idea to

Building a client side transfer method for p:pickList

我只是一个虾纸丫 提交于 2019-12-12 06:25:07
问题 I'm working with Mojarra JSF 2.1.28 and Primefaces 3.5. I want to implement a client-side transferring input for the p:pickList component, where the user types something and the value is searched through the labels at the list of available elements, then it's transferred to the target list. That's how my code looks like: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:head /> <h

org.xml.sax.SAXException: No tag “outputScript” defined in tag library associated with uri “http://java.sun.com/jsf/html”

孤街浪徒 提交于 2019-12-12 06:10:11
问题 After updating from JSF 1.2 to JSF 2.0 we faced a problem that there is no JSF 2.0 tags can be found in the tags library. in spite of removing all JSF 1.2 dependencies (replacing scope compile to scope provided in common projects but there are still depend on JSF 1.2 but with scope provided ) it doesn't work anyway. The StackTrace: org.xml.sax.SAXException: No tag "outputScript" defined in tag library associated with uri "http://java.sun.com/jsf/html" org.apache.jasper.compiler