开发者

How to send xml data in request in JSP?

开发者 https://www.devze.com 2023-03-21 18:17 出处:网络
I need 开发者_开发问答to send my request as a xml to servlet from jsp. how can i do that?Two ways (in case by \'jsp\' you mean \'from the browser\'):

I need 开发者_开发问答to send my request as a xml to servlet from jsp. how can i do that?


Two ways (in case by 'jsp' you mean 'from the browser'):

  • with form submit - with a <form method="post" action="..">. You will have to prepare the XML (with javascript for example) and set it in a field a request parameter, then parse the request parameter on the servlet
  • with ajax - using XMLHttpRequest or a framework like jQuery. With it you can submit anything.
0

精彩评论

暂无评论...
验证码 换一张
取 消