O'Reilly logo

Struts 2 Design and Programming: A Tutorial by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 23. Plug-ins

The Struts plug-in provides an elegant mechanism to promote code reuse. A plug-in is essentially a JAR. It may contain Java classes, FreeMarker or Velocity templates, and a struts-plugin.xml file. The latter, if present, can be used to configure applications that use the plug-in.

In this chapter you will learn how to write plug-ins.

Overview

Struts has been designed to be extensible through plug-ins. Using a plug-in is as easy as copying the plug-in JAR file to the WEB-INF/lib directory. Unlike an ordinary JAR file, a plug-in may contain a struts-plugin.xml file that complies with the same rules as a struts.xml file. It is possible to include configuration settings in a plug-in because Struts loads configuration files in this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required