0

I POST data and the URL shows Query String. Why?

Hi,

When I post a data using urlencoded-post method in the submssion tag, the data reaches my webserver correctly. However, the URL of the page shows a query string like this: http://mydemoapp.bpapps.com/mobile/login?....amp;.lang=en-in

I am using struts2 to read the data at the backend and therefore its generating :

WARNING: Error setting expression '.intl' with value '[Ljava.lang.String;@1f2f70a'
ognl.ExpressionSyntaxException: Malformed OGNL expression: .intl [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:112)
at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:214)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)

...
...
...

Can you tell me why the URL shows the query string?

Thanks

by
5 Replies
  • QUOTE (Ratnadeep @ Jun 20 2010, 02:11 AM) <{POST_SNAPBACK}>
    Hi,

    When I post a data using urlencoded-post method in the submssion tag, the data reaches my webserver correctly. However, the URL of the page shows a query string like this: http://mydemoapp.bpapps.com/mobile/login?....amp;.lang=en-in

    I am using struts2 to read the data at the backend and therefore its generating :

    WARNING: Error setting expression '.intl' with value '[Ljava.lang.String;@1f2f70a'
    ognl.ExpressionSyntaxException: Malformed OGNL expression: .intl [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:112)
    at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:214)
    at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)

    ...
    ...
    ...

    Can you tell me why the URL shows the query string?

    Thanks


    I finally could make my app work by using a servlet filter and modifying the .ts to ts ; .intl to intl and .lang to lang in the requestParamMap. Then struts works normally. Struts fails to parse anything starting with a dot (.) and that was the problem. But still, I would like to know why the POST request also creates a query string...wats going on inside? Please explain.
    0
  • QUOTE (Ratnadeep @ Jun 22 2010, 09:16 AM) <{POST_SNAPBACK}>
    I finally could make my app work by using a servlet filter and modifying the .ts to ts ; .intl to intl and .lang to lang in the requestParamMap. Then struts works normally. Struts fails to parse anything starting with a dot (.) and that was the problem. But still, I would like to know why the POST request also creates a query string...wats going on inside? Please explain.


    I need some more information before I can help. Your page returns a 404 now. Can you post the raw response you are getting?
    0
  • QUOTE (Jason @ Jun 22 2010, 10:05 AM) <{POST_SNAPBACK}>
    I need some more information before I can help. Your page returns a 404 now. Can you post the raw response you are getting?



    I think the framework Ratnadeep is using (OpenSymphony) cannot deal with unexpected key-value pairs in the queryString.
    As I can tell from the exception trace, it is trying to map/compile the values to some internal datastructure using OGNL (Object-Graph Navigation Language).

    So, my take on the question is why the Blueprint server adds these key-values pairs , even to a application specifc queryString, instead of only putting them in Http headers (http://developer.yahoo.com/mobile/blueprint/BP_HTTP_Headers.html)
    0
  • QUOTE (ernest.micklei @ Jun 22 2010, 10:59 AM) <{POST_SNAPBACK}>
    I think the framework Ratnadeep is using (OpenSymphony) cannot deal with unexpected key-value pairs in the queryString.
    As I can tell from the exception trace, it is trying to map/compile the values to some internal datastructure using OGNL (Object-Graph Navigation Language).

    So, my take on the question is why the Blueprint server adds these key-values pairs , even to a application specifc queryString, instead of only putting them in Http headers (http://developer.yahoo.com/mobile/blueprint/BP_HTTP_Headers.html)


    Values like .intl and .lang need to stay in the url string so they carry across separate widgets and so we keep the language and locale settings that the user has selected.
    0
  • QUOTE (Jason @ Jun 22 2010, 10:05 AM) <{POST_SNAPBACK}>
    I need some more information before I can help. Your page returns a 404 now. Can you post the raw response you are getting?


    hi Jason , I have only given a demo link here. Sorry would not like to revel the actual link before the app is ready. But the question is applicable for any app.
    0
This forum is locked.

Recent Posts

in Blueprint General Discussion