<servlet>
<servlet-name>RestletServlet</servlet-name>
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
<init-param>
<!-- Application class name -->
<param-name>org.restlet.application</param-name>
<param-value>org.activiti.rest.explorer.application.ExplorerRestApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/bpm/service/*</url-pattern>
</servlet-mapping>
1.4.1.RELEASE springboot版本
怎么转换 ...
@ServletComponentScan
public class MyspringbootApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(MyspringbootApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MyspringbootApplication.class);
}
@Bean
public ServletRegistrationBean servletRegistrationBean() {
return new ServletRegistrationBean(new MyServlet1(), "/service/*");
}
}
@WebServlet(urlPatterns = "/service/*",initParams={@WebInitParam(name="org.restlet.application", value="com.anfae.admin.common.bpm.web.ExplorerRestApplication")})
public class MyServlet1 extends ServerServlet {
private static final long serialVersionUID = 1L;
}
public class ExplorerRestApplication extends ActivitiRestApplication {
public ExplorerRestApplication() {
super();
}
@Override
public synchronized Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attachDefault(DefaultResource.class);
ModelerServicesInit.attachResources(router);
DiagramServicesInit.attachResources(router);
JsonpFilter jsonpFilter = new JsonpFilter(getContext());
jsonpFilter.setNext(router);
return jsonpFilter;
}
https://blog.csdn.net/xiaoyao2246/article/details/83536716
//spring boot 2.x
@Bean
public ServletRegistrationBean<ServerServlet> restletServlet() {
ServletRegistrationBean<ServerServlet> bean = new ServletRegistrationBean<>(new ServerServlet(), "/bpm/service/*");
bean.setName("restletServlet");
return bean;
}
//spring boot 1.x
@Bean
public ServletRegistrationBean restletServlet() {
ServletRegistrationBean bean = new ServletRegistrationBean(new ServerServlet(), "/bpm/service/*");
bean.setName("restletServlet");
return bean;
}
那个有编译异常呀,位置是对的吧