<html:link page="/order.do?action=detail&" paramId="orderid" paramName="order" paramProperty="id"><bean:write name="order" property="id" /></html:link
解决方案 »
- 十万火急 !!!servlet调用数据库的内容在jsp页面显示
- log4j ConversionPattern 报错
- 关于tomcat启动报错的问题
- log4j:WARN Please initialize the log4j system properly.怎么改
- hibernate 更新数据问题
- 【急】java Struts2 根据文件路径可以上传附件吗?
- 关于分页中的checkbox问题?
- 谁知道怎么把easy struts加到jbuilder里,谢谢!!!!!!!!!!!!
- javac编译问题
- 向大神求教,Spring 使用 cglib动态代理问题
- 如何获取服务器端特定目录下的文件(在线等!!)
- Ajax 中jsp页面显示的都是问号?
* complete the overridder method and redirect the URL if need
* else forward request to the next filter
*/
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
if (request instanceof HttpServletRequest) {
StringBuffer requstURL = ((HttpServletRequest) request).getRequestURL();
String url = requstURL.toString();
int index = url.indexOf(userDir);
if(hashMap.containsKey(url.substring(url.lastIndexOf(".") + 1)) && index > 0){
//construct the URL
String redirectURL = "http://" + request.getServerName() + ":" + request.getServerPort()
+ baseDir + actionPath;
String tempStr = url.substring(url.lastIndexOf("/") + 1);
int splitIndex = tempStr.indexOf(".");
String nodeId = tempStr.substring(0,splitIndex);
redirectURL = redirectURL + "?nodeId=" + nodeId;
//redirect the URL
if(response instanceof HttpServletResponse){
((HttpServletResponse) response).sendRedirect(redirectURL);
}
}else if(index > 0){
//construct the URL
String redirectURL = "http://" + request.getServerName() + ":" + request.getServerPort()
+ baseDir + actionPath;
String tempStr = url.substring(url.lastIndexOf("/") + 1);
int splitIndex = tempStr.indexOf(".");
String nameId = tempStr.substring(0,splitIndex);
redirectURL = redirectURL + "?param1=" + nameId;
//redirect the URL
if(response instanceof HttpServletResponse){
((HttpServletResponse) response).sendRedirect(redirectURL);
}
}else{
chain.doFilter(request, response);
}
}
}