java有参和无参的区别 java web项目中图片上传浏览的路径?

java web项目中图片上传浏览的路径?字符串文件名=(字符串)请求.getAttribute(“fileBrowser”)如果(fileName!=空值(&A)文件名.trim().length(

java web项目中图片上传浏览的路径?

字符串文件名=(字符串)请求.getAttribute(“fileBrowser”)

如果(fileName!=空值(&A)文件名.trim().length()> 0){

File File=新文件(文件名)文件.getPath()]}

在servlet或actoin中。

过去传递的页面只是一个字符串,需要单独处理。

另一种方法是使用Ajax提交。

-----<form name=“form1”action=“/LVMH/management/refresh Data Chinese”><input type=“file”name=“fileBrowser”size=“50”onchange=“readFile(this)”/><input type=“submit”id=“box BTN”> update</input></form>