LRP-614 practice question 15 of 25

A portlet application only needs the standard web.xml deployment descriptor to be considered valid.

Full set: 144 questions
Answer options
A: True
B: False
Correct Answer:
FALSE
Explanation

A valid portlet application, as defined by the Java Portlet Specification (JSR 286/JSR 362), requires at least two deployment descriptors to be correctly deployed and recognized by a portlet container like Liferay.
1. web.xml: This is the standard Java EE web application deployment descriptor. It is required because a portlet application is packaged as a standard Web Application Archive (WAR).
2. portlet.xml: This is the portlet-specific deployment descriptor. It is mandatory and contains the definitions of the portlets within the application, including their names, classes, supported modes, initialization parameters, and other essential metadata. Without the portlet.xml file, the portlet container would have no information about the portlets to register and manage, and the application would be treated as a standard web application, not a portlet application.

Why Incorrect

The statement "True" is incorrect because it omits the mandatory portlet.xml descriptor. While web.xml is necessary, it is not sufficient on its own to define a valid portlet application. The core identity and configuration of the portlets themselves are defined exclusively in portlet.xml.

References

1. Java Portlet Specification (JSR 286): Section PLT.14.2, "Deployment Descriptor," explicitly states: "The portlet deployment descriptor is an XML file called portlet.xml located in the WEB-INF directory of the portlet application. The portlet.xml file is required for a portlet application." This establishes portlet.xml as a mandatory component.

Source: JSR-000286 Portlet Specification 2.0, Page 83.

2. Liferay Portal 6.2 Developer's Guide: In the chapter on developing portlets, the guide outlines the essential configuration files for a Liferay portlet project. It lists portlet.xml as a required descriptor for defining the portlet to the portlet container, alongside web.xml for the web application aspects.

Source: Liferay, Inc. (2013). Liferay Portal 6.2 Developer's Guide. Chapter 2, "Developing a Liferay Portlet," Section "Anatomy of a Liferay Portlet Project," Page 29. This section details the required descriptors, including portlet.xml, liferay-portlet.xml, and web.xml.

Scroll to Top