Hello,
atm i have a simple html table hardcoded ... i can add some stylesheets
there and make stylesheet file configurable ... it seems to be a good
start.
private void generateServiceList(HttpServletRequest request,
HttpServletResponse response)
throws IOException {
Collection<ServletDestination> destinations = transport
.getDestinations();
response.setContentType("text/html");
response.getWriter().write("<html><body>");
if (!isHideServiceList) {
if (destinations.size() > 0) {
response.getWriter().write("<table cellpadding=\"1\"
cellspacing=\"1\" border=\"1\" width=\"100%\">");
for (ServletDestination sd : destinations) {
if (null != sd.getEndpointInfo().getName()) {
response.getWriter().write("<tr><td>");
response.getWriter().write("</br>"
+sd.getEndpointInfo().getInterface().getName().getLocalPart());
response.getWriter().write("<ul>");
for (OperationInfo oi :
sd.getEndpointInfo().getInterface().getOperations()) {
response.getWriter().write("<li>"
+oi.getName().getLocalPart()+"</li>");
}
response.getWriter().write("</ul>");
response.getWriter().write("</td><td>");
String address =
sd.getEndpointInfo().getAddress();
response.getWriter().write("</br>Endpoint address:
"+address);
response.getWriter().write("</br>Wsdl: <a href=\""
+ address + "?wsdl\">"+sd.getEndpointInfo().getService().getName()+"</a>"
);
response.getWriter().write("</br>Target namespace:
"+sd.getEndpointInfo().getService().getTargetNamespace());
response.getWriter().write("</td></tr>");
}
}
response.getWriter().write("</table>");
} else {
response.getWriter().write("No service was found.");
}
}
response.getWriter().write("</body></html>");
}
does someone has an idea how to do it even more pluggable and
configurable?
well, i can create an interface with method
private void generateServiceList(HttpServletRequest request,
HttpServletResponse response)
and make its implementation class pluggable.
other idea is to make template plugable .. but IMHO current set of
dependencies doesn't contain any templating engine.
other idea is to build xml from data and make xsl transform to produce
result. Xsl will be input in this case. .. but it's a quite strange for a
simple page ;)
best regards
jano
Daniel Kulp <[EMAIL PROTECTED]>
06/04/2008 18:20
Bitte antworten an
[email protected]
An
[email protected]
Kopie
Thema
Re: http servlet -> nicer list of services [Virus checked]
On Jun 4, 2008, at 12:04 PM, [EMAIL PROTECTED] wrote:
> Hello,
>
> is it by spec of jaxws or other spec, that GET request to cxf sevlet
> returns so ugly list of services?
Not per spec. Mostly just no time to design something nicer.
>
> If not, i'll create a issue for it and submit a patch with produces
> nicer
> (in my opinion) list of services, including operations etc.
That would be super. If you could also make it a bit pluggable (or
at least a pluggable style sheet or something) so the users could
customize it a bit, that would be super super. :-)
Dan
>
>
> best regards
> jano
---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog