Das ServiceServlet verarbeitet jetzt zusätzlich zu Links der Form /ccm/cms-service/stream/asset/?asset_id=12345 bzw. /ccm/cms-service/download/asset/?asset_id=12345 auch Links, die zusätzlich den Namen der herzuladenen Datei
enthalten, z.B. /ccm/cms-service/download/asset/example.pdf/?asset_id=12345 Der Name der Datei wird von ServiceServlet ignorniert. git-svn-id: https://svn.libreccm.org/ccm/trunk@1712 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e56909c9cc
commit
909377f7d9
|
|
@ -124,6 +124,11 @@ public class ServiceServlet extends BaseApplicationServlet {
|
||||||
/**
|
/**
|
||||||
* Implements the (abstract) doService method of BaseApplicationServlet to
|
* Implements the (abstract) doService method of BaseApplicationServlet to
|
||||||
* perform the services.
|
* perform the services.
|
||||||
|
* @param sreq
|
||||||
|
* @param sresp
|
||||||
|
* @param app
|
||||||
|
* @throws ServletException
|
||||||
|
* @throws IOException
|
||||||
* @see com.arsdigita.web.BaseApplicationServlet#doService
|
* @see com.arsdigita.web.BaseApplicationServlet#doService
|
||||||
* (HttpServletRequest, HttpServletResponse, Application)
|
* (HttpServletRequest, HttpServletResponse, Application)
|
||||||
*/
|
*/
|
||||||
|
|
@ -146,7 +151,7 @@ public class ServiceServlet extends BaseApplicationServlet {
|
||||||
// An empty remaining URL or a URL which doesn't end in trailing slash:
|
// An empty remaining URL or a URL which doesn't end in trailing slash:
|
||||||
// probably want to redirect.
|
// probably want to redirect.
|
||||||
if ( m_trailingSlashList.contains(url) && !originalUrl.endsWith("/") ) {
|
if ( m_trailingSlashList.contains(url) && !originalUrl.endsWith("/") ) {
|
||||||
DispatcherHelper.sendRedirect(sresp, originalUrl + "/");
|
DispatcherHelper.sendRedirect(sreq, sresp, originalUrl + "/");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,6 +160,19 @@ public class ServiceServlet extends BaseApplicationServlet {
|
||||||
/* checkUserAccess(request, response, actx); */
|
/* checkUserAccess(request, response, actx); */
|
||||||
|
|
||||||
ResourceHandler page = getResource(url);
|
ResourceHandler page = getResource(url);
|
||||||
|
|
||||||
|
if (page == null) {
|
||||||
|
//Retry without last part
|
||||||
|
final String[] tokens = url.split("/");
|
||||||
|
|
||||||
|
final StringBuilder altUrlBuilder = new StringBuilder('/');
|
||||||
|
for(int i = 0; i < tokens.length - 1; i++) {
|
||||||
|
altUrlBuilder.append(tokens[i]);
|
||||||
|
altUrlBuilder.append('/');
|
||||||
|
}
|
||||||
|
page = getResource(altUrlBuilder.toString());
|
||||||
|
}
|
||||||
|
|
||||||
if ( page != null ) {
|
if ( page != null ) {
|
||||||
// Serve the page.
|
// Serve the page.
|
||||||
page.init();
|
page.init();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue