系统原型结构描述(三)

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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值