This is the first in a twopart series on developing jsr 168 struts portlets. Jsr168dispatcher or a subclass, if you have added some custom functionality. Application context file is required if you are developing your portlet with spring in liferay. Struts2 supports annotation based configurations which are easy to create and more. Chapter 12 deploying struts application as a portlet in. I have made available a new struts 2 portlet tutorial in the struts 2 plugin repository wiki.
The important parts to notice are the portletclass and initparam elements. The bridge wraps and enhances the native struts framework to overcome its limitations and incompatibilities with the java portlet standard requirements. To deploy any struts application as a portlet, the struts application is required to follow some of the following rules. Struts is a stable, widely adopted framework that implements the model view controller mvc design pattern. Below is the initparam elements that you can set up in portlet. Every controller class in spring portlet mvc framework must implement the org. Developing a spring portlet mvc framework application for use.
This tutorial demonstrates how to upgrade a portlet that uses the struts 1 framework. Download a release of apache struts the apache struts web framework is a free opensource solution for creating java web applications. Basically, you can think of the different portlet modes as different subapplications, so it can be useful to set up the struts. In addition, changes to the struts configuration file must be made to specify a portal. Wont it be good if the container itself takes care of managing the attributes thus relieving portletframeworks from doing the same. The tutorial is work in progress and is currently based on the 2. These are some of the advantages of spring portlet mvc framework. Heres a sample struts portlets folder structure with filefolder descriptions.
An xml file that defines a weblogic portal portlet, which is a container for. To deploy any struts application as a portlet, the struts application is required to follow these guidelines. It is available in a full distribution, or as separate library, source, example and documentation distributions. The java pdk struts renderer can be used for rendering a struts application as a portlet. Find answers to struts portlets vs spring portlets from the expert community at experts exchange. Struts portlet on liferay giving null pointer exception. I am try to download docx file within a struts2 liferay portlet. The scenarios included in this book can be used to learn about portlet programming and as a basis to develop your own portlet applications. Portlet plugin apache struts 2 wiki apache software. The tutorial is using the struts 2 portlet archetype which includes much of the stuff i have written about in this blog to hopefully improve portlet developmet productivity. There are different types of portlet containers such as apache pluto, oracle web center and liferay. You will also find numerous scenarios describing recommended ways to develop portlets and portlet applications using the apis provided by.
In this part, you see how to create a simple struts portlet, how to validate content using the validation framework, and how to display the header and footer using the tiles extension. In part 2, you learn how to add additional features to the portlet. This tutorial is intended to provide you a full detailed explanation for getting liferay portal up and running and deploy the same employee registration sample that we had developed in earlier tutorial. Edit on github back to plugins portlet plugin documentation. Understanding administration console extensions oracle docs.
Note that this tutorial assumes that youre familiar with basic struts 2 web. Move all struts based portlets that are based on this hcl framework to the apache struts portlet framework. By the way, could you specify which version are you using. If the struts bridge portletservlet which extends actionservlet detects it is not accessed from a portlet context is simply delegates back to the underlying struts framework. You can see samplestrutsportlet or samplestrutsliferayportlet. Create a workspace and ear portal, and add a portal web project to it. This is the portlet that acts as the dispatcher for the struts 2 framework, and translates incoming user interaction to action requests that struts 2 understands. A jsr168 compliant bookmarks management portlet application developed with apache struts and the apache struts bridge from the apache portals bridge project. The framework consists of a controller portlet and a collection of processors for handling renderaction requests. In liferay we can develop portlet in various framework like. Struts 2 portlet tutorial jsr168 specification jsr286 specification. Struts portlets are based on the struts framework, which is an implementation of the.
Chapter 8 deploying struts application as a portlet in. The struts portlet framework has supplied an implementation of the commonslogging selection from ibm rational application developer v6 portlet application development and portal tools book. The portlet plugin is used for developing jsr286 portlets using struts 2. Struts portlet framework specific init parameters have been added that allows you to customize the struts application for the portal environment. Ibm struts portlet framework and apache struts portal bridge also use session as the underlying mechanism. In earlier tutorials, weve developed different types of portlet. Or download some of distributions for fully offline development. Jsr286dispatcher as the portlet class in your portlet. Perquisites installation of weblogic portal, including the eclipse workshop. As much as possible, the portlet mvc framework is a mirror image of the web mvc framework, and also uses the same underlying view abstractions and integration technology. Provided the struts application doesnt use any portlet specific features and the action mapping configuration is also still valid for a web application, the same. If you are familiar with apache struts framework, then you can consider the controller class similar to the action class in apache struts framework. Both the struts based portlet framework based on the hcl portlet api and the struts based portlet framework based on the jsr 168 standard api are no longer available and are removed from support.
I just tried adding the struts simple app that is available on sourceforge. Liferay mvc out of the box provided by liferay spring mvc the one which i gave my last reply zk portlet struts 1 portlet struts 2 portlet jsf portlet. Ibm rational application developer v6 portlet application. Struts 2 portlet tutorial apache struts apache software. An existing struts application can be used as a portlet without changes to the code or jsp files if. Install portal server 7 for extended struts framework struts.
It is used to develop jsr 168 portlet using struts 2. Refer to the apache maven download page for installation instructions. Struts was designed as an mvc framework for servlets, and does not offer support for portlets. A mvc framework similar to struts for building jsr 168 compliant portlets. Adding logging support to the application the struts portlet framework uses the commonslogging interface for a logging facility.
The full hibernate plugin provides hibernate validator integration, hibernate core sessions and transactions injection capabilities and a. Architecture of struts 2 framework features and enhancements in struts 2. Struts portlets vs spring portlets solutions experts. Struts 2 portlet tutorial apache struts 2 wiki apache.