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
e2475825
authored
2016-12-09 10:39:21 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'BF-8039' of /home/git/repositories/brainfood/ofbiz-directcontrolservlet
2 parents
249f5ebb
80ba65d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
src/com/brainfood/ofbiz/DirectControlServlet.java
src/com/brainfood/ofbiz/DirectControlServlet.java
View file @
e247582
...
...
@@ -453,10 +453,34 @@ public class DirectControlServlet extends HttpServlet {
context
.
put
(
"httpProtocol"
,
request
.
getProtocol
());
context
.
put
(
"httpScheme"
,
request
.
getScheme
());
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
Map
<
String
,
List
<
String
>>
headerMap
=
new
HashMap
<
String
,
List
<
String
>>();
while
(
headerNames
.
hasMoreElements
())
{
String
headerName
=
headerNames
.
nextElement
();
headerMap
.
put
(
headerName
,
Collections
.
list
(
request
.
getHeaders
(
headerName
)));
}
context
.
put
(
"httpHeaders"
,
headerMap
);
context
=
model
.
makeValid
(
context
,
ModelService
.
IN_PARAM
,
true
,
errorMessages
,
timeZone
,
locale
);
Map
<
String
,
Object
>
result
=
dispatcher
.
runSync
(
serviceName
,
context
);
if
(
result
.
get
(
"httpHeaders"
)
!=
null
)
{
Map
<
String
,
List
<
String
>>
headers
=
(
Map
<
String
,
List
<
String
>>)
result
.
get
(
"httpHeaders"
);
for
(
Map
.
Entry
<
String
,
List
<
String
>>
header
:
headers
.
entrySet
())
{
for
(
String
value
:
header
.
getValue
())
{
response
.
addHeader
(
header
.
getKey
(),
value
);
}
}
}
if
(
result
.
get
(
"httpCookies"
)
!=
null
)
{
List
<
Cookie
>
cookies
=
(
List
<
Cookie
>)
result
.
get
(
"httpCookies"
);
for
(
Cookie
cookie
:
cookies
)
{
response
.
addCookie
(
cookie
);
}
}
result
.
remove
(
"responseMessage"
);
Integer
httpStatusCode
=
(
Integer
)
result
.
remove
(
"httpStatusCode"
);
int
statusCode
=
httpStatusCode
==
null
?
200
:
httpStatusCode
.
intValue
();
...
...
Please
register
or
sign in
to post a comment