Re: Alternatives to <req:isUserInRole>

Kris Schneider <[email protected]>
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
Quoting Antonio Petrelli <[email protected]>:

> 2007/6/8, Kris Schneider <[email protected]>:
> >
> > > JSP 2.0, Servlet 2.4, why?
> >
> > Um, all the better to help you, why else? ;-)
> 
> 
> 
> Yes, that's obvious, thanks :-)
> 
> 
> As of JSP 2.0, you can create EL functions that map to public static Java
> > methods. If you'd been using an older version of JSP, this option wouldn't
> > be
> > available. If you're not familiar with how to get that set up, post back
> > and
> > I'll provide more details.
> 
> 
> 
> But "HttpServletRequest.isUserInRole" is not static...

True, but I don't think I implied that it was. You would write your own utility
method that would be exposed as an EL function:

public class Functions {
  public static boolean isUserInRole(HttpServletRequest req, String role) {
    return req.isUserInRole(role);
  }
}

> Antonio

-- 
Kris Schneider <mailto:[email protected]>
D.O.Tech       <http://www.dotech.com/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.