覆盖JSP servlet(过滤器“* .jsp”)以包装在身份验证模型中 [英] Overriding the JSP servlet (filter "*.jsp") to wrap in an authentication model

查看:110
本文介绍了覆盖JSP servlet(过滤器“* .jsp”)以包装在身份验证模型中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以以某种方式扩展在* .jsp(org.apache.jasper.servlet.JspServlet,Tomcat 6)中过滤的JSP servlet,以便每当有人进入JSP页面时,我都可以进行一些服务器端身份验证来检查是否用户可以查看该页面。我们当前的技术是一个常见包含中的taglib,它被导入到每个JSP页面中,但它不是很优雅。

Can the JSP servlet that filters on *.jsp (org.apache.jasper.servlet.JspServlet in Tomcat 6) be extended in some way so whenever someone goes to a JSP page I can do some server side authentication to check whether the user can view the page. Our current technique is a taglib in a common include that is imported into each JSP page, but it's not very elegant.

这里的关键是我不想重新发明轮子并担心将JSP编译成Servlet,我最好用super.meth()委托每个方法。

The key here is that I don't want to reinvent the wheel and worry about compiling JSPs into Servlets, I would ideally like to delegate in each method with super.meth().

我一直在搜索谷歌但是我不知道使用正确的关键字。任何包含JSP和Servlet的东西都会返回初学者教程。

I've been searching Google but I don't know the right keywords to use. Anything containing JSP and Servlet returns beginner tutorials.

谢谢,

John

推荐答案

查看 Servlet过滤,并在转发到某个JSP或Servlet之前使用该过滤器。

Look at Servlet Filters, and use that Filter before forwarding to some JSP or Servlet.

这篇关于覆盖JSP servlet(过滤器“* .jsp”)以包装在身份验证模型中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