English 中文(简体)
如何确保用户在控制层进入该系统?
原标题:How to ensure the user is logged into the system at the controller level?

我使用春天电能,我有一个我必须建立的习俗认证/安全制度。

NOTE:  I know of spring security, but my requirements were to do this in a custom way so please not looking for suggestions about using spring s security modules.

当用户登录系统时,该系统会生成一个会议表。 当用户访问一页时,拦截者看着该厨师的存处,看着会议以我方言为指导,如果现在它装上了一些数据,并储存在请求的属性中。

现在,对于用户必须贴上标签的网页,我如何能够限制在控制层的出入?

我可以在拦截器中这样做:

if url.contains("projects/") ...

如果我只想限制项目主计长的用户使用,但这是我想要做的。

但是,我想到的是,我可能在控制人员一级增加一个说明,或者也许会产生一个基地主计长,即所有需要一名gged子使用者的控制人员将继承。

我选择什么这样的东西?

In ASP. NET,我创建了一个基地主计长,控制员有一个活动周期,在行动前的发射活动中,我检查了用户是否被拖入。

• 寻找春天的建议?

例如,在伙伴关系中。 NET 你有两种方法,一种是在控制者的行动方法之前发射的,另一种是在以下情况下发射的:

Controller.OnActionExecuting 
Controller.OnActionExecuted

http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.onactionexecuting.aspx

www.un.org/spanish/ecosoc in 迫害,我实际上可以看到,我究竟是谁是控制者,什么行动是以方案方式呼吁的,而不是看看要求URL,然后进行扼杀比较,看看看它是否是特别的控制者。

因此,在这种情况下,我可以简单地以 co子或我的要求属性检查事。

这是一种更加稳定的方式,可以做些什么,春天会有任何模仿?

最佳回答
问题回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...