diff --git a/dspace-api/src/main/java/org/dspace/rdf/negotiation/NegotiationFilter.java b/dspace-api/src/main/java/org/dspace/rdf/negotiation/NegotiationFilter.java index 8860dcecf4..b883e15f45 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/negotiation/NegotiationFilter.java +++ b/dspace-api/src/main/java/org/dspace/rdf/negotiation/NegotiationFilter.java @@ -76,10 +76,19 @@ public class NegotiationFilter implements Filter String handle = null; String extraPathInfo = null; + String path = hrequest.getPathInfo(); + // in JSPUI the pathInfo starts after /handle, in XMLUI it starts with /handle + Pattern handleCheckPattern = Pattern.compile("^/*handle/(.*)$"); + Matcher handleCheckMatcher = handleCheckPattern.matcher(path); + if (handleCheckMatcher.matches()) + { + // remove trailing /handle + path = handleCheckMatcher.group(1); + } // we expect the path to be in the form //[], // where is a handle prefix, is the handle suffix // and may be further information. - String path = hrequest.getPathInfo(); + log.debug("PathInfo: " + path); if (path == null) path = ""; Pattern pathPattern = Pattern.compile("^/*([^/]+)/+([^/]+)(?:/*||/+(.*))?$"); @@ -89,6 +98,7 @@ public class NegotiationFilter implements Filter handle = pathMatcher.group(1) + "/" + pathMatcher.group(2); extraPathInfo = pathMatcher.group(3); } + log.debug("handle: " + handle + "\n" + "extraPathInfo: " + extraPathInfo); int requestedContent = Negotiator.negotiate(acceptHeader); diff --git a/dspace-xmlui/src/main/webapp/WEB-INF/web.xml b/dspace-xmlui/src/main/webapp/WEB-INF/web.xml index 3707124e1e..6cc316a2ff 100644 --- a/dspace-xmlui/src/main/webapp/WEB-INF/web.xml +++ b/dspace-xmlui/src/main/webapp/WEB-INF/web.xml @@ -110,6 +110,15 @@ + + + rdf-content-negotiation + org.dspace.rdf.negotiation.NegotiationFilter + + @@ -136,6 +145,11 @@ SetCharacterEncoding spring + + + rdf-content-negotiation + /handle/* +