Please disable your adblock and script blockers to view this page

Search this blog

Showing posts with label jsf. Show all posts
Showing posts with label jsf. Show all posts

Wednesday 15 May 2013

Beauty of ADF- Taskflow, Difference b/w Facelets and JSP XML fragments in bounded taskflow

Oracle ADF framework support modular architecture for enterprize application development. Multiple small module can be bound together to form a large module .
The greatest advantage of ADF controller over core JSF navigation model is that it splits a single bulky module to multiple reusable and interconnected modules known as Taskflows.

i am not going deeper in Taskflows as every ADF developer know about it ,so the important part is page fragment.
  • When  we create taskflow as bounded taskflow , and check it to create fragment in taskflow.
  • Now when we create pagefragment in bounded taskflow, there is 2 option for creating fragment




Create fragment as Facelets
Create fragment as JSP XML 

Page Fragment Type - Facelets or JSPX

Facelets- is default and official view handler for JSF pages, priviously JSP was used to view JSF pages but it didn't support all component so Facelets comes in picture under APACHE open source license. It supprts all UI component used by JSF (Java Server Faces).
Facelets was developed by Jacob Hookom in 2005.
If you create Facelets fragment in bounded taskflow, then taskflow must be dropped in a JSF page (parent page) not in .jspx (JSP XML ) page.
if you try to drop it into JSP XML page-


JSP XML- jspx is XML variant of JSP(Java Server Pages) to support XML document . JSP XML fragments are used in ADF inorder to support XML document and more powerful page validation techniques.
If you create jsp xml fragments in bounded taskflow, then taskflow must be dropped in a JSP XML(.jspx) page(parent page) not in JSF page.

Tuesday 16 October 2012

ADF Basics: Show FacesMessage in Oracle ADF


How to use FacesMessage in ADF

FacesMessage is used to show confirmation, warning, information .In this tutorial, you will see that how to use FacesMessage to show any information, warning or any error. Suppose you want to show a confirmation when you save your records, here we use FacesMessage.

Managed Bean Code to use FacesMessage(Information)-



      FacesMessage Message = new FacesMessage("Record Saved Successfully!");   
      Message.setSeverity(FacesMessage.SEVERITY_INFO);   
      FacesContext fc = FacesContext.getCurrentInstance();   
      fc.addMessage(null, Message);   


To use for Error and Warning just change FacesMessage.SEVERITY_INFO to SEVERITY_ERROR or SEVERITY_WARN.
It will look like this



FacesMessage in Oracle ADF

You can change your Message accordingly


Monday 15 October 2012

ADF Basics: .jspx and .jsff page in Oracle ADF


.jspx-


.jspx page is JSP/XML representation, it is standalone page means it can run without any supporting or base page.
Jdeveloper 11g Release1 supports .jspx page but  Release2 supports both jspx and Facelets


.jsff page-


.jsff (JSF fragments) page is fragment of JSF(Java Server Faces) page, sometimes pages become to much complex and large and it is not easy to edit those pages, in that case it should be devided in some fragments.
JSF page can be broken in some smaller page fragments to avoid difficulties in editing and maintaining
page fragments can't run independently, it requires a base of .jsf(JSF page) or .jspx (JSP/XML)
page.

Facelets-


Java Server pages(JSP) technology previously used as view declaration for Java Server Faces (JSF) but it doesn't support all the feature of JSF available in JDK1.6 (Java 6), Facelets is introduced under Apche license and default view declaration technology for Java Server Faces.
Facelets supports all the new features introduced in JSF technology, Facelets requires XML document to work
  • Facelets supports HTML and XHTML for designing
  • Fasetr execution than JSP
  • Supports Facelets tab library with JSF and JSTL tag lib

JSP and JSPX-


The main difference I know is that JSP supports HTML and JSPX is XML variant of JSP. .jspx supports more component than jsp page and also compatible with JSF page fragments.