mirror of
https://github.com/octoleo/plantuml-server.git
synced 2025-01-31 09:38:27 +00:00
Running PlantUML as ROOT.war
This commit is contained in:
parent
f37bbe9d41
commit
d7a8a7e698
@ -62,7 +62,7 @@ public class PlantUmlServlet extends HttpServlet {
|
||||
// Last part of the URL
|
||||
public static final Pattern URL_PATTERN = Pattern.compile("^.*[^a-zA-Z0-9\\-\\_]([a-zA-Z0-9\\-\\_]+)");
|
||||
|
||||
private static final Pattern RECOVER_UML_PATTERN = Pattern.compile("/\\w+/uml/(.*)");
|
||||
private static final Pattern RECOVER_UML_PATTERN = Pattern.compile("/uml/(.*)");
|
||||
|
||||
@Override
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
||||
@ -131,7 +131,8 @@ public class PlantUmlServlet extends HttpServlet {
|
||||
|
||||
private String getTextFromUrl(HttpServletRequest request, String text) throws IOException {
|
||||
String url = request.getParameter("url");
|
||||
final Matcher recoverUml = RECOVER_UML_PATTERN.matcher(request.getRequestURI());
|
||||
final Matcher recoverUml = RECOVER_UML_PATTERN.matcher(request.getRequestURI().substring(
|
||||
request.getContextPath().length()));
|
||||
// the URL form has been submitted
|
||||
if (recoverUml.matches()) {
|
||||
final String data = recoverUml.group(1);
|
||||
|
@ -45,7 +45,7 @@ public abstract class UmlDiagramService extends HttpServlet {
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
||||
|
||||
// build the UML source from the compressed request parameter
|
||||
final String[] sourceAndIdx = getSourceAndIdx(request.getRequestURI());
|
||||
final String[] sourceAndIdx = getSourceAndIdx(request);
|
||||
final String uml;
|
||||
try {
|
||||
uml = UmlExtractor.getUmlSource(sourceAndIdx[0]);
|
||||
@ -67,7 +67,7 @@ public abstract class UmlDiagramService extends HttpServlet {
|
||||
dr = null;
|
||||
}
|
||||
|
||||
private static final Pattern RECOVER_UML_PATTERN = Pattern.compile("/\\w+/\\w+/(\\d+/)?(.*)");
|
||||
private static final Pattern RECOVER_UML_PATTERN = Pattern.compile("/\\w+/(\\d+/)?(.*)");
|
||||
|
||||
/**
|
||||
* Extracts the compressed UML source from the HTTP URI.
|
||||
@ -76,8 +76,10 @@ public abstract class UmlDiagramService extends HttpServlet {
|
||||
* the complete URI as returned by request.getRequestURI()
|
||||
* @return the compressed UML source
|
||||
*/
|
||||
public final String[] getSourceAndIdx(String uri) {
|
||||
final Matcher recoverUml = RECOVER_UML_PATTERN.matcher(uri);
|
||||
public final String[] getSourceAndIdx(HttpServletRequest request) {
|
||||
final Matcher recoverUml = RECOVER_UML_PATTERN.matcher(
|
||||
request.getRequestURI().substring(
|
||||
request.getContextPath().length()));
|
||||
// the URL form has been submitted
|
||||
if (recoverUml.matches()) {
|
||||
final String data = recoverUml.group(2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user