Mes Activités

juin 12
Zsolt Szabó a mis à jour LPS-62373.
10:15
juin 9
Zsolt Szabó a mis à jour LPS-73017.
08:14
juin 2
Zsolt Szabó a mis à jour LPS-72129.
Zsolt Szabó a mis à jour LPS-72129.
Zsolt Szabó a commenté sur LPS-72129.
05:49 I worked a lot on this issue and tried to figure out what caused this and how I could fix it completely but I couldn't. I have found what is happening in the DynamicCSSFilter and why the correct MIME type is not set correctly on the css resource responses. I'm going to write a detailed description about my results and escalate this issue to the engineering. *What is the issue?* After you made the mentioned modifications and open the browser related developer tool(Firefox/IE) you will find that some of css resources' content type is plain. Probably, if you have a default page without any other content you won't see any mistakes on it. But, after you logged in you will see that the control-menu is broken. This happens because the Firefox doesn't apply the needed control-menu styles. Please go back to the developer toolbar's Network tab and check all of the css requests you will see that almost of them are with the bad content type. Two theme related resources are excepted, they are with the correct css MIME type. *What is the root cause?* In my opinion the root cause is that in the DynamicCSSFilter's getDynamicContent method we always call the: {code} String requestPath = getRequestPath(request); {code} in the getRequestPath method we cut the context name from the beginning of the requestPath {code} String requestPath = request.getRequestURI(); String contextPath = request.getContextPath(); if (!contextPath.equals(StringPool.SLASH)) { requestPath = requestPath.substring(contextPath.length()); } return requestPath; {code} the result of this behavior that we never find any ServletContext instances, the resourceURL variable will be always null and the method will return with null {code} if (resourceURL == null) { return null; } {code} about this early returning this method can not set the correct MIME type: {code} response.setContentType(ContentTypes.TEXT_CSS); {code} *What was my solution?* My idea was that we need to use the original requestPath for finding the related SevletContext instance. Thus I duplicated some code blocks and used them with the originalRequestPath value {code} String originalRequestPath = request.getRequestURI(); ... if (resourceURL == null) { resourceServletContext = PortletResourcesUtil.getPathServletContext(originalRequestPath ); if (resourceServletContext != null) { resourceURL = PortletResourcesUtil.getResource( resourceServletContext, originalRequestPath); } } if (resourceURL == null) { resourceServletContext = DynamicResourceIncludeUtil.getPathServletContext( originalRequestPath ); if (resourceServletContext != null) { resourceURL = DynamicResourceIncludeUtil.getResource( resourceServletContext, originalRequestPath ); } } {code} This code change just worked in case of PortletResourcesUtil.getPathServletContext(originalRequestPath) and not in case of DynamicResourceIncludeUtil.getPathServletContext(originalRequestPath). The result of it is that DynamicResourceIncludeUtil will return with an ApplicationContextFacade instance instead of ServletContextASMWrapper and this ApplicationContextFacade instance doesn't contain correct resource data. Because this issue became too complicated I decided I escalate it.
Zsolt Szabó a mis à jour LPS-72129.
juin 1
Zsolt Szabó a mis à jour LPS-72129.
01:34
Zsolt Szabó a mis à jour LPS-69113.
01:34
mai 31
Zsolt Szabó a commenté sur LPS-72129.
mai 25
Zsolt Szabó a mis à jour LPS-72761.
S'abonner aux activités de Zsolt Szabó. (Ouvre la nouvelle fenêtre)