Skip to main content

Posts

Showing posts from November, 2010

JSTL Tutorials Using NetBeans : Part-6

Right Click on WEB-INF folder, New and choose File/Folder…     Another dialog box will appear, choose Other on the left pane and choose Folder on the right pane.

JSTL Tutorials Using NetBeans : Part-5

Let’s see how it works. Create 2 new JSP called JstL_Core_Tags_Redirect.jsp and Jstl_Core_Tags_Import.jsp. Add this to Jstl_Core_Tags_Redirect.jsp It is going to redirect the page back to index.jsp Add this to Jstl_Core_Tags_Import.jsp It will import or include index.jsp after Jstl_Core_Tags_Import.jsp loads. This is what we get when we run Jstl_Core_Tags_Redirect.jsp. Just type the address as shown in circled area and the page will redirect us back to index.jsp.     Interesting right? Well, do same thing for Jstl_Core_Tags_Import.jsp. Open browser then type the full address manually and we will get index.jsp is loaded after Jstl_Core_Tags_Import.jsp loads.

JSTL Tutorials Using NetBeans : Part-4

Create a new JSP file. Follow exactly the same way as we created the Jstl_Hello_World.jsp but name it Jstl_Core_Tags.jsp. Then we need to modify our index.jsp to contain the link to our newly created JSP. So please add below codes to our index.jsp just right after our first link to open the Hello World JSTL tags.   JSTL Core Tags JSTL if tag and EL operators   What we do here is basically to send some parameters so that they are accessible from the target page.   On the target page, we can retrieve these parameters via ${param.parameter_name} and we are going to use the logical JSTL tags to compare some values. Add below codes to Jstl_Core_Tags.jsp

JSTL Tutorials Using NetBeans : Part-3

3. Implementation of JSTL Core Tags First, let’s make a new JSP page. Right click on Web Pages folder, New and JSP…       Then a new dialog will show up as displayed above. Let’s call it Jstl_Hello_World.jsp. Then click Finish to create the jsp. Now we have 2 JSPs – index.jsp and Jstl_Hello_World.jsp.

JSTL Tutorials Using NetBeans : Part-2

2. Why use JSTL? Advantage of JSTL Scriptlets ( Java codes within JSP ) are complex and are extremely hard to be maintained. Unlike scriptlets, JSTL makes our JSP readable and maintainable. HTML programmer may find it hard to modify the JSP with the scriptlets as he or she may not have the Java programming knowledge. However, if we are using JSTL to replace our scriptlets, HTML programmer can easily understand on what’s going on in the JSP as JSTL is in the form of XML tags similar to the normal HTML tags. JSTL has been standardized and is reusable tags. The name of each tag in JSTL is self-explanatory and is easy to understand. JSTL requires less code compared to scriptlets. Shortcomings of JSTL Scriptlets provide you with greater flexibility. As scriptlets is simply a Java codes, you can do anything that you want as you normally do with a Java programming. On the other hand, JSTL is a very specific and each tag has its own purposes.

JSTL Tutorials Using NetBeans : Part-1

Introduction The latest version of JSTL is JSTL 1.1. Without any hesitation, JSTL is now extremely important in ensuring the success of the J2EE web application projects. JSTL is basically part of  JSP 2.0 specification and requires Java Servlet 2.4 and higher to support its tags.   After completing this tutorial, you are expected to be able to apply JSTL technology to your JSP, know what are JSTL tags, know how and when to use certain tags under certain circumstances according to your needs. Specifics Information on JSTL and Netbeans This tutorial has been compiled, tested and run under: Netbeans 5.5 JSTL 1.1 library package Tomcat 5.5.7 as server If you have installed NetBeans successfully, JSTL library (.jar) can be found on your local hard disk. It is bundled together with Netbeans. For your information, it can be found in: netbeans_installation_folder\enterprise1\config\TagLibraries\JSTL11

Java Cloning Interview Questions

