1、 Jetspeed系統(tǒng)的配置文件在《JetSpeed2 home》\conf\Catalina\localhost下的jetspeed.xml文件中,此文件中定義了JAAS驗證的配置及數(shù)據(jù)庫連接模式(包括連接語句)
2、配置一個居于IFrame的應用:
1、 引入jar包:jetspeed-components-2.0.jar
jetspeed-rewriter-2.0.jar
jetspeed-web-content-2.0.jar
portals-bridges-velocity-1.0.jar
portals-gems-2.0.jar
(注:可以使用demo應用的lib)
2、 在portal.xml文件中配置一個portlet:
<portlet id="EchoIframe">
<portlet-name>EchoIframe</portlet-name>
<display-name>lixin IFrame Portlet</display-name>
<description>Prototype of the IFRAME2 portlet</description>
<portlet-class>org.apache.jetspeed.portlet.IFrameGenericPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-preferences>
<preference>
<name>SRC</name>
<value>http://www.sohu.com</value>
</preference>
<!-- Don‘t specify a HEIGHT if you want a normal filled out layout
because percentage values result in the content not to be displayed on IE6.
Specific values are ok though.
-->
<preference>
<name>HEIGHT</name>
<value>600</value>
</preference>
<preference>
<name>WIDTH</name>
<value>100%</value>
</preference>
<preference>
<name>MAX-HEIGHT</name>
<value>800</value>
</preference>
<preference>
<name>MAX-WIDTH</name>
<value>100%</value>
</preference>
<preference>
<name>SCROLLING</name>
<value>AUTO</value>
</preference>
</portlet-preferences>
<supported-locale>en</supported-locale>
<supported-locale>zh</supported-locale>
<portlet-info>
<title>搜狐網(wǎng)</title>
<short-title>搜狐網(wǎng)</short-title>
<keywords>iframe,frame,frame2,iframe2</keywords>
</portlet-info>
</portlet>
3、 配置對應的.psml文件,如下:
<fragment id="sample-335577" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
<fragment id="sample-3355771" type="portlet" name="sample::EchoIframe">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
<fragment id="sample-3355772" type="portlet" name="sample::EchoPortlet">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="1" />
</fragment>
</fragment>
3、
jetspeed2的登陸權(quán)限驗證完全居于JAAS,其配置文件是在jetspeed應用lib庫中的jetspeed-security-<version>.jar中的login.conf文件中定義的,如果想替換成自己的驗證模式,可以修改此配置文件,如下:
Jetspeed {
org.apache.jetspeed.security.impl.DefaultLoginModule required;
};
請注意,自己加的login.conf配置文件可以放在WEB-INF/classes目錄下的任何位置,并且修改WEB-INF/assembly目錄下的security-providers.xml文件相應的login.conf文件的新位置。
4、
JAAS的subject主要用來表示一個應用主體對象(用戶),此對象有一個或多個用來標識其身份的Principals,如名字(name principal)或者身份證號(SSN principal),principal是用來唯一標識此subject,以區(qū)別于其他的subject的。原文如下:
To authorize access to resources, applications first need to authenticate
the source of the request. The JAAS framework defines the term subject
to represent the source of a request. A subject may be any entity, such
as a person or a service. Once the subject is authenticated, a
javax.security.auth.Subject is populated with associated identities, or
Principals. A Subject may have many Principals. For example, a person may
have a name Principal ("John Doe") and a SSN Principal ("123-45-6789"),
which distinguish it from other subjects.