Commit 3b72d830 authored by aaron's avatar aaron

Updated so that the PluginServlet will handle requests for .css and .js files, see JM-714.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3980 b35dd754-fafc-0310-a699-88a17e54d16e
parent d9487948
...@@ -47,8 +47,10 @@ import javax.servlet.http.HttpServletResponse; ...@@ -47,8 +47,10 @@ import javax.servlet.http.HttpServletResponse;
* added to the normal Wildfire admin console web app directory.<p> * added to the normal Wildfire admin console web app directory.<p>
* <p/> * <p/>
* The servlet listens for requests in the form <tt>/plugins/[pluginName]/[JSP File]</tt> * The servlet listens for requests in the form <tt>/plugins/[pluginName]/[JSP File]</tt>
* (e.g. <tt>/plugins/foo/example.jsp</tt>). It also listens for image requests in the * (e.g. <tt>/plugins/foo/example.jsp</tt>). It also listens for non JSP requests in the
* the form <tt>/plugins/[pluginName]/images/*.png|gif</tt> (e.g. * form like <tt>/plugins/[pluginName]/images/*.png|gif</tt>,
* <tt>/plugins/[pluginName]/scripts/*.js|css</tt> or
* <tt>/plugins/[pluginName]/styles/*.css</tt> (e.g.
* <tt>/plugins/foo/images/example.gif</tt>).<p> * <tt>/plugins/foo/images/example.gif</tt>).<p>
* <p/> * <p/>
* JSP files must be compiled and available via the plugin's class loader. The mapping * JSP files must be compiled and available via the plugin's class loader. The mapping
...@@ -327,9 +329,17 @@ public class PluginServlet extends HttpServlet { ...@@ -327,9 +329,17 @@ public class PluginServlet extends HttpServlet {
else if (pathInfo.endsWith(".swf")) { else if (pathInfo.endsWith(".swf")) {
contentType = "application/x-shockwave-flash"; contentType = "application/x-shockwave-flash";
} }
response.setHeader("Content-disposition", "filename=\"" + file + "\";"); else if (pathInfo.endsWith(".css")) {
contentType = "text/css";
}
else if (pathInfo.endsWith(".js")) {
contentType = "text/javascript";
}
// setting the content-disposition header breaks IE when downloading CSS
// response.setHeader("Content-disposition", "filename=\"" + file + "\";");
response.setContentType(contentType); response.setContentType(contentType);
// Write out the image to the user. // Write out the resource to the user.
InputStream in = null; InputStream in = null;
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment