ognl.ExpressionSyntaxException: Malformed OGNL expression:

目的框架是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

用的是httpclient发送xml格式的post请求的。
后来加了一句post.setRequestHeader("Content-type", "text/xml; charset=UTF-8");问题就解决了。

你可能感兴趣的:(xml,框架,struts,null)