0

It's originally a JSP form page, do post under same domain:

<form action="/dataHandler" method="post" enctype="multipart/form-data">

after the data post finished browser will get a 303 see other code. do the redirection to a different domain.

Now I need to use JavaScript to do the post. It's been posted successfully but in the redirection, it get a 500 Server Error.

Compare to the Original get. It seems missing the Cookie, Cache-Control, Content-Encoding, Content-Type, X-FRAME-OPTIONS fields and have a additional origin, Set-Cookie fields.

But i found out JS can't touch the redirection on this page, so how should I deal with the Error?

Community
  • 1
  • 1
Nero_X
  • 23
  • 1
  • 5
  • do I described uncleanly? – Nero_X Aug 08 '14 at 04:04
  • `500` is an internal server error. You need to debug this on the server. What error messages get output to the server logs? If they aren't useful, then edit the server side code to include more debugging statements. – Quentin Aug 21 '14 at 09:30
  • Thanks for reply. That 500 is caused by missing cookies. And I can't touch both that external server. and the redirection process. So I'm writing a post for a work around. – Nero_X Aug 21 '14 at 10:09

1 Answers1

0

a related topic: React to 303 status code in jquery

It seems that JavaScript can't touch redirection. The 500 error is caused by those missing cookies. And I can't touch both that external server sending error and the redirection process. I have to re-config the server being posted to send back 200 code with an embedded redirection URL in the head. Then it's just simple JavaScript redirection.

Community
  • 1
  • 1
Nero_X
  • 23
  • 1
  • 5