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 […]

 2,848 total views,  6 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) […]

 1,117 total views

» 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, [plain gutter=”false”] org.icefaces.sessionExpiredRedirectURI /ERRORPAGE.jsp [/plain] But ensure you have added this entry too, [plain gutter=”false”] javax.faces.application.ViewExpiredException /ERRORPAGE.jsp [/plain] If you […]

 1,163 total views

» 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:  1,317 total views,  2 views today

 1,317 total views,  2 views today

» Read more

Session Handling in Jsf Example

JsfSession.java: package com.ngdeveloper.com; 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 = […]

 2,244 total views,  2 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”>    1,330 total views

 1,330 total views

» 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:  1,338 total views

 1,338 total views

» 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.ngdeveloper.com"></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 = […]

 2,341 total views

» 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 […]

 1,594 total views

» 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 […]

 1,750 total views,  4 views today

» Read more
1 2