engine = new JetspeedEngine(properties, applicationRoot, config, initializeComponentManager(config, applicationRoot, properties)); Jetspeed.setEngine(engine); engine.start(); |
ServletConfigFactoryBean.setServletConfig(servletConfig); // String relativeApplicationRoot = getRealPath("/"); String relativeApplicationRoot = appRoot; String absApplicationRoot = new File(relativeApplicationRoot).getCanonicalPath(); final String assemblyDir = configuration.getString("assembly.dir","/WEB-INF/assembly"); final String assemblyFileExtension = configuration.getString("assembly.extension",".xml"); String[] bootConfigs = new String[] {"/WEB-INF/assembly/boot/*.xml"}; String[] appConfigs = new String[] {assemblyDir+"/*"+assemblyFileExtension}; ServletContext servletContext = servletConfig.getServletContext(); SpringComponentManager cm = new SpringComponentManager(bootConfigs, appConfigs, servletContext, appRoot); return cm; |
<bean id="JetspeedDS" class="org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntry">
<property name="jndiName">
<value>java:comp/env/jdbc/jetspeed</value>
</property>
</bean>
|
<bean id="JetspeedDS" class="org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntry">
<property name="driverClassName">
<value>{my.drivers.class.name}</value>
</property>
<property name="url">
<value>{URL to my DB}</value>
</property>
<property name="username">
<value>{username}</value>
</property>
<property name="password">
<value>{password}</value>
</property>
</bean>
|
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
或:
ConnectionManagerClass=org.apache.jetspeed.components.rdbms.ojb.ConnectionManagerImpl
|--------------------------
à
推荐这个
|
1、 form指向“/jetspeed/login/proxy”,在web.xml定义中,其被定向到“jetspeed-portal-version.jar”中的org.apache.jetspeed.login. LoginProxyServlet.java中
2、 LoginProxyServlet.java中,用户名和密码被封装在session中后,重定向到“/login/redirector”,指向“org.apache.jetspeed.login.LoginRedirectorServlet.java”中。
3、 在导向(触发)到/login/redirector时,由于在/conf/Catalina/jetspeed.xml中配置了居于JAASRealm的验证,并且连接在web.xml中的《security-constraint》中配置了对资源“/login/redirector”需要访问验证,所以JAAS验证被触发。
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
<context-root>/jetspeed</context-root>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/jetspeed</res-ref-name>
<jndi-name>JetspeedDB</jndi-name>
</resource-description>
</reference-descriptor>
<!--
<container-descriptor>
<servlet-reload-check-secs>-1</servlet-reload-check-secs>
</container-descriptor>
-->
</weblogic-web-app>
|
<portlet-preferences>
<preference>
<name>TopRange</name>
<value>100</value>
</preference>
</portlet-preferences>
|
private long getHighRange(PortletRequest request) {
PortletPreferences prefs = request.getPreferences();
String highRangePref = prefs.getValue("TopRange", "102");
//
如果找不到“
TopRange
”,返回默认值
102
long range = Long.parseLong(highRangePref);
if (range < 2) {
range = 102;
}
return range;
}
|
javax.portlet.title=/u89d2/u8272/u5b89/u5168/u6027/u6d4b/u8bd5
javax.portlet.short-title=/u89d2/u8272/u5b89/u5168/u6027/u6d4b/u8bd5
|
private Subject getSubject()
{
AccessControlContext context = AccessController.getContext();
return Subject.getSubject(context);
}
|
String site = request.getPreferences().getValue("SRC", null);
context = getPortletContext();
sso = (SSOProvider)context.getAttribute("cps:SSO");
Subject subject = getSubject(); // getSubject()在26中有说明。
SSOContext context = sso.getCredentials(subject, site);
request.setAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME, context.getRemotePrincipalName());
request.setAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD, context.getRemoteCredential());
………
super.doView(request, response);
|