Skip to main content

Posts

JSF + JPA + JasperReports (iReport) Part 1

Hi in this post we will see the overview of  JasperReports  and how to integrate into JSF application. JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word.  In Primeface  library also use this JasperReports to generate the PDF, CSV and DOC formats with single line of code. see here . but its not flexible and we cant change template. so here we see the how to use JasperReports for create the template and integrate  JSF 2.0. We are using iReport tool for crating template. Download JasperReports and iReport Jasper Reports download from here . This zip contain jasper library and its dependencies and lots sample codes. iReport download  from here Now create the simple JSF Application to retrieve the data f

Learn Java 7

Java 7  is an upcoming major update to Java, releasing on July 28, its upgrade/add many features. Upgraded Features - Java 7 update the XML and Web Service stack to current stable build JAXP 1.4, JAXB 2.2 and JAX-WS 2.2. - Update the Nimbus Look and Feel (Next Cross Platform UI). Its already added Java 6 Update 10. check here - Translucent and shaped Windows        This feature is also included in java 6 update 10.  this features provide to create transparent and any shape window in java. for more info check this New features in java 7 Small languages changes (Project Coin Part 1) Project Coin  is one of the  project in java 7 for java language spec (JLS). Project Coin have 2 parts. the first part is add to java 7. and next part is comes with java 8 in next year (2012).  Binary literals and underscore in numeric literals                    now we can assign binary values directly. the output of above code snippets is 32 and 1900000 Strings in switch statement

Running Multiple Tomcat Instances on Single Machine

In this post we will see how to run multiple tomcat instances on single machine and under single user account. We first see the  tomcat directory structure. . here each folder uses following purpose. bin -  It contains all binary and script files for running tomcat. lib - contains all shared libraries used for tomcat conf - contains configuration information like which port tomcat can bind , etc... logs - it contain all logging details temp - this folder tomcat used for temporary files purpose webapps - this folder is very important. here we put all application war files. work - If application contain any jsp then jsp is translated and converted into servlet its stores here. In when run the tomcat its uses 5 environment variables. They are  CATALINA_HOME, CATALINA_BASE, CATALINA_TMPDIR, JRE_HOME/JAVA_HOME, CLASSPATH in above list CATALINA_HOME and JAVA_HOME is mandatory environment variables. all others are optional and its c

Understanding Java Server Faces 2.0 Part 3

This is Third  part of JSF 2.0 discussion. Please visit  part one   and part two Update : New Post JasperReports in JSF In this post we will discuss JSF with AJAX. In JSF 2.0 gives full support for ajax integration in web application.  With Ajax, web applications can send data to, and retrieve data from, a  server  asynchronously (in the background) without interfering with the display and behavior of the existing page. so with help of ajax we will make more interactive page.   JSF 2.0 Faclets provide <f:ajax> tag for achieve ajax in web application without writing client side java script ajax code. JSF 2.0 takes care all of this. JSF and ajax integration is one of the greatest feature. and no other framework provide this much easy ajax integration in web application. Consider we have one simple web application it prompt the name and click submit button its display the name in same page in some where . we will see this example without ajax  index.xhtml < h

Understanding Java Server Faces 2.0 Part 2

This is Second  part of JSF 2.0 discussion. Please visit   part one   Update :  New Post JasperReports in JSF In JSF 2.0 part 1   post, i used  @ManagedBean annotation for POJO java class. Its OK, actually it derived from JSF 1.2.But we should use @Named annotation instead of @ManagedBean, if CDI  ( Contexts and Dependency Injection ) environment is available. I used Tomcat 7, its not Java EE 6 server and by default CDI is not available.  But we can use JBoss's Weld lib for achieve  CDI in tomcat with minimal configuration. Weld is reference implementation of CDI and its comes standalone version also. This standalone version weld provide CDI environment for both Web Application and Java SE application. By default Glassfish 3.0/3.1 server comes with weld  library for CDI Environment. Here i am using Glassfish server with CDI enabled. Page Navigation        This post we will discuss page navigation in JSF2.0. Page Navigation means flow of the application. From one page