RE: Checking a cookie or redirecting - best way?

2004-09-21 Thread Robert Taylor
Why not use a Filter? The logic goes in one place and you
can map the Filter to all requests.

robert

 -Original Message-
 From: Dave Johnson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 21, 2004 8:42 AM
 To: Struts Users Mailing List
 Subject: Checking a cookie or redirecting - best way?
 
 
 hi all
 
 Well now I've got this cookie that I need to check for, and if it
 exists, lovely. Nothing else needs to be done.
 
 if NOT, I need to send the user to a specific page (/error.jsp).
 
 I was thinking of using logic:present to check for the bean, but I
 dont want to wrap all my jsp code with that tag, what I really want is
 something simple at the beginning that checks if the bean is there
 then does a redirect if there's an error.
 
 should I be using a struts tag or scriptlet?
 
 what about if I need to include something like that in HTML (using
 javascript) has anyone done that?
 
 Thanks
 
 D
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Checking a cookie or redirecting - best way? (Getting ERROR, Help!)

2004-09-21 Thread Daniel Perry
It is saying that bean:cookie should be an empty tag. As you havnt closed
the tag, it isnt empty!

So, should be:
bean:cookie id=validUser name=userCookie /

Notice the slash on the end!

Daniel.

 -Original Message-
 From: CCNY [mailto:[EMAIL PROTECTED]
 Sent: 21 September 2004 14:04
 To: Struts Users Mailing List
 Subject: Fwd: Checking a cookie or redirecting - best way? (Getting
 ERROR, Help!)


 So when I run the jsp below (ironically named success.jsp) I get the
 following error

 org.apache.jasper.JasperException: /pages/success.jsp(4,0) According
 to TLD, tag bean:cookie must be empty, but is not

 Huh?

 I also tried bean:cookie name=validUser in the JSP, sme error.

 Can anyone help? am i useing bean:cookie wrong?


 -- Forwarded message --
 From: Dave Johnson [EMAIL PROTECTED]
 Date: Tue, 21 Sep 2004 08:41:47 -0400
 Subject: Checking a cookie or redirecting - best way?
 To: Struts Users Mailing List [EMAIL PROTECTED]

 hi all

 Well now I've got this cookie that I need to check for, and if it
 exists, lovely. Nothing else needs to be done.

 if NOT, I need to send the user to a specific page (/error.jsp).

 I was thinking of using logic:present to check for the bean, but I
 dont want to wrap all my jsp code with that tag, what I really want is
 something simple at the beginning that checks if the bean is there
 then does a redirect if there's an error.

 should I be using a struts tag or scriptlet?

 what about if I need to include something like that in HTML (using
 javascript) has anyone done that?

 Thanks

 D

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]