views:

301

answers:

1

I've written a service framework using Hessian and want to keep URL's common but the flexability of auto-deploy.

If i deploy a Service.war I can access it fine using /Service however, I want a general spot for all services.

How could I have a seperate context where all services live and get auto-deployed. Exactly like how axis2.war does it with its services directory?

For example: I deploy an exploded MyBridge.war which contains a directory within it called services. I deploy HelloWorldService.rar within the MyBridge.war/WEB-INF/services and it gets deployed.

I can then accesss MyBridge/HelloWorldService ?

can this be done? I'm trying to do auto-deployment without using spring and hessian and just hessian.

A: 

Axis2 is doing it by defining a simple servlet mapping:

<servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>

This is all that is needed. You could also use a filter. Your servlet/filter will receive all requests to the defined path and will use the resources under WEB-INF/services to serve them. I believe that you would need a special class loader in order to load the classes/jar files stored there.

If you want to have MyBridge/HelloWorldService and not MyBridge/services/HelloWorldService, then you need to pass all requests to the services servlet/filter (/* url-pattern). This way you won't be able to have an administration page.

kgiannakakis