前台jsp:
<form action="AA.do?method=yktAdd" method="post" >
<input type='text' name='textfield' id='textfield' class='txt' />
<input type='button' class='btn' value='浏览...' />
<input type="file" name="excel" class="file" id="fileField" size="28" onchange="document.getElementById('textfield').value=this.value" />
<input type="submit" name="submit" class="btn" value="添加" />
</form>
后台:
public ActionForward yktAdd(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
String path=request.getParameter("excel");
System.out.println(path);
return mapping.findForward("yktadd");
}
程序得到的结果:XXX.xls
我想获取的结果是:D:\XXX.xls 这种全路径
只需要一个路径就行了,但是查了好多资料,都不成功,求大神解救!!!!!
慕的地3093295
沧海一幻觉
相关分类