首页 新闻 会员 周边 捐助

在网上找了上传下载,可是下载页面进不去呀

0
悬赏园豆:30 [已关闭问题] 关闭于 2015-07-15 11:24

web.xml配置

<welcome-file-list>
    <welcome-file>upload.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>UploadHandleServlet</servlet-name>
    <servlet-class>me.gacl.web.controller.UploadHandleServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>UploadHandleServlet</servlet-name>
    <url-pattern>/servlet/UploadHandleServlet</url-pattern>
</servlet-mapping>
<servlet>
     <servlet-name>ListFileServlet</servlet-name>
     <servlet-class>me.gacl.web.controller.ListFileServlet</servlet-class>
</servlet>
 
<servlet-mapping>
     <servlet-name>ListFileServlet</servlet-name>
    <url-pattern>/servlet/ListFileServlet</url-pattern>
</servlet-mapping>
<servlet>
      <servlet-name>DownLoadServlet</servlet-name>
      <servlet-class>me.gacl.web.controller.DownLoadServlet</servlet-class>
</servlet>
 
<servlet-mapping>
      <servlet-name>DownLoadServlet</servlet-name>
      <url-pattern>/servlet/DownLoadServlet</url-pattern>
</servlet-mapping>

 

报错

 

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:410)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
	org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:311)
	org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
	org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
	org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
	org.apache.jasper.compiler.Parser.parse(Parser.java:138)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.

下载页面

<body>
      <!-- 遍历Map集合 -->
    <c:forEach var="me" items="${fileNameMap}">
        <c:url value="/servlet/DownLoadServlet" var="downurl">
            <c:param name="filename" value="${me.key}"></c:param>
        </c:url>
        ${me.value}<a href="${downurl}">下载</a>
        <br/>
    </c:forEach>
  </body>

雪夜舞者J的主页 雪夜舞者J | 初学一级 | 园豆:45
提问于:2015-07-13 10:17
< >
分享
所有回答(3)
0

http://blog.csdn.net/terry_f/article/details/3305404    

Vip灬cnblog | 园豆:133 (初学一级) | 2015-07-13 20:49
0

哥们这是地球,火星上的问题应该找火星人去解决啊。

童同 | 园豆:258 (菜鸟二级) | 2015-07-15 11:20

哼!坏人,我已经解决了

支持(0) 反对(0) 雪夜舞者J | 园豆:45 (初学一级) | 2015-07-15 11:21
0

通过配置不同的后缀,

比如 struts的请求路径你配置 .action  .jsp

servlet的路径可以不配置后缀


<filter>
  <filter-name>struts2</filter-name>  
    <filterclass>
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
</filter>

 <filter-mapping>
       <filter-name>struts2</filter-name>
       <url-pattern>*.do</url-pattern>
       <url-pattern>*.action</url-pattern>
       <url-pattern>*.jsp</url-pattern>
 </filter-mapping>

<servlet>
   <description></description>

   <display-name>AjaxServerServlet</display-name>

   <servlet-name>AjaxServerServlet</servlet-name>

   <servlet-class>com.test.servlet.AjaxServerServlet</servlet-class>
</servlet>

 <servlet-mapping>
      <servlet-name>AjaxServerServlet</servlet-name>
        
    <url-pattern>/AjaxServerServlet</url-pattern>
 </servlet-mapping>


你可以根据你的需要更改后缀

如果还不行请加servlet配置 <url-pattern>/AjaxServerServlet.htm</url-pattern>

雪夜舞者J | 园豆:45 (初学一级) | 2015-07-15 11:23
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册