小编gat*_*r88的帖子

连接到Visual Studio通过LAN调试IIS Express服务器

我有一个在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

77
推荐指数
5
解决办法
9万
查看次数

Spring安全性验证异常处理

我有一个使用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 ().

authentication exception-handling spring-security

12
推荐指数
3
解决办法
3万
查看次数