我有一个在VS2012中开发的测试ASP.NET MVC3应用程序.当我开始调试时,通过请求从主机访问应用程序http://localhost:<portnumber>.但是,如果我试图通过从远程计算机访问企业内网中相同的应用程序http://<ip>:<portnumber>,我得到HTTP error 400: Bad request. Invalid Host Name.至于它运行在IIS发表任何服务器配置无法访问.
有什么方法可以解决这个问题吗?
asp.net asp.net-mvc visual-studio-debugging iis-express visual-studio-2012
我有一个使用Spring Security 3.0.x的应用程序.我有一个习惯AuthenticationProvider:
public class AppAuthenticationProvider implements AuthenticationProvider {
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
...
if (!check1()) throw new UsernameNotFoundException();
if (!check2()) throw new DisabledException();
...
}
Run Code Online (Sandbox Code Playgroud)
我想在每个异常上发送cutom响应代码,例如404为UsernameNotFoundException,403为DisabledException等.现在我只在我的spring安全配置中有authentication-failure-url所以我在每个异常中重定向到authenticate ().