XIV. 部署 Stringbeans为ROOT上下文
------------------------------------------
1. 在 $TOMCAT_HOME下建立stringbeans目录.
2. 解压 stringbeans.war 到刚建立的stringbeans目录.
3. 修改$TOMCAT_HOME/conf目录下的配置文件server.xml
在Host标签下,添加以下的context
Context path= docBase=..stringbeans debug=0
Typically there is Tomcat's ROOT context. If it is enabled, rename
it to any name. e.g.
Context path=root docBase=ROOT debug=0
4. 启动 Tomcat.
Windows $TOMCAT_HOMEbinstartup.bat
Unix or Linux $TOMCAT_HOMEbinstartup.sh
5. You can connect to Stringbeans Portal by typing only your server name
(plus port number if you are using other than port 80).
e.g. httplocalhost8080
XV. 使用 Stringbeans Struts 桥
------------------------------------
Stringbeans 的发布版本里包含有Struts 桥 ,本身支持 Struts应用部署为符合JSR-168
规范的应用。
下列步骤完成在Stringbeans上下文中部署Stru应用。ts
如果在不同的上下文环境中布置Struts应用,请按下面的绑定Struts桥的发行版(在单独的包中)的安装说明的步骤
1. 在$STRINGBEANS_HOME/WEB-INF/目录下的portlet.xml中增加Struts portlet的配置
portlet 的定义必须满足:
- 指定 com.nabhinc.portlet.strutsbridge.StrutsPortlet 作为 portlet-class
- 指定 ServletContextProvider 初始化参数为
com.nabhinc.portlet.strutsbridge.impl.ServletContextProviderImpl.
例如:
<portlet>
<description>....</description>
<portlet-name>....</portlet-name>
<display-name>....</display-name>
<portlet-class>com.nabhinc.portlet.strutsbridge.StrutsPortlet</portlet-class>
<init-param>
<name>ServletContextProvider</name>
<value>com.nabhinc.portlet.strutsbridge.impl.ServletContextProviderImpl</value>
</init-param>
<init-param>
<name>ViewPage</name>
<value>....</value>
</init-param>
<init-param>
<name>HelpPage</name>
<value>....</value>
</init-param>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<portlet-mode>HELP</portlet-mode>
</supports>
<portlet-info>
<title>....</title>
<keywords>....</keywords>
</portlet-info>
</portlet>
ViewPage, HelpPage 和 EditPage 分别定义 view, help 和 edit 模式.
参照“已知的问题”章节,可见使用Struts桥改变模式时可能遇到的问题。
3.. 修改$STRINGBEANS_HOME/WEB-INF 目录下的web描述文件,里面包含Struts应用的配置。修改servlet class 必须为action Servlet 。
- 在action Servlet.中,用org.apache.portals.bridges.struts.PortletServlet 代替
org.apache.struts.action.ActionServlet
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.portals.bridges.struts.PortletServlet</servlet-class>
<init-param>
:
:
</servlet>
4. 配置 Struts 应用程序
在进行后面的步骤前,Struts 应用程序布置必须符合“假定项目”要求的规范
- Struts 桥包含的jar文件里含有四个增强的标签库(提供了对
Struts HTML JSP (包含 EL 变量)的支持. 分别是:
struts-portlet.tld
struts-portlet-e;.tld
struts-1.2.4-portlet-html.tld
struts-1.2.4-portlet-html-el.tld
这些增强的Struts HTML JSP 标签(htmlform, htmllink, htmlrewrite,
htmlrewrite, and htmlimg) 用来解析资源url ,如图片 javascripts 以及样式表等等
想使用这些标签,需要先在web.xml文件中定义这些标签的映射。如下:
<%@ taglib uri=”http://portals.apache.org/bridges/struts/tags-portlet-html” prefix=”html” %>
或者
<%@taglib uri=”http://portals.apache.org/bridges/struts/tags-portlet-html-el “prefix=”html-el” %>
对于 html链接,html重写,附加的actionURL属性,renderURL属性或resourceURL属性,可以指定URL 生成或重写的类型。如果没有指定,默认是renderURL=true
在引用图片时,使用html标签,会有一个小的改变。例如:
<img src=..images/struts-bridge.gif>
改成
<html:image src=”..images/struts-bridge.gif” />
- 在增加的上面的 html link 属性, url 类型必须在
struts-portlet-config.xml ( 如果不存在,您需要在$STRUTS_APP_HOMEWEB-INF 目录创建这个文件)中指定.
Action 或 解析的URL 的所在路径都要配置。资源路径应该是资源URL类型。
通常的struts-portlet-config.xml 的配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<render-context>
<attribute name="errors"/>
<attribute name="message" keep="true"/>
</render-context>
<portlet-url-type>
<action path="/shop/add"/>
<action path="/shop/switch"/>
<action path="/shop/newOrder"/>
<render path="/shop/newOrderForm"/>
<action path="/shop/listOrders"/>
<resource path="/images/"/>
</portlet-url-type>
</config>
如果需要各个请求这间保留特定的请求参数,render-context 需要用到。render-context
这个保留属性使消息对象在下次Action请求或URL改变时都能可用。没有这个属性,这些对象仅仅只能使用一次。
关于 Struts 使用的完整说明在:
http://portals.apache.org/jetspeed-2/multiproject/portals-bridges-struts/features.html
分享到:
相关推荐
NULL 博文链接:https://solomon.iteye.com/blog/702330
Stringbeans由两部分构成:一个是后台自动运行的WebService服务来管理信息任务,另外一个是前端的门户框架来管理Web表现层。 Stringbeans大大降低了业务设计、维护业务门户所花费的精力,还提供了可视化的编辑器来...
liferay-portal-sql-6.1.1-ce-ga2-20120731132656558
Portal-for-ArcGIS-10.5安装配置(详细说明)包含环境配置,设置iis服务器等等详细操作
project-xczx2-portal-vue-ts.zip
基于php实现的Intechnic In-portal platform v1.0.7_in-portal107基于php实现的Intechnic In-portal platform v1.0.7_in-portal107基于php实现的Intechnic In-portal platform v1.0.7_in-portal107基于php实现的...
Portal-for-ArcGIS-10.3安装与配置.docx
ERP系统信息化资料:Portal配置文档-登陆界面配置文档.doc
TIA Portal V13中使用S7-300 ProfibusDP 通信入门!!!!
西门子兼容性STEP-7-Basic-(TIA-Portal)_compatibility-list_zh更新日期2023-07-20
JBoss Portal安装及配置说明.doc
portal安装与配置,中文版,容易入手
Liferay系列文章(三)Portal产品介绍--商业Portal产品
ERP系统信息化资料:Portal配置文档-CRM 用户管理集成.doc
ERP信息化专业资料:_Portal配置文档-主题修改文档.doc
ASP网站整站程序PHP源码_Intechnic In-portal platform v1.0.7_in-portal107整站打包程序_毕设源码实例ASP网站整站程序PHP源码_Intechnic In-portal platform v1.0.7_in-portal107整站打包程序_毕设源码实例ASP网站...
ERP信息化专业资料:_Portal配置文档-CRM 用户管理集成.doc
整站程序Intechnic In-portal platform v1.0.7-in-portal107.zip
中国电信用户数据库- UDB与WLAN Portal认证集成方案-v2.0
ws_portal_G224-9202-00_526_wp