19 JSF Important Interview Questions

19 JSF Important Interview Questions: JSF(Java server faces) is component driven programming language which can be implemented with different faces like icefaces, acefaces, primefaces, richfaces etc. This can also be used with spring core and hibernate for ORM. Below are the few most important and repeated interview questions for JSF developers.   1. What are all the 6 phases of

161 total views, no views today

» Read more

[solved] uioutput cannot be resolved to a type JSF

[solved] uioutput cannot be resolved to a type JSF: Error meaning is you did not import the UIOutput in your bean/controller. So you have to import the below UIOutput package, “import javax.faces.component.UIOutput;” to resolve the uioutput cannot be resolved to a type error/exception. If you are getting this exception in eclipse like in the below/similar line, String ajaxListValue = (String)

209 total views, 1 views today

» Read more

Icefaces user session expired popup

Icefaces user session expired popup: Icefaces user session expired popup issue has been resolved after adding the below entries in the deployment descriptors (web.xml), The below one will redirect you to the ERRORPAGE.jsp onclick of any button after session timeout, <context-param> <param-name>org.icefaces.sessionExpiredRedirectURI</param-name> <param-value>/ERRORPAGE.jsp</param-value> </context-param> But ensure you have added this entry too, <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/ERRORPAGE.jsp</location> </error-page> If you want to

240 total views, no views today

» Read more

How to truncate td value in icefaces (jsf)

You can truncate the td value in jsf icefaces like this, You have to add “word-break:break-all” to your table style property. It will look like this, <ice:dataTable style=”word-break:break-all”> <ice:colomn style=”white-space:normal;”> </ice:column> </ice:dataTable> Ensure you have given the columnWidths property also to your datatable. Recommended Books: 148 total views, 1 views today

148 total views, 1 views today

» Read more

Session Handling in Jsf Example

JsfSession.java: package com.javadomain.in; import javax.faces.FacesException; import javax.faces.application.Application; import javax.faces.application.ViewHandler; import javax.faces.component.UIViewRoot; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; import javax.servlet.http.HttpSession; public class JsfSession implements PhaseListener { @Override public void afterPhase(PhaseEvent event) { //Do anything } @Override public void beforePhase(PhaseEvent event) { FacesContext context = event.getFacesContext(); ExternalContext ext = context.getExternalContext(); HttpSession session = (HttpSession) ext.getSession(false); boolean newSession =

403 total views, no views today

» Read more

Iceface datatable column width adjustment

Solution for iceface datatable column width adjustment: You may face the issue while setting the iceface datatable column width adjustments. This can be achieved by the below way,   Use style=”table-layout:fixed;” in the ice:column and ensure you have set the columnwidths already for all the columns. eg: <ice:column style=”table-layout:fixed;” columnwidths=”350px,490px”>   230 total views, 1 views today

230 total views, 1 views today

» Read more

jQuery Show/Hide Example in Jsf

jQuery Show/Hide Example in Jsf: Program: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"> </script> <script> $(document).ready(function() { $("#content").hide(); $("#show_button").click(function() { $("#content").show(); }); $("#hide_button").click(function() { $("#content").hide(); }); }); </script> </h:head> <h:body> <h:commandButton value="show" id="show_button" /> <h:commandButton value="hide" id="hide_button" /> <div id="content">Welcome to Javadomain.in</div> </h:body> </html> Output:   Recommended Books: 233 total views, no views today

233 total views, no views today

» Read more

Dynamically add/remove jsf components example

Program:   dynamic.xhtml: <?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:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> </h:head> <h:body> <h:form> <h:dataTable value="#{dynBean.dynList}" var="myListElement"> <h:column> <h:panelGrid> <h:outputText value="www.javadomain.in"></h:outputText> </h:panelGrid> </h:column> </h:dataTable> <h:commandButton value="Add" action="#{dynBean.addToMyList}" /> <h:commandButton value="Remove" action="#{dynBean.removeFromMyList}" /> </h:form> </h:body> </html> DynamicBean.java: import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.CustomScoped; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.bean.ViewScoped; @ManagedBean(name =

689 total views, 1 views today

» Read more

Ice Panel Popup Examples

In JSF, those who are using Ice components if they need popup they can go with Ice panel Popups. Ice Panel Popup : <?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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head> </h:head> <h:body> <h:form> <h:commandButton value="Click to open Ice Panl Popup" actionListener="#{icePopupBean.openPopup}" /> <ice:panelPopup visible="#{icePopupBean.popupOpened}" rendered="#{icePopupBean.popupOpened}" autoCentre="true"> <f:facet

304 total views, 1 views today

» Read more

[solved] diff propagated to root but no id set html null

diff propagated to root but no id set html null: Error: diff propagated to root but no id set html null Solution: Use <redirect/> in the faces-config file. Try to put h:panelGroup inside body (this error may occur if we use the ice components directly inside the body) – so it can be avoided if we use the ice components

366 total views, 2 views today

» Read more
1 2