Hi there,

I have 2 http servlets, one is at /myapp, and another is at /myapp/signin.

While registering servlets I construct my own http context instance of type
MyHttpContext

I'm using HttpService to register servlet NOT WebContainer, so it looks like

*this.httpService.registerServlet("/myapp", myServlet1, null, myHttpContext1
);*
*this.httpService.registerServlet("/myapp/signin", myServlet2, null,
myHttpContext2);*

then at the same context, I register an error page of 401 via WebContainer
*
this.webContainter.registerErrorPage("401", "/myapp/signin", myHttpContext1
);*

In MyHttpContext.handleSecurity method I'll check if the user is signed in,
otherwise 401 will be set, then the app should redirect to /myapp/signin
page because of error page handler.

But the real behavior is that:

1. a none signed in user visit /myapp
2. the myHttpContext.handleSecurity is called, then 401 is set
3. error page handler is invoked using the same myHttpContext1, then
handleSecurity is invoked again
4. in myHttpContext.handleSecurity mehtod, I've checked that if the servlet
request is from /myapp/siginin, no 401 but true will be returned
5. all these work as expected, but at the final, not the /myapp/signin page
is displayed but /myapp is

I'm wondering if it has something about the http context I used.

-- 
唐睿

电话:+86 010 58732330 转 810
传真:+86 010 58732330 转 800
手机(北京):+86 13717808625
手机(深圳):+86 13510560457

汉星天(中国)公司
地址(北京):北京市海淀区知春路甲 48 号盈都大厦 A 座 9B (100098)

Hansky
Better Software, Better Business

WWW.HANSKY.COM.CN
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to