Q1) What are different types of cloning in Java? Ans) Java supports two type of cloning: - Deep and shallow cloning. By default shallow copy is used in Java. Object class has a method clone() which does shallow cloning. Q2) What is Shallow copy? Ans) In shallow copy the object is copied without its contained objects. Shallow clone only copies the top level structure of the object not the lower levels. It is an exact bit copy of all the attributes.       The shallow copy is done for obj and new object obj1 is created but contained objects of obj are not copied. It can be seen that no new objects are created for obj1 and it is referring to the same old contained objects. If either of the containedObj contain any other object no new reference is created

Garbage Collection Interview Questions

Q1) Which part of the memory is involved in Garbage Collection? Stack or Heap? Ans) Heap Q2)What is responsiblity of Garbage Collector? Ans) Garbage collector frees the memory occupied by the unreachable objects during the java program by deleting these unreachable objects. It ensures that the available memory will be used efficiently, but does not guarantee that there will be sufficient memory for the program to run. Q3) Is garbage collector a dameon thread? Ans) Yes GC is a dameon thread. A dameon thread runs behind the application. It is started by JVM. The thread stops when all non-dameon threads stop. Q4)Garbage Collector is controlled by whom? Ans) The JVM controls the Garbage Collector; it decides when to run the Garbage Collector. JVM runs the Garbage Collector when it realizes that the memory is running low, but this behavior of jvm can not be guaranteed. One can request the Garbage Collection to happen f

Serialization Interview Questions

Q1) What is Serialization? Ans) Serializable is a marker interface. When an object has to be transferred over a network ( typically through rmi or EJB) or persist the state of an object to a file, the object Class needs to implement Serializable interface. Implementing this interface will allow the object converted into bytestream and transfer over a network. Q2) What is use of serialVersionUID? Ans) During object serialization, the default Java serialization mechanism writes the metadata about the object, which includes the class name, field names and types, and superclass. This class definition is stored as a part of the serialized object. This stored metadata enables the deserialization process to reconstitute the objects and map the stream data into the class attributes with the appropriate type Everytime an object is serialized the java serialization mechanism automatically computes a hash value. ObjectStreamClass's computeSerialVersionU

Java PDF Libraries - PDFBox

PDFBox is an open source Java PDF library for working with PDF documents. This project allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents. PDFBox also includes several command line utilities. Features PDF to text extraction Merge PDF Documents PDF Document Encryption/Decryption Lucene Search Engine Integration Fill in form data FDF and XFDF Create a PDF from a text file Create images from PDF pages Print a PDF URL: http://www.pdfbox.org/ Licence: BSD License

Java PDF Libraries - JustFormsPDF

JustFormsPDF library is a Java class library for filling or editing interactive PDF forms on-the-fly. If you are looking for a print solution in your Java application then PDF is your ultimate choice and use of PDF forms makes application delivery simplest and rapid. JustFormsPDF library is designed keeping this specific need in mind and it is just right for your PDF printing solution. JustFormsPDF requires no other packages to be installed and will run easily in any Java program including Servlets, JSPs or EJBs on systems running Java 1.2, 1.3 or 1.4. Features include: Fill or edit interactive PDF Forms. Completely written in Java. Easy to use and integrate. Output PDF can be streamed to a file or web browser. Supports most of form elements including Text Fields, Check Boxes, Radio Buttons and Combo Boxes. Customizable appearance of form fields (color, justification, font). Distictive save-protected PDF feature. URL: http://www.justformspdf.com/ Licence: Propriet

Java PDF Libraries - JFreeReport

JFreeReport is a free Java report library. It has the following features: full on-screen print preview; data obtained via Swing's TableModel interface (making it easy to print data directly from your application); XML-based report definitions; output to the screen, printer or various export formats (PDF, HTML, CSV, Excel, plain text); support for servlets (uses the JFreeReport extensions) complete source code included (subject to the GNU Lesser General Public Licence); extensive source code documentation; JFreeReport requires Java SDK 1.2.2 or later. URL: http://www.jfree.org/jfreereport/ Licence: LGPL

