Apache cxfはFormattedServiceListWriter
というクラスを使用して、あなたが話しているhtmlページを生成します。コードhereを見ることができます。
このページをパーソナライズするには、同じパッケージに同名のクラスを作成する(プロジェクト内にそのパッケージを作成する必要があります)writeServiceList
メソッドを変更してください独自の実装、そのクラスはCXFジャーに
新しいFormattedServiceListWriter
クラス
package org.apache.cxf.transport.servlet.servicelist;
/*--imports--*/
public class FormattedServiceListWriter implements ServiceListWriter {
/*... this remains the same as in the original class*/
public void writeServiceList(PrintWriter writer,
String basePath,
AbstractDestination[] soapDestinations,
AbstractDestination[] restDestinations) throws IOException {
/*this is the method you should change*/
writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" "
+ "\"http://www.w3.org/TR/html4/loose.dtd\">");
writer.write("<HTML><HEAD>");
writer.write("<LINK type=\"text/css\" rel=\"stylesheet\" href=\"" + styleSheetPath + "\">");
writer.write("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">");
if (title != null) {
writer.write("<title>" + title + "</title>");
} else {
writer.write("<title>CXF - Service list</title>");
}
writer.write("</head><body>");
writer.write("<span class=\"heading\">WHATEVER YOU WANT TO PUT HERE</span>");
writer.write("</body></html>");
}
/*... this remains the same as in the original class*/
}
を1よりも優先されます、あなたはさらに説明できますか?あなたはいつサービス記述HTMLページを保存するのですか? –
例のURLはhttp:// localhost:8080/UserDetailsで、「利用可能なSOAPサービス:」と「利用可能なRESTfulサービス:」の一覧が表示されますので、これらのリストの代わりに他のメッセージを表示します。 –