-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: bridge-ext-2.0.0, bridge-ext-3.0.0, bridge-ext-5.0.0
-
Fix Version/s: bridge-ext-2.0.1, bridge-ext-3.0.1, bridge-ext-5.0.1
-
Component/s: Liferay Faces Bridge Ext
-
Labels:None
{markdown}
This task involves removing `PageContextStringImpl` from `HeadResponseWriterLiferayImpl` and using [JspFactory.getPageContext()](https://tomcat.apache.org/tomcat-4.0-doc/servletapi/javax/servlet/jsp/JspFactory.html#getPageContext(javax.servlet.Servlet,%20javax.servlet.ServletRequest,%20javax.servlet.ServletResponse,%20java.lang.String,%20boolean,%20int,%20boolean)) to create the [PageContext](http://docs.oracle.com/javaee/6/api/javax/servlet/jsp/PageContext.html) object instead. Since `HeadResponseWriterLiferayImpl` does not actually take advantage of `PageContextStringImpl` main feature of writing a tag to a string, it is not necessary to use `PageContextStringImpl`. Instead a simple `PageContext` returned from `JspFactory.getPageContext()` should be used. This will greatly reduce the amount of code needed to add elements to the head section.
This change should be tested in all app servers on 6.2 and 7.0.
Here is an example of what `HeadResponseWriterLiferayImpl` might look like after this change: https://github.com/stiemannkj1/liferay-faces-bridge-ext/blob/5175ee0c162d68a8ca6205073ea1208a1ed1afc4/src/main/java/com/liferay/faces/bridge/ext/context/internal/HeadResponseWriterLiferayImpl.java
*Note:* [JSPSupportServlet](https://github.com/liferay/liferay-portal/blob/50888548989ba65c75f7cb7c9c90fa1957cd2117/portal-kernel/src/com/liferay/portal/kernel/servlet/JSPSupportServlet.java) does not exist in Liferay 6.2 so it must be copied into Bridge Ext for Liferay 6.2 branches.{markdown}
This task involves removing `PageContextStringImpl` from `HeadResponseWriterLiferayImpl` and using [JspFactory.getPageContext()](https://tomcat.apache.org/tomcat-4.0-doc/servletapi/javax/servlet/jsp/JspFactory.html#getPageContext(javax.servlet.Servlet,%20javax.servlet.ServletRequest,%20javax.servlet.ServletResponse,%20java.lang.String,%20boolean,%20int,%20boolean)) to create the [PageContext](http://docs.oracle.com/javaee/6/api/javax/servlet/jsp/PageContext.html) object instead. Since `HeadResponseWriterLiferayImpl` does not actually take advantage of `PageContextStringImpl` main feature of writing a tag to a string, it is not necessary to use `PageContextStringImpl`. Instead a simple `PageContext` returned from `JspFactory.getPageContext()` should be used. This will greatly reduce the amount of code needed to add elements to the head section.
This change should be tested in all app servers on 6.2 and 7.0.
Here is an example of what `HeadResponseWriterLiferayImpl` might look like after this change: https://github.com/stiemannkj1/liferay-faces-bridge-ext/blob/5175ee0c162d68a8ca6205073ea1208a1ed1afc4/src/main/java/com/liferay/faces/bridge/ext/context/internal/HeadResponseWriterLiferayImpl.java
*Note:* [JSPSupportServlet](https://github.com/liferay/liferay-portal/blob/50888548989ba65c75f7cb7c9c90fa1957cd2117/portal-kernel/src/com/liferay/portal/kernel/servlet/JSPSupportServlet.java) does not exist in Liferay 6.2 so it must be copied into Bridge Ext for Liferay 6.2 branches.{markdown}