目的框架是struts2,现在想request.getInputStream()读取xml形式的流,结果就如下的错误。这要怎么解决啊,各位帮忙看看
ognl.ExpressionSyntaxException: Malformed OGNL expression: <?xml version [ognl.ParseException: Encountered " <" at line 1, column 1.
Was expecting one of:
":" ...
"not" ...
"+" ...
"-" ...
"~" ...
"!" ...
"(" ...
"true" ...
"false" ...
"null" ...
"#this" ...
"#root" ...
"#" ...
"[" ...
"{" ...
"@" ...
"new" ...
<IDENT> ...
<DYNAMIC_SUBSCRIPT> ...
"/'" ...
"`" ...
"/"" ...
<INT_LITERAL> ...
<FLT_LITERAL> ...
]
at ognl.Ognl.parseExpression(Ognl.java:116
发生这个错误以后很是让我不解,总感觉应该是变量或者数值问题,开始代码为:
Map<String, String> msgMap = new HashMap<String, String>();
msgMap.put("message.1", "12345677899000");
msgMap.put("message.2", "12345677899001");
msgMap.put("message.3", "12345677899002");
msgMap.put("message.4", "x12345677899003");
修改成如下形式就没有问题了:
Map<String, String> msgMap = new HashMap<String, String>();
msgMap.put("message.x1", "12345677899000");
msgMap.put("message.x2", "12345677899001");
msgMap.put("message.x3", "12345677899002");
msgMap.put("message.x4", "x12345677899003");
msgMap.put("message.x5", "x12345677899004");
msgMap.put("message.x6", "x12345677899005");
msgMap.put("message.x7", "x12345677899006");
应该是Ognl对接收信息解析的缘故,所以下一步应该好好研究一下Ognl