RESIN服务器怎么更改源代码才能让http://www.9kf.net/?id=80中的?号变其他符号?给200分 RESIN服务器怎么更改源代码才能让http://www.9kf.net/?id=80中的?号变其他符号?给200分http://community.csdn.net/Expert/TopicView1.asp?id=4994981希望高手能解决一下,就是把问号去掉,传参数照样取得到。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个太简单了。其实根本不用改什么RESIN.你可以使用过滤器SERVLET。监听类似:http://www.9kf.net/id/80然后自己分析URL,获取最终参数。这种方法有一个好处:1、跨应用服务器,比你单纯改服务器代码好;-----------------------------类似代码:package com.ASSys.filter;import javax.servlet.Filter;import javax.servlet.FilterConfig;import javax.servlet.ServletException;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;import javax.servlet.FilterChain;import java.io.IOException;import com.ASSys.ca.CADelegater;import javax.servlet.http.HttpServletRequest;/** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */public class FileFilter implements Filter { public void init(FilterConfig config) throws javax.servlet.ServletException { } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, javax.servlet.ServletException { HttpServletRequest hrequest = (HttpServletRequest) request; String uri = hrequest.getServletPath(); System.out.println(uri + "|" + uri.substring(uri.lastIndexOf("/") + 1)); //重定向到文件下载界面 if (uri.startsWith("/filedownload/")) { //按照UNID方式进行设置 hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?UNID=" + uri.substring(uri.lastIndexOf("/") + 1)). forward(request, response); }else if (uri.startsWith("/projectdownload/")) { //按照项目参数方式进行设置 int i=uri.lastIndexOf("/") ; String strTaskCode=uri.substring(i+1); String strProjectId=uri.substring(17,i); hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?Projectid=" +strProjectId+"&Taskid=" + strTaskCode). forward(request, response); } } public void destroy() { }}----------------WEB.XML的配置<filter> <filter-name>FileFilter</filter-name> <filter-class>com.ASSys.filter.FileFilter</filter-class> </filter> <filter-mapping> <filter-name>FileFilter</filter-name> <url-pattern>/filedownload/*</url-pattern> </filter-mapping>---------------------------实际情况http://host/filedownload/123123123就类似于http://host/filedownload?123123123 这个太简单了。其实根本不用改什么RESIN.你可以使用过滤器SERVLET。监听类似:http://www.9kf.net/id/80然后自己分析URL,获取最终参数。这种方法有一个好处:1、跨应用服务器,比你单纯改服务器代码好;-----------------------------类似代码:package com.ASSys.filter;import javax.servlet.Filter;import javax.servlet.FilterConfig;import javax.servlet.ServletException;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;import javax.servlet.FilterChain;import java.io.IOException;import com.ASSys.ca.CADelegater;import javax.servlet.http.HttpServletRequest;/** * <p>Title: </p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */public class FileFilter implements Filter { public void init(FilterConfig config) throws javax.servlet.ServletException { } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, javax.servlet.ServletException { HttpServletRequest hrequest = (HttpServletRequest) request; String uri = hrequest.getServletPath(); System.out.println(uri + "|" + uri.substring(uri.lastIndexOf("/") + 1)); //重定向到文件下载界面 if (uri.startsWith("/filedownload/")) { //按照UNID方式进行设置 hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?UNID=" + uri.substring(uri.lastIndexOf("/") + 1)). forward(request, response); }else if (uri.startsWith("/projectdownload/")) { //按照项目参数方式进行设置 int i=uri.lastIndexOf("/") ; String strTaskCode=uri.substring(i+1); String strProjectId=uri.substring(17,i); hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?Projectid=" +strProjectId+"&Taskid=" + strTaskCode). forward(request, response); } } public void destroy() { }}----------------WEB.XML的配置<filter> <filter-name>FileFilter</filter-name> <filter-class>com.ASSys.filter.FileFilter</filter-class> </filter> <filter-mapping> <filter-name>FileFilter</filter-name> <url-pattern>/filedownload/*</url-pattern> </filter-mapping>---------------------------实际情况http://host/filedownload/123123123就类似于http://host/filedownload?123123123 楼上所说的其实就是传说中的URL重写大法 String是引用传参吗? 用struts2 request保存的变量在jsp中不输出 关于路径中加"/"的问题 大虾们,java中一个汉字占两个字节在流中输出高低位如何置换下呢? 请高手进来指点, 关于jstl中文乱码问题,自认为很高深,闲人免进,呵呵 怎么解决JDBC读ORACLE的乱码问题 用友U6期末处理时自动生成调整单错误!!!!! 我的TOMCAT配置不起来 急啊!旋转365 裸身跪求一解 请问一种错误和解决方法 jsp forward 如何通过flash实现文件上传,高分求助(100) 紧急疑问,马上要答辩了,出错了~
其实根本不用改什么RESIN.
你可以使用过滤器SERVLET。
监听类似:
http://www.9kf.net/id/80然后自己分析URL,获取最终参数。
这种方法有一个好处:
1、跨应用服务器,比你单纯改服务器代码好;-----------------------------
类似代码:
package com.ASSys.filter;import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import java.io.IOException;import com.ASSys.ca.CADelegater;
import javax.servlet.http.HttpServletRequest;/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class FileFilter
implements Filter {
public void init(FilterConfig config) throws javax.servlet.ServletException {
} public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws java.io.IOException,
javax.servlet.ServletException {
HttpServletRequest hrequest = (HttpServletRequest) request;
String uri = hrequest.getServletPath();
System.out.println(uri + "|" + uri.substring(uri.lastIndexOf("/") + 1));
//重定向到文件下载界面
if (uri.startsWith("/filedownload/")) {
//按照UNID方式进行设置
hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?UNID=" +
uri.substring(uri.lastIndexOf("/") + 1)).
forward(request, response);
}else if (uri.startsWith("/projectdownload/")) {
//按照项目参数方式进行设置
int i=uri.lastIndexOf("/") ;
String strTaskCode=uri.substring(i+1);
String strProjectId=uri.substring(17,i);
hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?Projectid="
+strProjectId+"&Taskid=" + strTaskCode).
forward(request, response);
}
} public void destroy() {
}
}
----------------
WEB.XML的配置
<filter>
<filter-name>FileFilter</filter-name>
<filter-class>com.ASSys.filter.FileFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>FileFilter</filter-name>
<url-pattern>/filedownload/*</url-pattern>
</filter-mapping>
---------------------------
实际情况
http://host/filedownload/123123123
就类似于
http://host/filedownload?123123123
其实根本不用改什么RESIN.
你可以使用过滤器SERVLET。
监听类似:
http://www.9kf.net/id/80然后自己分析URL,获取最终参数。
这种方法有一个好处:
1、跨应用服务器,比你单纯改服务器代码好;-----------------------------
类似代码:
package com.ASSys.filter;import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import java.io.IOException;import com.ASSys.ca.CADelegater;
import javax.servlet.http.HttpServletRequest;/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class FileFilter
implements Filter {
public void init(FilterConfig config) throws javax.servlet.ServletException {
} public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws java.io.IOException,
javax.servlet.ServletException {
HttpServletRequest hrequest = (HttpServletRequest) request;
String uri = hrequest.getServletPath();
System.out.println(uri + "|" + uri.substring(uri.lastIndexOf("/") + 1));
//重定向到文件下载界面
if (uri.startsWith("/filedownload/")) {
//按照UNID方式进行设置
hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?UNID=" +
uri.substring(uri.lastIndexOf("/") + 1)).
forward(request, response);
}else if (uri.startsWith("/projectdownload/")) {
//按照项目参数方式进行设置
int i=uri.lastIndexOf("/") ;
String strTaskCode=uri.substring(i+1);
String strProjectId=uri.substring(17,i);
hrequest.getRequestDispatcher("/AS_SYSTEM/filedownload.jsp?Projectid="
+strProjectId+"&Taskid=" + strTaskCode).
forward(request, response);
}
} public void destroy() {
}
}
----------------
WEB.XML的配置
<filter>
<filter-name>FileFilter</filter-name>
<filter-class>com.ASSys.filter.FileFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>FileFilter</filter-name>
<url-pattern>/filedownload/*</url-pattern>
</filter-mapping>
---------------------------
实际情况
http://host/filedownload/123123123
就类似于
http://host/filedownload?123123123