Introduction I will show you here how to create multiple namespaces in struts 2 web application. The benefit of namespace is the same file and action can be mapped to the multiple modules. The default namespace is “” – an empty string. A root namespace “/” is also supported. The namespace attribute subdivides action configurations…

Posted in Struts

Multiple namespaces example in Struts 2

Introduction File Upload is one of the common tasks of a web application and Struts 2 provides built-in feature for single file upload through FileUploadInterceptor. Interceptors are cross cutting concerns or common concerns like Logging. FileUploadInterceptor is configured in the struts-default package that we usually extend in Struts 2 package configuration. FileUploadInterceptor also provide options…

Posted in File Upload Struts

Single file upload example in struts 2

Introduction File Upload is one of the common tasks of a web application and Struts 2 provides built-in feature for multiple files upload through FileUploadInterceptor. Interceptors are cross cutting concerns or common concerns like Logging. FileUploadInterceptor is configured in the struts-default package that we usually extend in Struts 2 package configuration. FileUploadInterceptor also provide options…

Posted in File Upload Struts

Multiple Files Upload example in Struts 2

Introduction In this tutorial I will show how to create effective pagination example in jsf 2, hibernate and in-memory database – hsqdb . In memory database like hsqldb is good when you want to do some quick POC or testing the application without setting up a large database. There are lots of built-in API for…

Posted in JSF

Effective pagination example in jsf 2

Introduction Here you will see file upload example in JSF 2. The file upload implementation in Java based web application is very complex and you need to be dependent on Apache file upload libraries. When you work on JSF(Java Server Faces), you have JSF (Java Faces Server) pages with other inputs along with file inputs…

Posted in File Upload JSF

File Upload Example in JSF 2

Introduction This tutorial shows how to use ValueChangeListener to create dependent dropdown in JSF 2 and MySQL. I have used here JSF 2’s valueChangeListener which fires value change event when select option dropdown gets changed. Any component that receives user input, such as one of the HTML select or text input components, can publish value…

Posted in JSF

ValueChangeListener example in JSF 2

Liferay is a Open Source Content Management System and it’s popularity increasing day by day  but there are no much tutorials on this. Sometimes we find some examples but it may not work exactly the way have been written in the websites. Sometimes the tutorial steps have not been started from the scratch and it…

Posted in Java Struts

Integrate struts 2 in Liferay portlet

Introduction In this post we will see how to show warning message to user when session expires in a web application. So we will redirect user to login page once session has expired. We know that we let users login to the web application before a user can perform some sensitive activities like online transactions,…

Posted in JSP Servlet

Show Warning Message to User When Session Expires

In this article I am going to show you how to prevent user going back to the login page if a user is already logged in or redirect a user to the login page if the user is not already logged in. When browser caches the resources then clicking on the browser’s back button will…

Posted in JSP Servlet

Prevent user going back to login page if already logged in using filters

Introduction In this tutorial I am going to tell you how you can prevent cache in browser. Sometimes we need to clear the browser cache or prevent the browser from caching resources so that we always get the latest output from the server. Disabling caching of your web pages ensures your resources are coming every time…

Posted in JSP Servlet

Prevent browser from caching resources

Introduction In this post we will see how to cache static resources like css, js and images for a specific period of time. So we will specify the time for how long we want to cache such static resources. Static resources like css, js images etc. need not be reloaded from the server every time…

Posted in Java Servlet

Cache static resources like css, js and images for a specific time period

Introduction This tutorial shows how to integrate Spring 3, Struts 2 and Hibernate 3 in the following example. In this example, Struts 2 will be used as a web framework and Spring 3 will be used as a core service. We will use ORM (Object Relational Mapping) framework Hibernate for our persistent layer to interact…

Posted in Hibernate Spring Core Struts

Integrate Spring 3, Struts 2 and Hibernate 3