in your java code do: context.put("X500Class", javax.security.auth.x500.X500Principal.class);
then in your template do: #set( $a = $subject.getPrincipals($X500Class) ) VTL is not java, you can't arbitrarily request a Class object as you tried, you should put that Class in the context, like anything else. On Wed, Apr 7, 2010 at 3:38 AM, Halm Reusser <halm.reus...@switch.ch> wrote: > Hi, > > $subject is an instance of javax.security.auth.Subject > > I would like to use the getPrincipals function with a java.lang.Class > argument[1]. > > My template looks something like that: > > #set( $a = > $subject.getPrincipals(javax.security.auth.x500.X500Principal.class) ) > #set( $b = > $subject.getPrincipals($javax.security.auth.x500.X500Principal.class) ) > > a) returns a parser exception > b) returns null > > Is that possible with velocity templates? If yes, what would be the > appropriate solution. > > [1] > http://java.sun.com/javase/6/docs/api/javax/security/auth/Subject.html#getPrincipals%28java.lang.Class%29 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org > For additional commands, e-mail: user-h...@velocity.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org