Skip to content
This repository has been archived by the owner on Oct 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1377 from jayasheelankumar/4.0.2.x
Browse files Browse the repository at this point in the history
* Added http headers to disable proxy caching
* Updated version
  • Loading branch information
yaminikb authored Oct 30, 2017
2 parents 649865e + de3f170 commit 7eeca87
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build-bundles
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# REMEMBER TO CHANGE THIS VERSION #!!!!!!

WOODSTOCK_VERSION="4.0.2.10"
WOODSTOCK_VERSION="4.0.2.11"

#====== remove existing copies=========
rm -rf webui-jsf-*
Expand Down
2 changes: 1 addition & 1 deletion master/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Version Information
MajorVersion=4
MinorVersion=0
MicroVersion=.2.10
MicroVersion=.2.11
Qualifier=
Version=${MajorVersion}.${MinorVersion}
FullVersion=${Version}${MicroVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
import com.sun.webui.jsf.util.JavaScriptUtilities;
import com.sun.webui.jsf.util.RenderingUtilities;
import com.sun.webui.jsf.util.ThemeUtilities;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import javax.servlet.http.HttpServletResponse;

/**
* <p>Renderer for a {@link Head} component.</p>
Expand All @@ -44,6 +48,9 @@ public class HeadRenderer extends AbstractRenderer {
*/
private static final String stringAttributes[] = {"profile"}; //NOI18N

private static final String DATE_ONE =
(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US)).format(new Date(1));

/**
* <p>Render the appropriate element start, depending on whether the
* <code>for</code> property is set or not.</p>
Expand Down Expand Up @@ -86,6 +93,14 @@ protected void renderAttributes(FacesContext context, UIComponent component,
// Meta tags
if (head.isMeta()) {
writer.write("\n"); //NOI18N

HttpServletResponse servletResponse = (HttpServletResponse) context.getCurrentInstance().getExternalContext().getResponse();
servletResponse.setHeader("Pragma", "no-cache");
servletResponse.setHeader("Cache-Control", "no-store");
servletResponse.setHeader("Cache-Control", "no-cache");
servletResponse.setHeader("Expires", DATE_ONE);
servletResponse.setHeader("X-Frame-Options", "SAMEORIGIN");

renderMetaTag("no-cache", "Pragma", writer, head);
renderMetaTag("no-cache", "Cache-Control", writer, head);
renderMetaTag("no-store", "Cache-Control", writer, head);
Expand Down

0 comments on commit 7eeca87

Please sign in to comment.