M
moo moo
Im using Struts. I was having a problem setting a cookie in an Action
Class, basically it wouldn't work. However I was able to set a cookie
with no problem in another Action class. After many many hours of head
scratching and a long process of elimination etc etc I discovered that
if the action path is
<action path="/dog"
type="MyClass">
</action>
i.e. a url of http://localhost:8080/dog.do
Then MyClass sets the cookie no problem. If the action path is
<action path="/a/dog"
type="MyClass">
<forward name="pdboard1" path="/pdboard1.do"/>
</action>
i.e. a url of http://localhost:8080/a/dog.do
then the cookie is not set. As soon as I changed the path from
'/a/dog' to '/dog' it all worked with no problem.
I guess this is a web server issue (Im using Resin)?
Pehaps urls of the form http://www.mysite.com/a/dog.do are ok? (its
only with http://localhost:8080 you get a problem )
This probably explains why sometimes the URL is re-written with the
JSESSIONID in it.
Hmmmm -- I'm very worried now. Is this a known problem or have I been
doing something wrong? Perhaps my web site is totally f****d up and I
dont know it ... oh my god!!!!
Class, basically it wouldn't work. However I was able to set a cookie
with no problem in another Action class. After many many hours of head
scratching and a long process of elimination etc etc I discovered that
if the action path is
<action path="/dog"
type="MyClass">
</action>
i.e. a url of http://localhost:8080/dog.do
Then MyClass sets the cookie no problem. If the action path is
<action path="/a/dog"
type="MyClass">
<forward name="pdboard1" path="/pdboard1.do"/>
</action>
i.e. a url of http://localhost:8080/a/dog.do
then the cookie is not set. As soon as I changed the path from
'/a/dog' to '/dog' it all worked with no problem.
I guess this is a web server issue (Im using Resin)?
Pehaps urls of the form http://www.mysite.com/a/dog.do are ok? (its
only with http://localhost:8080 you get a problem )
This probably explains why sometimes the URL is re-written with the
JSESSIONID in it.
Hmmmm -- I'm very worried now. Is this a known problem or have I been
doing something wrong? Perhaps my web site is totally f****d up and I
dont know it ... oh my god!!!!