incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reto Bachmann-Gmuer <reto.bachm...@trialox.org>
Subject Re: Scala Page and Cookies
Date Tue, 18 Jan 2011 10:16:25 GMT
before I activated some keyboard shortcut I didn't know about...

On Tue, Jan 18, 2011 at 10:02 AM, Oliver Strässer <
oliver.straesser@getunik.com> wrote:

> nobody an idea?
> i need the cookies to prefille my form, after I validate the form
> serverside.
>
>
> perhaps it's an architecture question of my application or a generall
> question.
>
> I'd like to save "session"-like data on a specific place, which is conform
> with the rest approach.
> so I don't want so safe the form data in a user graph.
>
>
> so the question is:
> how you build systems like
>
> - a shop basket? (not logged in)
>
I see the following options:
- Client-side: You never actually change page, in the browser an ajax
application let you navigate through the shop but you never actually leave
the page with this application, with this you can keep variables in js while
retrieving new content with background-requests
- Cookies: If the user is not logged in you cannot associate the data to the
context-node (via UserContextProvider) but you can still read and set the
cookie in your root resources or typehandlers and add the contents of the
shopping basket to the returned resource


> - validate forms and prefille the form (not logged in)
>
- I don't see the connection between cookies and validation, validation is
ideally done both client-side and server-side.
- As for preventing the user from repeatedly entering the phone-number in
multiple forms asking for it, I see that reading cookies from ssp might be a
more straight-forward way than adding the infromation to the
response-resource. Alternatively this values could be read from cookies
using javascript.


> - collect data over a few sites (a process with a few steps) (not logged
> in)
>
- Cookies can be used but there's no need to set or read them in the ssp.
Alternatively the data entered in previous steps cen be contained as hidden
form fields in the current page



> -  create a questionnaire or a quiz over a few sites (not logged in)
>
- Same as above

how you save and retrieve the data in a secure way and in a rest conform
> way?
>
as long as you don't create a session on the server, but have the client
deal with data (either using cookies, hidden fields of javascript) you're on
the RESTfull side.


Cheers,
reto

>
>
>
> cheers
> oli
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Oliver Strässer
> Gesendet: Mittwoch, 12. Januar 2011 17:58
> An: clerezza-dev@incubator.apache.org
> Betreff: AW: Scala Page and Cookies
>
> Hi tsuy
>
> i tried your approach today.
> I retrieve from the RequestProperties. getHttpHeaders method only a
> MultivaluedMap.
> So I havn't access to the cookies.
>
> Isn't the a way to access the javax.ws.rs.core.HttpHeaders object in ssp?
>
>
> oli
>
>
> -----Ursprüngliche Nachricht-----
> Von: Tsuyoshi Ito [mailto:tsuy.ito@trialox.org]
> Gesendet: Donnerstag, 23. Dezember 2010 18:08
> An: clerezza-dev@incubator.apache.org
> Betreff: Re: Scala Page and Cookies
>
> Hi Oli
>
> There is the possibility to retrieve some of the header information
> from requestProperties (an inner class in
> org.apache.clerezza.platform.typerendering.Renderlet)
>
> e.g. you can use requestProperties.getHttpHeaders in your ssp
>
> But I haven't used it yet. So I am not sure if it is possible to set
> or read cookies - also I am not sure if this task should be done in
> ssp.
>
> Cheers
> Tsuy
>
> 2010/12/23 Oliver Strässer <oliver.straesser@getunik.com>:
> > some ideas?
> >
> > Von: Oliver Strässer
> > Gesendet: Mittwoch, 22. Dezember 2010 09:29
> > An: clerezza-dev@incubator.apache.org
> > Betreff: Scala Page and Cookies
> >
> > Hi
> >
> > I need to write and read Cookies, while I render the  scala server page.
> > Is there a posibility to retrieve the request object and the response
> bject in scala?
> >
> > cheers
> > oli
> >
> >
> >
> >
> > --[cid:image001.png@01CBA1BA.ADAA76D0]<http://twitter.com/getunik
> >-[cid:image002.png@01CBA1BA.ADAA76D0]<
> http://www.facebook.com/pages/getunikcom/124320320041
> >----------------------------------------------
> >
> > --getunik ag-------------------------------------------
> >
> >  oliver straesser              oliver.straesser@getunik.com<mailto:
> oliver.straesser@getunik.com>
> >  hardturmstrasse 101    fon: +41 (0)44 388 55 88
> >  ch-8005 zuerich              fax: +41 (0)44 388 55 89
> >
> >   --aktuelles getunik projekt-------------------------
> >   Agieren Sie lokal! Geo Marketing für Ihre E-Mail Kampagne:
> www.geomarketing.com<http://www.geomarketing.com/>
> >
> >  --best of swiss web awards 2009------------------
> >   Gold & Silber für Connect2Earth / Bronze für WWF UK
> >
> > we make the web a better place - www.getunik.com<http://www.getunik.com/
> >
> >
> >
> >
> >
> > *****************************************************************
> > P Bitte drucken Sie dieses E-Mail nur bei Bedarf aus. Die Umwelt dankt es
> Ihnen.
> > *****************************************************************
> >
> >
>
>
>
> --
> --trialox ag--------------------------------------
>
> Tsuyoshi Ito
> Binzmuehlestrasse 14
> CH-8050 Zürich
> Tel. +41 44 635 75 77
> URL: http://trialox.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message