You could use a Servlet Filter, and apply it to whatever pages necessary. I
am using a filter to check to see if the current user has a User bean in
their session; if they don't I create it.  If they do, then the filter just
sends the request on to Struts.

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-----Original Message-----
From: Wendy Smoak [mailto:Wendy.Smoak@;asu.edu] 
Sent: Thursday, October 24, 2002 3:49 PM
To: Struts Users Mailing List
Subject: Third party user authentication w/ cookies, custom tag


I have a custom JSP tag that looks for a cookie and if it's not there, sends
the user off to log in with our campus-wide authentication thing.  I put a
parameter on the URL, and that login page [not mine] authorizes the user,
sets the cookie, and then sends him back to the URL I provided.

Now that Struts is involved, at the top of the JSP is too late to do this--
by that time, I've already read from the database and gotten all ready to
display the info, only to find out that I shouldn't because there's no
cookie.  And besides, I'm having a heck of a time building up the URL to
return to-- request.getRequestURI() is returning something like
.../WEB-INF/jsp/contact.jsp which just won't work.

Does anyone have any suggestions on transforming my existing flow into
something that works with Struts?  Right now I'm going to move the 'look for
the cookie and redirect' code into the Action and hopefully set up a global
'forward'.  (But I haven't worked out how to append a parameter to that
URL.)

[Tomcat 4.1.12 & a recent Struts nightly build.]

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to