<dependency> <groupId>org.osgi.enroute</groupId> <artifactId>osgi.enroute.web.simple.provider</artifactId> <version>1.0.0</version> </dependency> html <!DOCTYPE html> <html> <head> <link href="/webresources/pagedown/example/examples.css" rel="stylesheet" type="text/css"> <script src="/webresources/pagedown/example/prettify.js"></script> <script src="/webresources/pagedown/pagedown/Markdown.Converter.js"></script> <script src="/webresources/pagedown/pagedown/Markdown.Sanitizer.js"></script> <script src="/webresources/pagedown/pagedown/Markdown.Editor.js"></script> </head> <body> <div id="wmd-editor" class="wmd-panel"></div> <script> var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); editor.run(); </script> </body> </html> import org.osgi.service.http.HttpService; import org.osgi.service.http.NamespaceException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; public class PagedownServlet extends HttpServlet { private HttpService httpService; public void setHttpService(HttpService httpService) { this.httpService = httpService; } public void activate() throws ServletException, NamespaceException { httpService.registerServlet("/pagedown", this, null, null); } public void deactivate() { httpService.unregister("/pagedown"); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.getRequestDispatcher("/index.html").forward(req, resp); } } Bundle-Version: 1.0.0 Private-Package: com.example -include: index.html=index.html -include: templates/ Servlet-Path: /pagedown


上一篇:
下一篇:
切换中文