You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by mu baosen <mu...@gmail.com> on 2006/02/08 06:15:34 UTC

cookie in portlet

Hello everyone

Can a cookie be added in a portlet?

Thanks

Re: cookie in portlet

Posted by mu baosen <mu...@gmail.com>.
>
> Thank you.

Re: cookie in portlet

Posted by Jian Liao <ji...@gmail.com>.
Please read JSR-168 spec,Section 16.3.3.

On 2/10/06, mu baosen <mu...@gmail.com> wrote:
>
> >
> > Thank you very much.
>
>    If i call response.addCookie() in a jsp and include the jsp in a
> portlet.
> Can it work correctly?


No.




--
thanks,
- Jian Liao

Arrange menu items on the horizontal menu in order ?

Posted by Pham Tuan Minh <ph...@yahoo.com>.
Hi all,
How to arrange menu items on the horizontal menu in
order  ?
Thanks.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: cookie in portlet

Posted by mu baosen <mu...@gmail.com>.
>
> Thank you very much.

   If i call response.addCookie() in a jsp and include the jsp in a portlet.
Can it work correctly?

noob note: suggestion to avoid gotcha with getting started documentation

Posted by tony kerz <to...@sbcglobal.net>.
just wanted to mention to folks responsible for maintaining 
documentation at:

http://portals.apache.org/jetspeed-2/getting-started-installer.html

in case they wanted to account for the following situation:

i followed the directions and got a 404: The requested resource 
(/jetspeed/portal) is not available.

when hitting http://localhost:8080/jetspeed/portal

turns out i was inadvertently running tomcat out of a previous install 
directory because
when i ran:

c:\Program Files\Apache Jetspeed 2.0\bin\startup.bat

i wasn't in the above bin directory and it bailed indicating that 
CATALINA_HOME had to be defined.

i defined CATALINA_HOME to point to my existing tomcat installation 
directory,
and the startup.bat ran successfully, but of course it was running 
tomcat out of my existing install,
which didn't have the jetspeed webapps present.

if CATALINA_HOME *is not* defined and you run from the jetspeed bin dir, 
then startup does the right thing,
if CATALINA_HOME is defined to point to an existing install, then 
startup will not behave as expected.

i would recommend comments in the getting started document to indicate 
to either:

(a) insure that CATALINA_HOME isn't defined and run startup from the 
jetspeed bin dir, or

(b) if CATALINA_HOME is defined to point it to the jetspeed install dir


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: cookie in portlet

Posted by James Liao <ji...@gmail.com>.
See PLT.16.3.3
The following methods of the HttpServletResponse must perform no operations:
setContentType, setContentLength, setLocale, addCookie, sendError,
5 sendRedirect, setDateHeader, addDateHeader, setHeader, addHeader,
setIntHeader, addIntHeader and setStatus.cxl The containsHeader method of
the HttpServletResponse must return false.

JSR-168 spec does not allow to modify cookie on portlet level, you should
achieve this by add a J2 org.apache.jetspeed.pipeline.valve.Valve, but this
is specific to j2.

HTH,
- Jian Liao

On 2/10/06, Philip Mark Donaghy <ph...@gmail.com> wrote:
>
> Try ((javax.servlet.http.HttpServletResponseWrapper
> )portletResponse).addCookie()
>
> I'm not sure off the top of my head. Check the javadocs.
>
> Phil
>
> On 2/8/06, mu baosen <mu...@gmail.com> wrote:
> > >
> > > Thanks for replying.
> >
> >
> >    I can not find the getResponse method in PortletResponse class.How to
> get
> > it?
> >
> >   Regards,
> >   Mubaosen
> >
> >
>
>
> --
> Philip Donaghy
> donaghy.blogspot.com del.icio.us/donaghy/philip
> Skype: philipmarkdonaghy
> Office: +33 5 56 60 88 02
> Mobile: +33 6 20 83 22 62
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>


--
thanks,
- Jian Liao

Re: cookie in portlet

Posted by Philip Mark Donaghy <ph...@gmail.com>.
Try ((javax.servlet.http.HttpServletResponseWrapper)portletResponse).addCookie()

I'm not sure off the top of my head. Check the javadocs.

Phil

On 2/8/06, mu baosen <mu...@gmail.com> wrote:
> >
> > Thanks for replying.
>
>
>    I can not find the getResponse method in PortletResponse class.How to get
> it?
>
>   Regards,
>   Mubaosen
>
>


--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: cookie in portlet

Posted by mu baosen <mu...@gmail.com>.
>
> Thanks for replying.


   I can not find the getResponse method in PortletResponse class.How to get
it?

  Regards,
  Mubaosen

Re: cookie in portlet

Posted by Philip Mark Donaghy <ph...@gmail.com>.
Hi Mu,

On 2/8/06, mu baosen <mu...@gmail.com> wrote:
> Hello everyone
>
> Can a cookie be added in a portlet?

yes, the servlet sends cookies to the browser by using the
javax.servlet.http.HttpServletResponse.addCookie(javax.servlet.http.Cookie)
method.
The HttpServletResponse object can be obtained by casting the
PortletResponse.getResonse() object to a
(javax.servlet.http.HttpServletResponseWrapper)

>
> Thanks
>
>

Your welcome.

--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org