There’s a mostly undocumented substitution string present in all of the standard APEX themes. If you look at the page template definitions (expect for the login templates, of course), you’ll see something like the following:
This displays as a simple little “Welcome, &APP_USER.” Very basic, but still useful–it’s nice to let people know they’re logged in (and who they’re logged in as, especially on public computers!) But there are problems.
First, you can’t configure it. The username displays in all caps, even if the user logged in using lowercase letters for their name. Second, it doesn’t play nice on public pages (such as this blog)–if the user’s not logged in, you get “Welcome,”, which is neither attractive nor useful. Third, it doesn’t substitute if you place it after #BOX_BODY#, which is a problem if you want to put it in a sidebar on the right of the page.
The third issue can be resolved by using div-based templates, putting the sidebar before the body, and floating it to the right with CSS (which this page does). But what about the other two?
Since you can’t change APP_USER (ok, you might be able to, but I can’t imagine it being a good idea), the best solution I’ve found is to create an application level item, replacing #WELCOME_USER# with somethign like “Welcome, &APP_ITEM.”, and creating an application computation to populate it. The nice thing about application computations is that they happen on every page (you can also set them to run per session if they’re intensive, but this one isn’t). Here’s the computation I use:
select decode(:APP_USER,'nobody','Guest',initcap(:APP_USER)) from dual;
It’s a small thing, but I think it adds a nice touch.