未经身份验证的用户的 Tomcat 7 重定向

标签 tomcat authentication redirect

我在 Tomcat 7 中使用基于表单的身份验证。但是,在一些特定页面上,我想将未经身份验证的用户路由到非安全资源,而不是登录页面

类似于:

secure1.html -> unsecured1.html 
secure2.html -> unsecured2.html
.*.html -> login.html  (all others, redirect normally with with my login-config)

这在 Tomcat 7 中可行吗?

<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>login.html</form-login-page>
        <form-error-pagelogin-error.html</form-error-page>
    </form-login-config>
</login-config>

最佳答案

我想你可以使用这样的东西 http://www.tuckey.org/urlrewrite/完成工作。它的功能类似于 apache 中的 mod_rewrite。

关于未经身份验证的用户的 Tomcat 7 重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30167145/

相关文章:

.htaccess - 子域重定向错误 + Htaccess,困惑?

spring - 部署在连接到 mariadb 的 tomcat 上的 spring 应用程序的连接池的最佳选择

java - 不使用 GIT 将 WAR 文件部署到 Openshift?

java - Tomcat 正在创建但未记录到文件

Windows 上的 PHP : How to use web services with the logged on user's identity?

javascript - 将外部页面加载到 Cordova/Phonegap 应用程序

java - 将 Grails War 文件安装到远程服务器,包括 mysql 数据库

authentication - 无法在 IBM Worklight 中使用 LDAP 身份验证进行身份验证

java - keystore 中私钥和签名证书之间的链接

bash - find -exec 选项中的输入重定向