NutzCN Logo
问答 Invalid Request (method='' url ch=0x16) (IP=101.226.103.146)
发布于 3256天前 作者 Rekoe 5326 次浏览 复制 上一个帖子 下一个帖子
标签: mvc

这种请求怎么把它过滤掉
我写了一个链表 好像没起作用

public class CheckMethodProcessor extends AbstractProcessor {

	@Override
	public void process(ActionContext ac) throws Throwable {
		String reqMethod = ac.getRequest().getMethod();
		if (StringUtils.isBlank(reqMethod)) {
			return;
		}
		doNext(ac);
	}

}
6 回复

这种请求到不了NutFilter吧

@wendal
这个是错误 很恶心

Invalid Request (method='' url ch=0x16) (IP=101.226.103.146)
[15-12-18 10:32:29.996] {resin-port-9000-39} BadRequestException: com.caucho.server.dispatch.BadRequestException: Invalid Request(Remote IP=101.226.103.146)
2015-12-18 10:32:29,997 [WARN][org.apache.shiro.mgt.DefaultSecurityManager] - Delegate RememberMeManager instance of type [org.apache.shiro.web.mgt.CookieRememberMeManager] threw an exception during getRememberedPrincipals().
java.lang.NullPointerException
	at com.caucho.server.http.AbstractCauchoRequest.getSessionCookie(AbstractCauchoRequest.java:727)
	at com.caucho.server.http.HttpServletRequestImpl.getCookies(HttpServletRequestImpl.java:918)
	at com.caucho.server.http.CauchoDispatchRequest.getCookies(CauchoDispatchRequest.java:492)
	at javax.servlet.http.HttpServletRequestWrapper.getCookies(HttpServletRequestWrapper.java:228)
	at org.apache.shiro.web.servlet.SimpleCookie.getCookie(SimpleCookie.java:384)
	at org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:363)
	at org.apache.shiro.web.mgt.CookieRememberMeManager.getRememberedSerializedIdentity(CookieRememberMeManager.java:205)
	at org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals(AbstractRememberMeManager.java:393)
	at org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity(DefaultSecurityManager.java:604)
	at org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals(DefaultSecurityManager.java:492)
	at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:342)
	at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846)
	at org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.createSubject(AbstractShiroFilter.java:292)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:359)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
	at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:131)
	at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
	at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:298)
	at com.caucho.server.webapp.RequestDispatcherImpl.error(RequestDispatcherImpl.java:131)
	at com.caucho.server.webapp.ErrorPageManager.sendServletErrorImpl(ErrorPageManager.java:452)
	at com.caucho.server.webapp.ErrorPageManager.sendServletError(ErrorPageManager.java:195)
	at com.caucho.server.http.AbstractHttpRequest.sendRequestError(AbstractHttpRequest.java:1707)
	at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:861)
	at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1345)
	at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1301)
	at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1285)
	at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1193)
	at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:992)
	at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
	at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
	at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
	at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
	at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
	at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)

想想有办法处理掉这个玩意么

看着堆栈信息,只能在shiro之前拦截一下了

那我只能继承它的filter 实现一个自己的了

大爷的
他把doFilter方法整成final的了
@wendal

添加回复
请先登陆
回到顶部