Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
ofbiz-directcontrolservlet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
4d463c3b
authored
2016-08-25 15:56:12 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Make a method that can be used in multiple places for setting the
no-cache headers. Refs: #7593
1 parent
a72036e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
src/com/brainfood/ofbiz/DirectControlServlet.java
src/com/brainfood/ofbiz/DirectControlServlet.java
View file @
4d463c3
...
...
@@ -265,6 +265,20 @@ public class DirectControlServlet extends HttpServlet {
return
file
;
}
protected
void
setResponseNoCache
()
{
// Set to expire far in the past.
response
.
setHeader
(
"Expires"
,
"Sat, 6 May 1995 12:00:00 GMT"
);
// Set standard HTTP/1.1 no-cache headers.
response
.
setHeader
(
"Cache-Control"
,
"no-store, no-cache, must-revalidate"
);
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
response
.
addHeader
(
"Cache-Control"
,
"post-check=0, pre-check=0"
);
// Set standard HTTP/1.0 no-cache header.
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
}
protected
void
processRequest
()
throws
Exception
{
Map
<
String
,
Object
>
context
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -426,17 +440,7 @@ public class DirectControlServlet extends HttpServlet {
}
response
.
setStatus
(
statusCode
);
// Set to expire far in the past.
response
.
setHeader
(
"Expires"
,
"Sat, 6 May 1995 12:00:00 GMT"
);
// Set standard HTTP/1.1 no-cache headers.
response
.
setHeader
(
"Cache-Control"
,
"no-store, no-cache, must-revalidate"
);
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
response
.
addHeader
(
"Cache-Control"
,
"post-check=0, pre-check=0"
);
// Set standard HTTP/1.0 no-cache header.
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
setResponseNoCache
();
if
(
"JSON"
.
equals
(
outputHandler
))
{
response
.
setContentType
(
"application/x-json"
);
...
...
Please
register
or
sign in
to post a comment