且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将多部分表单数据从jsp发送到Web服务?

更新时间:2023-11-27 14:52:34

在形式的行动标签中只需提供网址的网址服务。内容类型由表单上的 enctype 属性决定

In action tag of form just give url of the web service . The content-type is determined by enctype attribute on form

如果您的表单包含文件输入元素,则形成操作标签应该是这样的

If your form contains file input element then form opeaning tag should be like this

<form method="POST" action="<your web service address>" enctype="multipart/form-data" >

如果它只包含文本和其他输入,文件除 enctype

If it contains only text and other inputs except file than enctype will be

application/x-www-form-urlencoded

表格更多信息参考

java ee文件上传示例