http://localhost:8080/WebReport/ReportServer?op=fs_remote_design&cmd=design_list_file&file_path=..¤tUserName=admin¤tUserId=1&isWebReport=true
1.2通过PostmanPostman下载地址:https://www.getpostman.com/downloads/
就可以任意查看服务器目录
2.处理 2.1写个过滤器
如果不想写这有现成的,但是要1个币(审核过就可以下载了):
https://download.csdn.net/download/qq_34078582/12060939
目录结构:
jdk早前版本不支持switch case 里用String。所以这用了if
package com.fr.web;import javax.servlet.*;import java.io.IOException;import java.util.Enumeration;public class FRFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { boolean goAhead = true; Enumeration enumeration = req.getParameterNames(); while (enumeration.hasMoreElements()) { String paramName = enumeration.nextElement().toString(); String param = req.getParameter(paramName); if ("fs_remote_design".equals(param) || "design_list_file".equals(param)) { goAhead = false; } if ("cmd".equals(paramName) || "file_path".equals(paramName)) { goAhead = false; } if (!goAhead) { break; } } if (goAhead) { chain.doFilter(req, res); } } @Override public void destroy() { }}打包:
这些包去掉。否则tomcat启动报错
build jar包
把这个复制出来
放到服务目录里:
..... omcatwebappsWebReportWEB-INFlib
然后修改一下WebReport的web.xml
把filter的内容加进去
...... ReportServer com.fr.web.ReportServlet 0 ReportServer /ReportServer FRFilter com.fr.web.FRFilter FRFilter /* .........修复后响应
过滤后,目前没发现影响正常的报表打印,如果影响,可以把过滤参数的内容进行调整。