New features of the JSR 286 portlet, part 3rd

Source: Internet
Author: User
Tags log log new features

Portlet Filters and Portlet windows

In the 1th part of this series, we briefly review the JSR-2.0 portlet and introduce the new features of the JSR 286 portlet in detail, with parts 2nd and 3rd going through the development and deployment of portlets on the Apache Pluto platform Application to introduce to readers how the new features of the JSR 286 Portlet are used. This article describes the Portlet Filter and Portlet window application development for the JSR 286 portlet.

About this series

This series is designed for developers who have a JSR portlet development base and want to learn about the new features and development processes of the JSR 286 portlet. After completing this series, you will learn what enhancements are available relative to the JSR PORTLET,JSR 286 Portlet, and how these new features are applied in real-world development.

Part 1th of this series briefly reviews the JSR-a portlet and lists what's new in the JSR 286 portlet. Parts 2nd and 3rd will provide readers with a way to use the new features of the JSR 286 portlet by developing and deploying Portlet applications on the Apache Pluto 2.0 platform.

About this article

This article takes part 2nd to continue with the development of portlet Filter and Portlet window application for the JSR 286 portlet. Before reading this article, you should have an idea of the JSR Portlet and read the 1th and 2nd parts of this series.

Portlet Filters

By introducing the 1th part, we know that the Portlet filters are divided into:

Action Filter

Render Filter

Resource Filter

Event Filter

We will first introduce each of the four Portlet filters separately, then combine the four Portlet filters for further development, and finally use the combination of servlet filters to make the reader aware that the Portlet filters and servlet The relationship and difference between filters.

Action Filter

New Java class Testactionfilter:

Listing 1. Testactionfilter.java file

Package com.ibm.samples.jsr286.filters;

Import ...

public class Testactionfilter implements Actionfilter {

private static log log = Logfactory.getlog (Testactionfilter.class);

Private Filterconfig Filterconfig;

public void init (Filterconfig filterconfig) throws Portletexception {
Log.info ("Action filter [" + Filterconfig.getfiltername ()
+ "] is initialized.");
This.filterconfig = Filterconfig;
}

public void Destroy () {
Log.info ("Action filter [" + Filterconfig.getfiltername ()
+ "] is destroyed.");
}

public void Dofilter (Actionrequest actionrequest,
Actionresponse Actionresponse, Filterchain filterchain)
Throws IOException, Portletexception {
Log.info ("Action filter [" + Filterconfig.getfiltername ()
+ "] is called.");
Filterchain.dofilter (Actionrequest, actionresponse);
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.