Q.

WebLogic は配備した WAR ファイルを展開しないため、 WebLogic で同じ WAR ファイルを配備する場合は、結果は異なり、 ServletContext の getRealPath() メソッドは null を返します。では、この環境で、プロパティファイル/テンプレート/スタイルシートServlet/ビルドプロセスは、どのように扱えばよいのでしょうか?

A.
web.xml


...
...

properties
/WEB-INF/velocity.properties

Servlet

protected Properties loadConfiguration (ServletConfig config) throws IOException, FileNotFoundException {
String propsFile = config.getInitParameter(INIT_PROPS_KEY);
Properties p = new Properties();

if ( propsFile != null ) {
InputStream iStream = getServletContext().getResourceAsStream( propsFile );

if ( iStream != null ) {
p.load( iStream );
}
}

return p;
}

http://www.jajakarta.org/velocity/velocity-1.3.1/docs-mixed/velocity_and_weblogic.html#Setting%20the%20Configuration%20Properties