五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

springframework6(MVC)設(shè)置文件上傳

2023-08-13 21:57 作者:herostears  | 我要投稿

spring6已經(jīng)不集成commonsupload,所以配置時(shí)使用StandardServletMultipartResolver


web.xml

<multipart-config>

<max-file-size>20848820</max-file-size>

<max-request-size>418018841</max-request-size>

<file-size-threshold>1048576</file-size-threshold>

</multipart-config>


spring配置文件

<bean id="multipartResolver" class="org.springframework.web.multipart.support.StandardServletMultipartResolver"></bean>


示例代碼:

@RequestMapping(value="/upload",method=RequestMethod.POST)

public String upload(@RequestParam MultipartFile file) {

if (!file.isEmpty())

{

System.out.println(file.getOriginalFilename());

}

return "hello";

}


HTML FORM:

<form action="/cmspring/hello/upload" method="post" enctype="multipart/form-data">

? <fieldset>

? ? <legend>Registration example</legend>

? ? <p>

? ? ? <input type="file" name="file" />

? ? </p>

? ? <p>

? ? ? <input type="submit" />

? ? </p>

? </fieldset>

</form>


springframework6(MVC)設(shè)置文件上傳的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
景洪市| 信宜市| 潮安县| 武夷山市| 上犹县| 广饶县| 彝良县| 固镇县| 方山县| 炎陵县| 利辛县| 留坝县| 沙洋县| 余江县| 绥滨县| 长子县| 交城县| 新乐市| 瑞安市| 且末县| 宁夏| 通许县| 高州市| 峡江县| 新干县| 迁安市| 江源县| 汉川市| 常熟市| 甘孜县| 左云县| 简阳市| 五莲县| 绥棱县| 玛纳斯县| 阿巴嘎旗| 光山县| 法库县| 游戏| 泗水县| 呼图壁县|