Skip to main content

how to setup/configure hibernate ORM in your spring project

This article is for how to setup/configure hibernate ORM in your spring project.
Add below maven dependency in pom.xml <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.0.1.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId>

JSP Directives

JSP Directives -

    JSP Directives is very powerful components in the Jsp. In this page you will learn about JSP Directives. JSP Directives are responsible for giving the special information about the jsp to the Jsp container.
Jsp Directives tag syntax is :
<%@ directive  attribute=”Value” %>
JSP has three type of jps Directives tag.
  1. page
  2. taglib
  3. include

page Directive :

page Directive is used for manipulating the behaviour of the jsp page. Jsp page can be import the java file through the import attribute. If isErrorPage attribute will be true then jsp will work as a error page.
There are list of attribute of page directive.
  1. autoFlush
  2. buffer    
  3. contentType
  4. errorPage
  5. extends
  6. import
  7. info
  8. isErrorPage
  9. isThreadSafe
  10. language
  11. pageEncoding
  12. session

autoFlush Attribute :-

autoFlush Attribute is used to flush the jsp page when buffer size is overflows. By-default the value of autoFlush attribute is true. If you will set value as false. It will throw exception in case buffer size will be increase.
Syntax of autoFlush Attribute is :
<%@ page     autoFlush="true" %>
buffer Attribute :-

buffer attribute is used to set the buffer size of your jsp page. By-default the value of buffer attribute is 8kb. If buffer size of jsp page will we 0kb then all output is immediately flushed.
Syntax of buffer attribute is :
<%@ page     buffer="8kb" %>
contentType Attribute:-

contentType Attribute is used for change the language accordingly. you can set the content type and charset through the contentType attribute.
Syntax of contentType attribute is :
<%@ page     contentType="text/html; charset=ISO-8859-1" %>
errorPage Attribute:-

errorPage Attribute is used for set the path of jsp error page. If any exception will occur in the jsp page, errorPage attribute forward the common jsp page.
Syntax of errorPage attribute is :
<%@ page     errorPage="path of error page" %>
extends Attribute:-

extends Attribute is used to define a super class of jsp page. Supper class can be a servlet.
Syntex of the extends attribute is :
<%@ page     extends="path of servlet" %>
import Attribute:-

import attribute is used to import one or more java class within the jsp.
Syntex of the import attribute is:
<%@ page     import="path of java class" %>
<%@ page     import="java.util.Date" %>
It means, in the compiled java class of jsp, you will file this line
import java.util.Date;
info Attribute:-

info attribute is used to write the documentation for the jsp. You can write like author name, version, copyright and date for the jsp.
Syntex of info attribute is:
<%@ page     info="some text" %>
<%@ page     info="@ Auther Name: Manoj Kumar Shakya
        @Date 30 Nov 2010" %>
isErrorPage Attribute:-

isErrorPage is used to define a jsp as a error page. By-default value of isErrorPage attribute is false. If you will set the value of isErrorPage as true it means this page will work for display the error.
Systex of isErrorPage is:
<%@ page     isErrorPage="false" %>
language Attribute:-

language Attribute is used to define the language which will be used as scriptlet language.
By-default value of language attribute is java.
Syntax of language atrribute is :
<%@ page     language="java" %>
session Attribute:-

session attribue is used to define that session object will be present at jsp page or not. By-default value of session attribute is true there you can use the session object within the jsp page. If you will set session is false. then session object will not be on that jsp page.
Syntax if session attribute is:
<%@ page     session="true | false" %>


Popular posts from this blog

What is NBioBSP Java Library?

The NBioBSP Java Library (NBioBSPJNI.jar) is designed to support developers using JAVA
NBioBSP Java Library based Java Native Interface Technology that facilitates easily integration of
NBioBSP by developers using Java development.
The NBioBSP Java Library also uses NBioBSP.dll and provides higher level of interfaces.
NBioBSP Java Library supports almost all NBioBSP functions.

Only valid for NBioBSP.dll version 4.781 or higher.
Only valid for JDK version 1.5.0_20 or higher.

File list :-

■ NBioBSPJNI.jar
This is the java library of the eNBSP SDK.

■ NBioBSPJNI.dll
It implements all java native interfaces. It use with the windows platform.

It implements all java native interfaces. It use with the Linux platform.

Draw arrow line example

Draw arrow line example - 
Its a complete example

import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;

public class Test
public static void main (String args[])
SwingUtilities.invokeLater ( new Runnable () {
Test arrows = new Test();

public void run () {
JFrame frame = new JFrame ( "Arrows" );

frame.add ( new JPanel() {
public void paintComponent ( Graphics g ) {
arrows.draw ( ( Graphics2D ) g, getWidth(), getHeight() );
, BorderLayout.CENTER );

frame.setSize ( 800, 400 );
frame.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
frame.setVisible ( true );
} );

interface Arrow {
void draw ( Graphics2D g );

Arrow[] arrows = { new LineArrow(), new CurvedArrow() };

void draw ( Graphics2D g, int width, int height )
g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );

g.setColor ( Color.WHITE );
g.fillRect ( 0, 0, width, height );

for ( Arrow arrow : arrows ) {
g.setColor ( Color.ORANGE );
g.fillRect ( 350, 20, 20, 2…

Capture image from webcam java code, examples

import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;

import javax.swing.JButton;
import javax.swing.JComponent;

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.ima…