Trouble using waffle to get the client user name

2019-03-05 03:25发布

问题:

I have an intranet application, and I want to validate that users are authorized to use the program. Authorization is nothing fancy. I just look up the user in a Database table to see if i get a match on his username and the application name.

I have attempted this answer, but this statement:

request = (HttpServletRequest)Executions.getCurrent().getNativeRequest()

generates a Symbol not found error on Executions. Am I missing an import?

If I skip that statement and just use

request.getRemoteUser()

I get null.

标签: java waffle