Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
679dbc65
Commit
679dbc65
authored
May 30, 2019
by
gechengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log print
parent
e5aaeba2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
pom.xml
pom.xml
+2
-2
AbstractCommonController.java
...resentation/noui/controller/AbstractCommonController.java
+12
-9
No files found.
pom.xml
View file @
679dbc65
...
...
@@ -2,8 +2,8 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
cn.com.brilliance
</groupId>
<artifactId>
business
</artifactId>
<packaging>
w
ar
</packaging>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
j
ar
</packaging>
<version>
1.0.0
</version>
<name>
business
</name>
<properties>
...
...
src/main/java/org/sss/presentation/noui/controller/AbstractCommonController.java
View file @
679dbc65
...
...
@@ -9,6 +9,9 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
log.Log
;
import
log.LogFactory
;
import
org.apache.commons.fileupload.FileItem
;
import
org.apache.commons.fileupload.disk.DiskFileItemFactory
;
import
org.apache.commons.fileupload.servlet.ServletFileUpload
;
...
...
@@ -36,9 +39,6 @@ import org.sss.presentation.noui.util.StringUtil;
import
com.google.gson.Gson
;
import
log.Log
;
import
log.LogFactory
;
public
class
AbstractCommonController
{
protected
static
final
Log
log
=
LogFactory
.
getLog
(
AbstractCommonController
.
class
);
protected
static
String
ON_CLICK
=
"ON_CLICK"
;
...
...
@@ -50,6 +50,7 @@ public class AbstractCommonController {
@SuppressWarnings
(
"unchecked"
)
public
Object
event
(
String
mappingUrl
,
String
eventType
,
Map
<
String
,
Object
>
dataMap
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
NoUiContext
context
=
null
;
Result
ret
=
null
;
boolean
isMultipart
=
false
;
...
...
@@ -62,21 +63,23 @@ public class AbstractCommonController {
// Parse the request
List
<
FileItem
>
items
=
upload
.
parseRequest
(
request
);
Iterator
<
FileItem
>
iter
=
items
.
iterator
();
while
(
iter
.
hasNext
())
{
FileItem
item
=
iter
.
next
();
// 普通表单域
if
(
item
.
isFormField
())
{
String
itemName
=
item
.
getFieldName
();
String
itemValue
=
item
.
getString
();
String
itemValue
=
item
.
getString
();
log
.
info
(
"文件表单 key:"
+
itemName
+
",Value:"
+
itemValue
);
// 给dataMap赋值
Map
<
String
,?>
itemMap
=
new
Gson
().
fromJson
(
itemValue
,
Map
.
class
);
Map
<
String
,
?>
itemMap
=
new
Gson
().
fromJson
(
itemValue
,
Map
.
class
);
dataMap
.
put
(
itemName
,
itemMap
);
}
else
{
// 文件域
lastFileItem
=
item
;
}
}
}
else
{
log
.
info
(
"普通表单key-Value:"
+
dataMap
);
}
NoUiRequest
noUiRequest
=
new
NoUiRequest
(
request
,
mappingUrl
,
dataMap
);
context
=
NoUiContextManager
.
createNoUiContext
(
noUiRequest
);
...
...
@@ -114,13 +117,13 @@ public class AbstractCommonController {
((
IDatafield
<?>)
currentDataField
).
invokeCheckRules
(
context
);
}
}
}
else
if
(
eventType
.
equals
(
ON_STREAM_UPLOAD
)
&&
lastFileItem
!=
null
)
{
}
else
if
(
eventType
.
equals
(
ON_STREAM_UPLOAD
)
&&
lastFileItem
!=
null
)
{
@SuppressWarnings
(
"rawtypes"
)
IDatafield
dataField
=
(
IDatafield
)
baseObject
(
context
,
noUiRequest
,
alias
);
IStream
stream
=
(
IStream
)
dataField
.
getValue
();
stream
.
setName
(
lastFileItem
.
getName
());
stream
.
setType
(
lastFileItem
.
getContentType
());
IOUtils
.
copy
(
lastFileItem
.
getInputStream
(),
stream
.
getOutputStream
(),
1024
);
IOUtils
.
copy
(
lastFileItem
.
getInputStream
(),
stream
.
getOutputStream
(),
1024
);
// dataField.setValue(stream);
dataField
.
invokeEventRules
(
context
,
EventType
.
ON_STREAM_UPLOAD
,
null
);
}
else
if
(
eventType
.
equals
(
ON_STREAM_DOWNLOAD
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment