特定のページアクセスした場合に HTTPS のページにリダイレクトをさせたり、また逆にあるページにアクセスした場合に HTTP を表示したい場合があるかと思います。 そのような場合に対応するため、PALポータルでは SSL リダイレクトバルブを提供しています。 SSL リダイレクトバルブをパイプラインに追加することで、ページ単位で SSL ページにするかどうかの指定ができます。
webapps/palportal/WEB-INF/assembly/pipelines.xml
に jp.sf.pal.portal.redirect.impl.SSLRedirectValveImpl を追加します。
... <bean id="sslRedirectValve" class="jp.sf.pal.portal.redirect.impl.SSLRedirectValveImpl"> <constructor-arg> <value>redirect.to.ssl.page</value> </constructor-arg> <constructor-arg> <value>80</value> </constructor-arg> <constructor-arg> <value>443</value> </constructor-arg> </bean> <bean id="jetspeed-pipeline" class="org.apache.jetspeed.pipeline.JetspeedPipeline" init-method="initialize" > <constructor-arg> <value>JetspeedPipeline</value> </constructor-arg> <constructor-arg> <list> <ref bean="capabilityValve"/> <ref bean="portalURLValve"/> <ref bean="securityValve"/> <ref bean="localizationValve"/> <ref bean="passwordCredentialValve"/> <ref bean="loginValidationValve"/> <ref bean="profilerValve"/> <ref bean="sslRedirectValve"/> ...
sslRedirectValve を bean 要素を追加して、jetspeed-pipeline の profilerValve の後に sslRedirectValve の ref 要素を追加します。SSLRedirectValveImplのコンストラクタ引数は、一番目の引数がページで指定するキーの名前、2番目が非SSLページで利用するポート、3番目がSSLページで利用するポートです。 設定を保存し、ポータルを再起動後に有効になります。
設定後、サイトエディターで各ページ(PSML)の直下にあるレイアウトのプロパティに redirect.to.ssl.page のキーで true または false を設定します。true の場合は SSL ページにリダイレクとして、false の場合は非 SSL ページにリダイレクトします。redirect.to.ssl.pageを指定しない場合は、指定された URL をそのまま表示します。 サイトエディターの使い方については、「管理ガイド」を参照してください。