服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

在weblogic portal里加入struts的应用程序主要步骤

在weblogic portal里加入struts的应用程序主要步骤(图一)

在portal里加入struts的应用程序的主要步骤:
一:在portal中加入struts程序
(1)   struts应用程序复制到你的webapp中的新目录中。你所选择的放置struts应用程序的目录将成为用于portal中应用程序的struts模块路径。比如,如果你的struts应用程序目录是test,那么你的应用程序的模块就是/test。将针对你的struts应用程序的struts-config.xml复制到web-inf/.pageflow-struts-generated/下,更改其文件名,命名规则为jpf-struts-config-<dir>.xml,本例子中为jpf-struts-config-test.xml. 使用这种命名规则允许用在 portal 中的行为 servlet动态地注册struts应用程序模块。
(2)      将下面的内容添加到struts的配置文件中:
<controller classname="com.bea.wlw.netui.pageflow.config.pageflowcontrollerconfig" multipartclass="com.bea.wlw.netui.pageflow.upload.pageflowmultipartrequesthandler" inputforward="true" processorclass="com.bea.wlw.netui.pageflow.pageflowrequestprocessor">
<set-property value="true" property="isreturntopagedisabled"/>
<set-property value="true" property="isreturntoactiondisabled"/>
</controller>
(3)      将相应的struts里所需要的java文件copyweb-inf/src下面,本例中为teststruts.
(4)   对新加入的jpf-struts-config-<dir>.xml根据目录做相应的调整,使之与workshop中的目录结构一致.
<?xml version="1.0" encoding="utf-8"?>
<!doctype struts-config public "-//apache software foundation//dtd struts configuration 1.1//en" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<!-- generated from /test/testcontroller.jpf on thu mar 30 23:22:05 cst 2006 -->
<struts-config>
 <form-beans/>
 <global-exceptions/>
 <global-forwards/>
 <form-beans>
    <form-bean name="useractionform" type="teststruts.useractionform" />
 </form-beans>
 <action-mappings>
    <!--action validate="false" scope="request" type="test.testcontroller" path="/begin">
      <forward path="/index.jsp" name="success"/>
    </action-->
    <action validate="false" scope="request" path="/startaction" type="teststruts.startaction">
      <forward name="success" path="/login.jsp" />
    </action>
    <action validate="false" scope="request" name="useractionform" path="/loginaction" type="teststruts.loginaction">
      <forward name="success" path="/success.jsp" />
      <forward name="err" path="/err.jsp" />
    </action>
 </action-mappings>
 <controller classname="com.bea.wlw.netui.pageflow.config.pageflowcontrollerconfig" multipartclass="com.bea.wlw.netui.pageflow.upload.pageflowmultipartrequesthandler" inputforward="true" processorclass="com.bea.wlw.netui.pageflow.pageflowrequestprocessor">
    <set-property value="true" property="isreturntopagedisabled"/>
    <set-property value="true" property="isreturntoactiondisabled"/>
 </controller>
</struts-config>
二.将struts程序配置为portlets
在test目录下新建portlets
在weblogic portal里加入struts的应用程序主要步骤(图二)
 选择建立struts portlets
注意:要为struts生成portletstruts里的必须以action作为入口,不能以jsp作为其入口.
在weblogic portal里加入struts的应用程序主要步骤(图三)
点击查看大图
为struts选择module uri,本例中选择test目录,即生成的portlet放在test目录下.
在weblogic portal里加入struts的应用程序主要步骤(图四)
点击查看大图
 选择strutsconfig文件
在weblogic portal里加入struts的应用程序主要步骤(图五)
点击查看大图
本例中选择jpf-struts-config-test.xml
在weblogic portal里加入struts的应用程序主要步骤(图六)
加入配置文件
在weblogic portal里加入struts的应用程序主要步骤(图七)
选择一个action作为portlet的入口
在weblogic portal里加入struts的应用程序主要步骤(图八)
点击查看大图
然后将生成的portlets加入portal即可.

扫描关注微信公众号