I’m currently writing an extension (with a confluence http filter module) for redirecting mobile users to another mobile site - for example, mobile users should simply get a response like
<html>...<script src='...'></script></html>, nothing else. My current problem is, that my custom response is mixed somehow with the normal website… the script tag is inside the body tag of the normal page.
After detecting the mobile device in the doFilter-Method I do the following:
response.setStatus(HttpServletResponse.SC_OK); httpServletResponse.getWriter().write("" + "<html>" + "<head>" + "</head>" + "<body>" + "<app></app>" + "<script src='" + "https://example.com/some.js" + "'></script>"+ "</body>"+ "</html>"); httpServletResponse.getWriter().flush(); httpServletResponse.getWriter().close();
The script-tag is included within the normal website, how can I load only my few custom lines when someone is using a mobile phone?
Thanks - btw, the build-in Confluence Mobile Theme is disabled.
Also - the
chain.doFilter(request,response);-Method is never called on mobile devices.