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
8dffc69e
authored
2014-09-23 14:49:33 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Issue #4170: Refactor use of pathInfo/contentType/getPathInfo()/getContentType().
1 parent
ba0e1190
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
src/com/brainfood/ofbiz/DirectControlServlet.java
src/com/brainfood/ofbiz/DirectControlServlet.java
View file @
8dffc69
...
...
@@ -97,11 +97,12 @@ public class DirectControlServlet extends HttpServlet {
}
public
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
String
pathInfo
=
request
.
getPathInfo
();
String
contentType
=
request
.
getContentType
();
try
{
Debug
.
logInfo
(
"getPathInfo: "
+
request
.
getPathInfo
()
+
" request.getContentType: "
+
request
.
getContentType
()
,
module
);
Debug
.
logInfo
(
"getPathInfo: "
+
pathInfo
+
" request.getContentType: "
+
contentType
,
module
);
String
pathInfo
=
request
.
getPathInfo
();
if
(
pathInfo
==
null
||
pathInfo
.
length
()
==
0
)
{
return
;
}
...
...
@@ -109,7 +110,6 @@ public class DirectControlServlet extends HttpServlet {
// Determine type of request and load the context from JSON content or
// parameter values accordingly
String
contentType
=
request
.
getContentType
();
// Determine the request method for service lookup and parameter filters
String
method
=
""
;
...
...
@@ -129,8 +129,8 @@ public class DirectControlServlet extends HttpServlet {
}
}
else
{
// Check if the request is a backbone style "emulateJSON" request
if
(
request
.
getContentType
()
!=
null
&&
request
.
getContentType
()
.
indexOf
(
"x-www-form-urlencoded"
)
!=
-
1
&&
if
(
contentType
!=
null
&&
contentType
.
indexOf
(
"x-www-form-urlencoded"
)
!=
-
1
&&
request
.
getParameter
(
"model"
)
!=
null
)
{
Debug
.
logInfo
(
"MODEL: "
+
request
.
getParameter
(
"model"
),
module
);
JSON
json
=
new
JSON
(
new
StringReader
(
request
.
getParameter
(
"model"
)));
...
...
Please
register
or
sign in
to post a comment