Collection Interview Questions

Q1) What is difference between ArrayList and Vector? Ans: ) 1) Synchronization - ArrayList is not thread-safe whereas Vector is thread-safe. In Vector class each method like add(), get(int i) is surrounded with a synchronized block and thus making Vector class thread-safe. 2) Data growth - Internally, both the ArrayList and Vector hold onto their contents using an Array. When an element is inserted into an ArrayList or a Vector, the object will need to expand its internal array if it runs out of room. A Vector defaults to doubling the size of its array, while the ArrayList increases its array size by 50 percent. Q2) How can Arraylist be synchronized without using Vector? Ans) Arraylist can be synchronized using: Collection.synchronizedList(List list) Other collections can be synchronized: Collection.synchronizedMap(Map map) Collection.synchronizedCollection(Collection c)

Java PDF Libraries - jPDFViewer

jPDFViewer is a Java bean that you can embed in your Java applications and applets to view PDF documents. With jPDFViewer, you can deliver content to your users right through your application without the need to install third party programs. URL: http://www.qoppa.com/jpvindex.html Licence: Proprietary

Java PDF Libraries - JasperReports

JasperReports is a powerful open source Java reporting tool that has the ability to deliver rich content onto the screen, to the printer or into PDF, HTML, XLS, CSV and XML files. It is entirely written in Java and can be used in a variety of Java enabled applications, including J2EE or Web applications, to generate dynamic content. Its main purpose is to help creating page oriented, ready to print documents in a simple and flexible manner.   URL: http://jasperreports.sourceforge.net/ Licence: LGPL

Java PDF Libraries - ElegantJ PDF Library

ElegantJ PDF library is a powerful Java class library that enables you to deliver dynamic and live business reports in printer friendly and professional looking PDF documents. ElegantJ PDF Library supports internationalization with multiple languages including Chinese, Japanese and Korean (CJK) as well as Bi-Directional (BiDi) fonts, like Arabic. Option to support encryption on your PDF document.   ElegantJ PDF library does a lot of work for a developer. Generates PDF document directly from any Java™ Component. Using PDF Table it generates table directly from data source. Use its methods to generate PDF from text as well as graphic objects. It gives facility of bookmarks and annotation to give a touch of class to your documentation. In nutshell, you provide raw data and formatting, ElegantJ PDF Library will generate PDF saving time and efforts. Give your Java solution ability of web printing. Use in server-side technologies like servlet / JSP, J2EE or J2SE ap

Java PDF Libraries - FOP

FOP (Formatting Objects Processor) is the world's first print formatter driven by XSL formatting objects (XSL-FO) and the world's first output independent formatter. It is a Java application that reads a formatting object (FO) tree and renders the resulting pages to a specified output. Output formats currently supported include PDF, PCL, PS, SVG, XML (area tree representation), Print, AWT, MIF and TXT. The primary output target is PDF. URL: http://xmlgraphics.apache.org/fop/ Licence: Apache License

Java PDF Libraries - Big Faceless Report Generator

The Big Faceless Report Generator is the leading Java component for converting XML to PDF documents. Using JSP, ASP or similar technology, you can now create dynamic PDF reports as quickly and easily as HTML. Product Overview Built on our popular Java PDF library, the Report Writer adds substantial functionality: HTML-style Tables - auto-sized nested tables with full control over padding, margins and borders Use cascading CSS2 stylesheets to control look and feel Create inline graphs and charts with XML, direct from the database Includes a servlet and a servlet filter for simple generation of PDF's from XML or JSP pages. Auto pagination of content with page headers and footers Familiar HTML syntax - , , , , and so on - simpler and faster than FOP All the features of our PDF library - Unicode support, Encryption, TrueType fonts, Barcodes and more URL: http://big.faceless.org/products/report/index.jsp Licence: Proprietary

