以plugin.xml形式注册web服务。
plugin.xml:
<?xml version="1.0" encoding="UTF-8"?> <plugin> <extension point="org.eclipse.equinox.http.registry.resources"> <resource alias="/WebOSGI/page/student" base-name="/bin/org/forever/page/student"/> </extension> <extension point="org.eclipse.equinox.http.registry.servlets"> <servlet alias="/WebOSGI/student" class="org.forever.webosgi.action.StudentAction"></servlet> </extension> </plugin>
MANIFEST.MF中的Bundle-SymbolicName: WebOSGIBundel;singleton:=true多了个;singleton:=true
启动后访问http://localhost/WebOSGI/student和http://localhost/WebOSGI/page/student/List.html
这样就ok了。