Sun Java System Portal Server 7 Configuration Guide

Creating and Modifying XML Files

This section contains the following:

Modify struts-config.xml File

Change the RequestProcessor to org.apache.struts.action.PortletRequestProcessor or org.apache.struts.tiles.PortletTilesRequestProcessor, if the application is using Tiles.

For example:

<controller 
contentType="text/html;charset=UTF-8"
debug="3"
locale="true"
processorClass="org.apahce.struts.action.PortletRequestProcessor">
<!-- The "input" parameter on "action" elements is the name of a local or global "forward"
rather than a module-relative path -->
<set-property property="inputForward" value="true"/>
</controller>

Create portlet.xml File

Every portlet WAR must have one portlet.xml file in the WEB-INF directory of the web application. When creating the portlet.xml file, note that:

Here is a sample portlet.xml file for struts-portlet application:

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/portlet/porlet-app_1_0.xsd" version="1.0">

<portlet>
		<portlet-name>StrutsPortlet</portlet-name>
		<portlet-class>org.apache.struts.action.StrutsPortlet</portlet-class>
		<init-param>
			<name>initPage</name>
			<value>/index.jsp</value>
		</init-param>
		<init-param>
			<name>helpPage</name>
			<value>/tour.htm</value>
		</init-param>
		<init-param>
			<name>editPage</name>
			<value>/edit.jsp</value>
		</init-param>
		<init-param>
			<name>factoryPage</name>
			<value>com.sun.portal.struts.wrapper.PSServletObjectsFactory</value>
		</init-param>
		<init-param>
			<name>config</name>
			<value>/WEB-INF/struts-config.xml,/WEB-INF/struts-config-registration.xml</value>
		</init-param>
		<init-param>
			<name>servletPage</name>
			<value>*.do</value>
		</init-param>
			<expiration-cache>0</expiration-cache>
			<supports>
				<mime-type>text/html</mime-type>
				<portlet-mode>HELP</portlet-mode>
				<portlet-mode>EDIT</portlet-mode>
			</supports>
		<portlet-info>
			<title>StrutsPortlet</title>
		</portlet-info>
	</portlet>
</portlet-app>