4 Packaging and deployment
A portlet application’s resources, portlets and deployment descriptors are packaged together in one Web application archive (WAR file). In contrast to servlet-only Web applications, portlet applications consist of two deployment descriptors: one to specify the Web application resources, the web. xml, and one to specify the portlet resources, the portlet.xml. All Web resources that are not portlets must be specified in the web. xml deployment descriptor and all portlets and port- let related settings must be specified in the port let. xml. As a result of the two deployment descriptor ifies, portlet application deployment is a two-step deployment process that deploys the Web application into the application server and the portlets into the portal server.
Figs. 6 and 7 depict the schema of the portlet.xml file. Eachiabeled box represents a XML tag, dashed boxes are optional, non- dashed ones are required. Some tags may occur more than once and therefore have a cardinality added to them (0.. .oc for an unrestricted occurrence, 1.. .oc for at least one). Fig. 6 shows the settings that can be applied on the application level. These settings include the support of custom portlet modes or window states, user attributes (like the first or last name of the user, see also [4] for the most common user attribute names) and security constraints when accessing the portlet (like always use a SSL connection when accessing this portlet).
Fig. 7 depicts the settings on the portlet level, which include name and class of the portlet, initialization parameters, cache settings, supported output MIME types (e.g. text/html), supported locales, persistent preferences the portlet uses (see (3.4.1)), and J2EE roles the portlet accesses. An example of a deployment descriptor is presented in the example below.
5 Porfiets and J2EE
The portlet specification is very closely aligned with J2EE concepts.This close alignment is reflected in:
•Portlet applications are WAR files and can be deployed using the existing infrastructure for WAR files.
• portlets use also the HttpSession and can share data via the session with other J2EE artifacts like servlets.
•Portlets can access the web application context via the portlet API and share data with other J2EE artifacts on the context level.
• Portlets can access web application initialization parameters defined in the web. xml via the portlet context.
• Portlets can include servlets and JSPs via a request dispatcher.
• Portlet J2EE roles defined in the portlet.xml can reference J2EE roles defined in the web. xml enabling a unified role mapping between portlets and servlets.
The future goal is to keep the portlet specification aligned with the next J2EE versions and to become part of J2EE some day in the future.
请高手帮我翻译下列英文! 不要求很对,但要求很通顺! 谢谢!
请不要用翻译软件敷衍我!