Java PDF Libraries - Big Faceless PDF Library

The Big Faceless Java PDF Library is the smartest Java class library for creating, editing, displaying and printing Acrobat PDF documents. The PDF API is small, fast, easy to use and integrate into your projects, and is completely written in Java. Product Overview The PDF Library reads and writes PDFs up to version 1.6 (Acrobat 7.0) and boasts a dynamic range of features including: Transparent Unicode support - create documents in Arabic, Russian or Japanese as easily as English. TrueType and Type1 fonts, with subsetting for smaller files. Great for OCR PDF Encryption, for password-protected documents (40 and 128 bit RC4 or AES) Embed JPEG, PNG, GIF, TIFF or java.awt.Image images, or add Barcodes directly to the PDF Use Spot colors, calibrated ICC profiles and other advanced colorspaces Add HTML-style Hyperlinks to text or images Process 1000+ words a second with kerning, ligatures, justification and "curly quotes" for legibility Simplify complex document creation

Java Libraries - Maven

Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. The following are the key features of Maven in a nutshell: Simple project setup that follows best practices - get a new project or module started in seconds Consistent usage across all projects means no ramp up time for new developers coming onto a project Superior dependency management including automatic updating, dependency closures (also known as transitive dependencies) Able to easily work with multiple projects at a time A large and growing repository of libraries and metadata to use out of the box, and arrangements in place with the largest Open Source projects for real-time availability of their latest releases

Java Libraries - Luntbuild

Luntbuild is a powerful build automation and management tool. Continuous Integration or nightly builds can be easily set using a clean web interface. Executed builds are well managed using functions such as search, categorization, promotion, patching, deletion, etc. It also acts as a central build artifacts repository and download area for your whole team. Why Luntbuild? You may ask why Luntbuild, while there are already many good build automation tools such as Cruise Control, Anthill, and others. Our answer is: Luntbuild aims at not only being build automation, but also build management system. Executed builds can be categorized, promoted, searched, patched, deleted, etc. This is very important for a nightly builds or Continuous Integration builds, which generate many builds over time. Luntbuild utilizes the project/schedule concept to easily provide build support for parallel development. No configuration files, all jobs are done using web interface. You can set your Lun

Java Libraries - Krysalis Centipede

Krysalis Centipede is a project build system based on Apache Ant. It's made to be easy, extensible and powerful. Easy You can just grab it and start building your project. Anything that is needed for a start is there, and the creation of personalized build targets is straightforward, because it's based on plain Ant. Centipede is un-intrusive, and gives you power without taking any. It also has an interactive target facility, so that the user can just run "build" and choose from a menu. Extensible You just need to add a property to use additional pre-built targets. These packages are called antlibs, and behave like wars and seamlessly add functionality to the build. Let's say you need to make documentation. Just add (an available documentation system based on Cocoon) to the properties file, write the docs, call the forrest in your main build file where you want documentation to be build and all the rest (comprising the download and installation)

Java Libraries - JAM

JavaGen Ant Modules or JAM* is a modular Ant toolkit for building J2EE applications. It consists of a collection of Ant scripts designed to perform common Java/J2EE build tasks such as compilation, packaging, testing, deployment and J2EE application server control. Although originally developed to support the JavaGen code generator, JAM has evolved into a full feature, stand-alone build framework. Highlights include: JAM leverages the new import and target override features of Ant 1.6 to create a reusable build framework. JAM defines a small set of standard target names. JAM includes a Maven-to-Ant bridge providing access to Maven's POM and repository features directly from Ant. JAM supports various J2EE application servers as interchangeable modules. JAM supports code generation technologies such as XDoclet and UML-based JavaGen. JAM has extensive support for various unit test technologies including JUnit and Cactus. JAM modules support CVS, Axis, Castor, JMX, Hibernate and

Java Libraries - Ivy

