JSTL If Example

On this "JSTL If Example" Tutorial / Article explains about How to use JSTL If tag in JSP for testing the conditions.

c:if conditional tag, which evalutes its body if the supplied condition is true and optionally exposes a Boolean scripting variable representing the evaluation of this condition

Using JSTL for tag ('c:if'), you can test with conditions

fn:indexOf() JSTL Function

fn:indexOf() JSTL Function

On this "fn:indexOf() JSTL Function" Example / Article explains about How To Use fn:indexOf() JSTL Function inside JSP.

fn:indexOf() returns the index withing a string of the first occurrence of a specified substring.

int indexOf(java.lang.String, java.lang.String)


Java Version History

On this "Java Version History" Article describes about different java version.

From it's inception, java language is undergone several changes. From Java 1.4, development of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests to propose and specify improvements and changes to the Java Language.

fn:escapeXml() JSTL Function

fn:escapeXml() JSTL Function

On this "fn:escapeXml() JSTL Function" Example / Article explains about How To Use fn:escapeXml() JSTL Function.

fn:escapeXml() Escapes characters that could be interpreted as XML markup.

java.lang.String escapeXml(java.lang.String)


fn:join() JSTL Function

fn:join() JSTL Function

On this "fn:join() JSTL Function" Example / Article explains about How to Join all elements of an array into a string.

fn:join() Joins all elements of an array into a string.

java.lang.String join(java.lang.String[], java.lang.String)


HttpSessionListener Example

On this "HttpSessionListener Example" Tutorial explains about How to use HttpSessionListener in a web application.

What is HttpSessionListener?

For knowing about HttpSessionListener, First we should know about the sessions. As we know that Http protocol is a "stateless" protocol. The term stateless means that it can't persist the information. It can't remember the previous transactions. Whenever a client makes a request for any resources to the server, the server receives the request and processes the request and sends back the response. After sending the response the server closes the connection and forgets about the previous requests. Whenever a client sends any request to the server, the server treats each request as a new request. To remove this we have been provided the facility of the session. In session tracking whenever a client sends a request to the server then server creates a unique id for that request and sends back the unique id to the client along with the response object, now whenever a client sends a request to the server it also sends a unique id with it so that the server can know from where the request is coming.

When I Use HttpSessionListener

Whenever a session created or destroyed, servlet container will invoke HttpSessionListener

javax.servlet.http.HttpSessionListener interface has following methods:

sessionCreated(HttpSessionEvent event)
  It will notify when the session is created.
sessionDestroyed(HttpSessionEvent event) 
  It will notify when the session gets invalidated.

Ireport Download

Ireport Download

iReport designer is a visual report tool for JasperReports. It is based on the world's most popular open-source Java reporting library. The library consist of a report engine that can be integrated in your open or commercial applications, to produce the reports designed with iReport, export them or display them on screen in a final format like PDF, OpenOffice, DOCX and many others. Alternatively, you can stream the result data through a web application or can be send the final document directly to a printer. JasperReports engine is the core of iReport.

JasperReports is extremely easy to integrate with Java application, but if you need an environment to develop the reports without having to write a custom application, you may consider using iReport
 

JSTL For Example

JSTL For Example

On this "JSTL For Example" Tutorial / Article explains about How to use JSTL for Tag

Using JSTL for tag('c:forEach'), you can get options to iterate over arrays and collections

JSTL For Loop

<c:forEach var="i" begin="1" end="20" step="1" varStatus ="status">
    <c:out value="${i}" /> 
</c:forEach>

JSP Redirect Example

JSP Redirect Example

On this "JSP Redirect Example" Tutorial / Article describes about How To Redirect a JSP page using response.sendRedirect() function

How To Use  JSP SendRedirect?

For redirect a page in JSP, we are calling response.sendRedirect(), through which the server sends the response to the client, from where next request comes and it displays that url.

Here we are using response implicit object to redirect the browser to a different resource

When a sendRedirtect method is invoked, web container will return to the browser indicating that a new URL is requested. Here the browser issues a completly new request so any thing that are stored as request attributes before the redirect occurs will be lost

If we called sendRedirect() from JSP #1 to JSP #2 the browser's location bar is changed to show JSP #2, since a sendRedirect() is a new request,

Hibernate Session Tutorial

Hibernate Session Tutorial

On this "Hibernate Session Tutorial" Example / Article explains step by step details of configuring Hibernate Session for an Entity

The main runtime interface between a Java application and Hibernate. This is the central API class abstracting the notion of a persistence service.

The lifecycle of a Session is bounded by the beginning and end of a logical transaction. (Long transactions might span several database transactions.)

The main function of the Session is to offer create, read and delete operations for instances of mapped entity classes. Instances may exist in one of three states:

transient: never persistent, not associated with any Session
persistent: associated with a unique Session
detached: previously persistent, not associated with any Session