写文件下载的时候代码写到这儿:
public class ExcelServelt extends HttpServlet{ @Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// 服务器相对路径
String path=req.getParameter("xxxx");
// 服务器绝对路径
path=getServletContext().getRealPath("/")+path;相对路径那儿getParameter()里面应该写什么?请求的url吗?如果是具体是指什么??如果不是也请指出来
public class ExcelServelt extends HttpServlet{ @Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// 服务器相对路径
String path=req.getParameter("xxxx");
// 服务器绝对路径
path=getServletContext().getRealPath("/")+path;相对路径那儿getParameter()里面应该写什么?请求的url吗?如果是具体是指什么??如果不是也请指出来
解决方案 »
- 走投无路,四面楚歌的情况下,想到了CSDN想到了这里的好人都进来吧(分全部送掉,不多,但是心意!!)!!
- 一个sql子查询 分组问题!
- form.submit()为何无效!?
- 求助大家了
- 怎样把一个list集合赋值给一个下拉列表框
- spring+hibernate连接数据库问题
- import 问题
- javamail=jmail吗?大家都来帮我呀!
- 看了几天的 struts 一般的简单代码能看明白了,但是还有个关键的问题没有搞清楚,谁来指点下我
- 用axis写webservice,但是soap中没有header,怎么添加呢????
- jsp下载文件,中文文件名乱码,IE可以火狐不可以。。。。。。
- struts2表单内的排版问题
../上一级的意思 ../../?.jsp
如:
http://localhost:8080/test.do?action=abc
要取action的值的话那就可以用req.getParameter(“action”)了
可能是<hidden name="xxx" value=""/>
也可能是action.do?xxx=value 你把xxx替换了就是你要的名字了