Ivy is a free java based dependency manager, with powerful features such as transitive dependencies, ant integration, maven repository compatibility, continuous integration, html reports and many more. Integrated with ant For sure, Ivy is integrated with the most popular build management system for java projects. Simple to use For simple cases, ivy is really simple to use. Declare your dependencies, and that's all. See the quick start tutorial to check yourself, it should take less than 5 minutes ! Ivy can thus be used to bring the dependency management feature of maven to ant build files, for those of you who already use ant and who do not want to setup a maven project. But Ivy does not stop here, and provides much more great features !

Java Libraries - Invicta

Invicta is an open-source build management tool. Using simple project definition files, it generates powerful build scripts (Apache ANT's), while hiding their complexity. Furthermore, Invicta is a modular framework that allows advanced developers add their own customized types of components, which means writing once ANT code that can later be used by all the developers in their project or company simply by specifying the new type name. URL: http://invicta.sourceforge.net/ Licence: LGPL

Java Libraries - GenJar

GenJar is a specialized Ant task that builds jar files based on class dependencies rather than simply the contents of a directory. GenJar was originally created by John W. Kohler (jake at riggshill.com). Work is underway on GenJar2. GenJar2 will be a functional replacement of GenJar, but build file syntax will change. Some of the features of GenJar2 include: Syntax consistent with Ant's jar task Replacement of GenJar's with Ant's Replacement of GenJar's with with Ant's BCEL for class dependency checking The original GenJar branch will be maintained for as long as there is demand. URL: http://genjar.sourceforge.net/ Licence: Apache License

Java Libraries - CruiseControl

CruiseControl is a framework for a continuous build process. It includes, but is not limited to, plugins for email notification, Ant, and various source control tools. A web interface is provided to view the details of the current and previous builds. CruiseControl is distributed under a BSD-style license and is free for use. CruiseControl adheres to an open source model and therefore makes the source code freely available. CruiseControl is maintained and developed by a group of dedicated volunteers. URL: http://cruisecontrol.sourceforge.net/ Licence: BSD License

Java Libraries - CPMake

CPMake is a make utility written in Java to make anything (C, C++, Java, C#, XSL ...) CPMake works similar to GNU make in that is uses rules and dependencies to build a project. CPMake uses Java scripting languages (BeanShell, Rhino, Jython and Groovy) for the build files to give increased flexability and the ability to customize the make file to your project. CPMake Benefits: Make files work on any platform that supports Java. CPMake has built in dependency tracking for C/C++ and Java projects. Build files have access to all of the Java classes. Easy to debug build files. Multi threaded processing of build file. Cross platform paths. Use '\' or '/' Java doesn't care. URL: http://www.cpmake.org/ Licence: GPL

Java Libraries - Antmod

Antmod is a Java and Ant based tool for:    1. Build Management:           * Speed-up java development with Antmod's plugins [...]           * Share build files across projects [...]    2. Release Management:           * Describe a project using release descriptors [...]           * Standardize versioning across projects [...]           * Modularize your software development process [...]    3. Repository Management:           * Manage your CVS or Subversion repository [...] Antmod's repository management, release descriptors, working with modules, Ant buildfiles and Ant build plugins make it a powerful and complete out-of-the-box solution for any software development project, especially those based on Java. URL: http://antmod.org/ Licence: Common Public License

Java Libraries - Ant

Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles. Why another build tool when there is already make, gnumake, nmake, jam, and others? Because all those tools have limitations that Ant's original author couldn't live with when developing software across multiple platforms. Make-like tools are inherently shell-based -- they evaluate a set of dependencies, then execute commands not unlike what you would issue in a shell. This means that you can easily extend these tools by using or writing any program for the OS that you are working on. However, this also means that you limit yourself to the OS, or at least the OS type such as Unix, that you are working on. Makefiles are inherently evil as well. Anybody who has worked on them for any time has run into the dreaded tab problem. "Is my command not executing because I have a space in front of my tab!!!" said the original author of Ant way too many times. Tools lik