WebSphere Portal Server - Using part of <wps:user attribute="userid"/>

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > April 2004 > Using part of <wps:user attribute="userid"/>





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Using part of <wps:user attribute="userid"/>

2004-04-28, 12:34 pm

How can I use part of the username in Head.jsp?

This works:
<% String username = "My name"; %>
<% out.println(username); %>

But this doesn't, if I apply this to a Place it return a totally blank page:
<% String username = <wps:user attribute="userid"/>; %>
<% out.println(username); %>

Later on in the jsp I want to use the first three character of the user name to determine which stylesheet to use. Something like:
<link href='<wps:urlFindInTheme file="Styles_"+stylegroup+".css"/>' rel="styleSheet" type="text/css">

Any suggestions to get this to work are welcome.
Michael Harris

2004-04-28, 5:34 pm

You can't embed a JSP tag in the middle of a scriptlet.

You can search the forum for information about accessing the PUMA classes to
get the userid in a string or you can try to use the [wps:captureContent]
tag to get the output of the [wps:user] tag.

[wps:captureContent contextKey="somekey"][wps:user
attribute="userid"/][/wps:captureContent]
val=[%=pageContext.getAttribute("somekey")%]



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com