[PJUG Javamail] Cookies, anyone?

Sean Adkinson sean.adkinson at gmail.com
Tue Jun 24 00:29:40 UTC 2008


Since the different organizations our web application supported certainly
had custom content, we were able to solve that issue.

I was talking about maps and keys in my last email, but wasn't very clear.
But here is the quick rundown of exactly how it worked.

We maintained a map in Spring from host name to organization key, so that,
for example,  "ks.iqacademy.com" mapped to "kansas".  Then "kansas" became
the key to maps that contained organization specific data, including
content, images, permission levels, etc.  If we had a paragraph of
information that needed to change by organization, we would call a taglib
that would output the paragraph of information, given the organization key
in the session.  Our JSPs stayed very clean, and developing new
organizations was as easy as basically creating a new properties file.

It sounds like you need entire pages being swapped in and out, not just
little paragraphs or images.  What we would have done in this situation
would be something like this (would actually be in Spring, but this is java
code for readability):

Map<String, String> loginPageMap = new HashMap<String, String>();
loginPageMap.put("kansas", "kaLogin.jsp");
loginPageMap.put("washington", "waLogin.jsp");
loginPageMap.put("oregon", "orLogin.jsp");

Then when we were ready to send them to a certain jsp:

String orgKey = getSession().getAttribute(SessionConstants.ORG_KEY);
String loginPage = loginPageMap.get(orgKey);

Then we would forward to the loginPage.

- Sean


On Mon, Jun 23, 2008 at 5:03 PM, Joe Hoffman <joe at intelopment.com> wrote:

> What about setting up a different custom landing/error page while you know
> the  authenticated user.  Perhaps store this as a coded  URL parameter.
> A few parts of this I'm not sure will work, and need further thinking,
>  which I will do while I reseal my deck this evening.
>
>
> On Jun 23, 2008, at 5:00 PM, Richard Johnson wrote:
>
> Good idea, already tried.  It turned out to be superfluous.  Instead I'm
> mostly doing it with what I already know on the server.  One edge case
> confounds me at the moment though.
>
> If the user logs in from a client intranet, then the URL can be
> pre-established (I tell them the link to use) and they can have their own
> custom login.  If OTOH the user logs in from just anywhere they need to land
> on the generic login first and then get custom L&F (and workflow.)
>
> Once the user is logged in, then we can track the client internally because
> the webUser and the user's client are in the same db table.  I can just
> check on each page to make sure they get the right css, images, etc.
>
> However ... what to do when the session has expired (gone away) the client
> has a custom login page?   When a session expires, the session is gone, the
> user is gone and the client is gone.  I'm really trying to figure out some
> way to get to a specific one of "n" possible custom landing pages from a
> single session expired.  Is there some information laying around somewhere
> that I could use to build a redirect to one of several login pages?
>
> If you guys tell me it isn't possible or requires lots of work, then at
> least I have more ammunition to go back to them with to allow landing on a
> single generic page in this one situation.
> --
> Richard
>
>
>
> ------------------------------
> *From:* Joe Hoffman [mailto:joe at intelopment.com <joe at intelopment.com>]
> *Sent:* Monday, June 23, 2008 4:16 PM
> *To:* Richard Johnson
> *Cc:* javamail at pjug.org
> *Subject:* Re: [PJUG Javamail] Cookies, anyone?
>
> Why not just use  URL Session Rewriting?  This seems like the standard
> backup technique when the browser chokes on the cookie.
>
>
> On Jun 23, 2008, at 4:20 PM, Richard Johnson wrote:
>
> Hi,
>
> Anyone have a handy recipe to identify the source of a request without
> using cookies?  Seems our sales guys sold some clients a custom look and
> feel without first discovering that their security policy forbids accepting
> any cookies.  Now I get to implement that ....   (As usual, simple is
> good.)  :-)
>
> --
> Richard Johnson, Systems Architect
> Lingo Systems
> 15115 SW Sequoia Pkwy #200
> Portland Oregon 97224
> richardj at lingosys.com
> http://www.lingosys.com
> voice  503-419-4889 or 800-878-8523
> FAX   503-419-4873
>
>
> <untitled.bmp>
>
> _______________________________________________
> Web Site - http://www.pjug.org/
> Javamail mailing list
> Javamail at pjug.org
> http://www.pjug.org/mailman/listinfo/javamail
>
>
> _______________________________________________
> Web Site - http://www.pjug.org/
> Javamail mailing list
> Javamail at pjug.org
> http://www.pjug.org/mailman/listinfo/javamail
>
>
>
> _______________________________________________
> Web Site - http://www.pjug.org/
> Javamail mailing list
> Javamail at pjug.org
> http://www.pjug.org/mailman/listinfo/javamail
>
>


-- 
Sean Adkinson
Web Insight Technology
(503) 731-5488 work, (503) 866-0852 cell
sean.adkinson at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://javac.com/pipermail/javamail/attachments/20080623/f43c84c4/attachment-0002.html>


More information about the Javamail mailing list