PDA

View Full Version : form url problem, please help



baobahh
20 Oct 2007, 7:24 AM
fs.submit({
url:'login/loginAction.do?method=login2'
})

in firefox , the url is right. but in ie6, it is error
error:Syntax error





fs.submit({
url:'loginAction.do?method=login2'
})
if i change my struts action,
<action path="/loginAction" parameter="method">
it is ok. ext will run success:function(){...}




fs.submit({
url:'/login/loginAction.do?method=login2'
})

if i use this, after submit , ext will run failure:function(){...}




in my action,
...
PrintWriter out= response.getWriter();
out.write("true");
...




<action path="/login/loginAction" parameter="method"> ...

i use struts


i want to use this kind : /login/loginAction.do

Animal
20 Oct 2007, 7:36 AM
I suspect that more is being sent in the response than just "true".

Look at the response in Firebug. What does it look like?

baobahh
20 Oct 2007, 8:31 AM
1. url:'/login/loginAction.do?method=loginy'
2. url:'login/loginAction.do?method=loginy'


i want to know what kind of url i should use??
if i use 1, the response is 404
if i use 2, in ie6, when i submit, it doesn't work, error: Syntax error

i think 2 is right ,why in firefox is right, but ie6 is not
Thank you

Animal
20 Oct 2007, 9:38 AM
I don't think using a different string will cause a syntax error. There's something else at work here.

We can't tell you what the correct URL is, that's your application!

Don't you know how to read URLs?

A URL beginning with a slash is resolved to a url at the root of the domain of the current document, so if you are at http://example.com/foo/bar/bletch/page.jsp, and you request /login/loginAction.do, the request will be sent to http://example.com/login/loginAction.do.

If it does not begin with a slash, the browser resolves it relative to the current document wherever that may be, so if you are at http://example.com/foo/bar/bletch/page.jsp, and you request login/loginAction.do, the request will be sent to http://example.com/foo/bar/bletch/login/loginAction.do.

baobahh
20 Oct 2007, 5:42 PM
Thank you for your help