您的位置:首页 > 其它

系统原型结构描述(三)

2008-07-29 08:45 267 查看
web.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app id="StrutsPortlet">

<!-- Uncomment/comment this if you need/don't need Spring support -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>

<filter id="filterdispatcher">
<filter-name>Struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>

<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>ChartServlet</servlet-name>
<servlet-class>com.test.action.view.chart.DisplayChart</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ChartServlet</servlet-name>
<url-pattern>/ChartServlet</url-pattern>
</servlet-mapping>

</web-app>

portlet.xml

<?xml version="1.0" encoding="UTF-8"?>

<portlet-app
version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="struts-portlet">

<portlet id="StrutsPortlet">
<description>Struts Test Portlet</description>
<portlet-name>StrutsPortlet</portlet-name>
<display-name>Struts Test Portlet</display-name>

<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>

<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>

<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>

<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>

<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>

<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>

<!-- The default action to invoke in help mode. -->
<init-param>
<name>defaultHelpAction</name>
<value>index</value>
</init-param>

<expiration-cache>0</expiration-cache>

<supports>
<mime-type>image/png</mime-type>
<portlet-mode>view</portlet-mode>
</supports>

<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
<portlet-mode>view</portlet-mode>
</supports>
<!--
<supports>
| <mime-type>image/png</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>-->

<supported-locale>en</supported-locale>

<portlet-info>
<title>My StrutsPortlet portlet</title>
<short-title>SP</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
</portlet-app>

struts-portlet-object.xml

<?xml version="1.0" encoding="UTF-8"?>
<deployments>
<deployment>
<if-exists>overwrite</if-exists>
<parent-ref>default</parent-ref>
<properties />
<page>
<page-name>StrutsPortlet Example</page-name>
<properties />
<window>
<window-name>StrutsWindow</window-name>
<instance-ref>StrutsPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
</page>
</deployment>
<deployment>
<if-exists>overwrite</if-exists>
<instance>
<instance-name>StrutsPortletInstance</instance-name>
<component-ref>struts-portlet.StrutsPortlet</component-ref>
</instance>
</deployment>
</deployments>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: