You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Hodgeman, Robert (LNG)" <Ro...@lexisnexis.com> on 2002/08/08 19:06:48 UTC

Visibility of newly-added cookie values in JSP?

I've got a JSP page that lists the actions that a user may choose to
perform, based on whether or not a cookie was found (which indicates that
the user has previously authenticated with the system):

<html:link page="/authenticate">...</html:link>
<logic:present cookie="authenticationInfo">
    <html:link page="/action1">...</html:link>
    ...
</logic:present>

So, first time in, the user must authenticate.  The authenticate action then
places a cookie containing authentication info into the response and
forwards back to this same JSP.  The idea is that the JSP should now find
the cookie value and display the additional selections to the user.

However, the <logic:present> tag is not picking up the presence of the
newly-added cookie value.  If I refresh the JSP page (without re-executing
the authenticate action), the options show up.

Is there a straightforward way to check for the existence of a newly-added
cookie (one that did not come in on the request, but has since been added to
the response)?

Thanks,
-Bob

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Simple question about Struts

Posted by Melissa L Kelley <st...@stuology.net>.
On Thu, 8 Aug 2002, Eddie Bush wrote:

> Go check out Chuck's book to see what Struts can do and how easily it
> can be configured.  If you have specific questions about "Well, would my
> end usrs have to program to do <X>?" just swing by and drop us a note.
>  There are a bunch (understatement!) of talented folks on the list that
> aren't scared to give their opinion.  Oh, and you might also search
> "oreilly.com" articles for "rolling blogger" to give you some ideas of
> how you can automate Struts configuration type things.  I haven't looked
> at his system in depth, but, as I recall, he builds his design on Struts
> (and Velocity, and ...).
>


This is the site for Roller: http://www.rollerweblogger.org/
It has a link to the O'Reilly article. I can't say too much about it
because I haven't poured through the code much either, but it deployed
quite easily.




--> stu: www.stuology.net
It just no longer is plain simple safe fun
when it's the psycho chimp that has the ray gun
------------------------------------------------
Stuology -- A million monkeys can't be wrong



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Simple question about Struts

Posted by Eddie Bush <ek...@swbell.net>.
Craig could address this better, and I'm sure that he will eventually 
(he's a busy guy).

E. Laverdiere wrote:

>Hi all,
>
>I've studiing Struts for the past 3 weeks because I have done a generic Jsp
>"content-management" web site connected on a MySql database using a set of
>custom tag libraries following the Manning book "Tag Librairies". So I am
>still new at Struts, and I would like a simple advice over the Struts
>framework. I was hoping to adapt my site to a Struts framework to gain some
>architectural strenght and, by re-using the work I've done with Strut, I
>thaught, limit the future development when doing another site with the same
>framework.
>
Have you read Chuck Cavaness' book on "theserverside.com" yet?  Go there 
and search for "struts book review".  (It's available for preorder now!)

>My question is : Can a Strut web site be modify or upgrade without the
>outcome of a java programmers? I means without the creation of multiple java
>classes? It seems that if you want to add a page, or modify the parameter or
>the validation of a form, you must go into the java classes that controle
>this form and add some logic into it. Without questioning the strength of
>MVC, in a first glance, it seems that this framework is not light-weight and
>demands some real professional effort to adapt or modifie any web solution
>using this structure. So, maybe, loosing the goal of building a generic
>solution?
>
It depends on how complex of a change you want to effect.  You can add 
actions to the configuration without having to write a single line of 
Java code - Struts provides some nice default actions to serve this 
purpose.  If you need to add processing of some sort or another then, 
yes, you're probably going to have to know some Java.  I should say 
though, that the complexity of the Action classes you write will be tied 
to how well you move your logic into beans (how well you abstract your 
operations).  If you give your end-users a nice facade to work with, I 
wouldn't think it would be very complex programming - but it also will 
depend on the nature of the task they wish to implement.

Struts, Tiles, and the Validation Framework are all configured (almost) 
exclusively by their respective XML configuration files - and those are 
easily understood, even by folks that don't know XML as more than "a 
slightly different HTML" (aka ME).  Bear in mind that you could always 
build some interface to manipulate this for your end-users if you felt 
the need.

Go check out Chuck's book to see what Struts can do and how easily it 
can be configured.  If you have specific questions about "Well, would my 
end usrs have to program to do <X>?" just swing by and drop us a note. 
 There are a bunch (understatement!) of talented folks on the list that 
aren't scared to give their opinion.  Oh, and you might also search 
"oreilly.com" articles for "rolling blogger" to give you some ideas of 
how you can automate Struts configuration type things.  I haven't looked 
at his system in depth, but, as I recall, he builds his design on Struts 
(and Velocity, and ...).

Regards,

Eddie



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Simple question about Struts

Posted by "E. Laverdiere" <et...@sympatico.ca>.
Hi all,

I've studiing Struts for the past 3 weeks because I have done a generic Jsp
"content-management" web site connected on a MySql database using a set of
custom tag libraries following the Manning book "Tag Librairies". So I am
still new at Struts, and I would like a simple advice over the Struts
framework. I was hoping to adapt my site to a Struts framework to gain some
architectural strenght and, by re-using the work I've done with Strut, I
thaught, limit the future development when doing another site with the same
framework.

My question is : Can a Strut web site be modify or upgrade without the
outcome of a java programmers? I means without the creation of multiple java
classes? It seems that if you want to add a page, or modify the parameter or
the validation of a form, you must go into the java classes that controle
this form and add some logic into it. Without questioning the strength of
MVC, in a first glance, it seems that this framework is not light-weight and
demands some real professional effort to adapt or modifie any web solution
using this structure. So, maybe, loosing the goal of building a generic
solution?


By the way, I think I have having a virus a day (just got one) with this
mailing list, nobody scan the mail before sending it?

Regards,


Etienne
Montreal



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Visibility of newly-added cookie values in JSP?

Posted by Eddie Bush <ek...@swbell.net>.
Think about what happens when you do a forward.  You have the exact same 
request/response (unless you modified it) as you did before.  You add 
cookies to the response so they can be sent back to the browser. 
 Therefore, you're not going to get that cookie until there is another 
request.

In other words, the behavior you're seeing is exactly what should 
happen.  If you want the cookie to "take affect", you're going to have 
to redirect back to the original page instead of forward.

Regards,

Eddie

Hodgeman, Robert (LNG) wrote:

>I've got a JSP page that lists the actions that a user may choose to
>perform, based on whether or not a cookie was found (which indicates that
>the user has previously authenticated with the system):
>
><html:link page="/authenticate">...</html:link>
><logic:present cookie="authenticationInfo">
>    <html:link page="/action1">...</html:link>
>    ...
></logic:present>
>
>So, first time in, the user must authenticate.  The authenticate action then
>places a cookie containing authentication info into the response and
>forwards back to this same JSP.  The idea is that the JSP should now find
>the cookie value and display the additional selections to the user.
>
>However, the <logic:present> tag is not picking up the presence of the
>newly-added cookie value.  If I refresh the JSP page (without re-executing
>the authenticate action), the options show up.
>
>Is there a straightforward way to check for the existence of a newly-added
>cookie (one that did not come in on the request, but has since been added to
>the response)?
>
>Thanks,
>-Bob
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>