I have a DXA Java 1.5 development environment with Web 8.1.1. In this environment I need to merge DXA with an existing Static Website. If my existing pages have a jsp extension when I request those directly the response returns with the page as I was hoping. If I request a page that has an html or htm extension DXA tries to get the page from the broker. I thought that if I created a filter then mapped it in the web.xml this would forward the request appropriately to the Static htm or html on the filesystem but, I end up with the same DXA Error Page as I did without the Filter that states:

"The page you were looking for cannot be found. This page may have been moved. We apologize for any inconvenience. "

I have 2 folders in the Static Website that contain htm and html files and I need to be able to have these files served as is. What can I do to enable this to happen?

2 Answers 2


SDL DXA, out of the box, has a PageController with the following Request Mapping

@RequestMapping(value = "/**", produces = {MediaType.TEXT_HTML_VALUE, MediaType.ALL_VALUE})

This is handling ALL request, regardless of extension

This could be updated to look like

@RequestMapping(value = { "/**/*.jsp", "/**/*.html", "/**/*.txt", "/**/*.xml" }, method = { GET })

However, you will also need to modify your web.xml, which tells Spring MVC which urls to dispatch to the dispatcher (usually further defined in dispatcher-servlet.xml), for example mine reads as below. It is telling Spring MVC to handle all of these requests


I also have, as I want to ignore some JSPs, this to tell String MVC NOT to handle JSPs in /WEB-INF/views/


I think in your situation just removing <url-pattern>*.html</url-pattern> would be enough to allow all HTML files to "pass through" and be resolved from the file-system.

Update following @Troy's comment

To exclude 2 folders of HTML files I'd try the following

Create web.xml file in your project - mine looks like this https://gist.github.com/chrismrgn/fdc1ec017664aeca0ef1ab70f72cc895

Then replace:




Hope that helps?

  • thanks for your input. Pages that are published from CM are by default .html pages so this poses a problem globally. I need to exclude 2 folders from being handled by the PageController or the Dispatcher. I tried configuring the Interceptors to exclude given paths but that did not work. I do not have a web.xml currently defined beyond having my filter (did not accomplish my goal)and there is only one xml file for the webapp (spring-context.xml). Oct 27, 2016 at 14:56
  • Updated my answer Oct 27, 2016 at 20:07
  • Thanks Chris. I will play around with things this way. For right now I have added some new validations in com.sdl.webapp.common.impl.localization.LocalizationImpl Oct 27, 2016 at 20:20
  • These validations check for a set of configuration parameters I added in the Site Configuration component. If it matches any of the values from there it returns true for isStaticContent Oct 27, 2016 at 20:38

I have seen a similar implementation in .NET using HTTPModules (extending System.Web.IHttpModule). We just load this before DXA StaticContent Module (Sdl.Web.Mvc.Statics.StaticContentModule - in DXA 1.2 we could not extend this) so we fall back to the broker if the request cannot be served by an item in the filesystem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.