Marking requests as Stateless

10 views
Skip to first unread message

David Pollak

unread,
Oct 11, 2010, 11:21:37 AM10/11/10
to liftweb
Folks,

Thanks to an excellent set of sessions at the London Scala Lift Off (extra tip of the hat to Graham), I've coded up some some features into Lift where you can mark certain paths as "stateless".

On stateless paths, if you write to SessionVars or the function table, an exception is generated and in development mode, an error is produced in the browser (it's logged in all other modes).

The code also supports more designer friendly templates (snippets can be invoked via l:s="snippet_name" or lift:s="snippet_name" as attributes, and you can have whole HTML pages but mark them with lift:df="true" in the <html> tag which will cause all the nodes down to the first "surround" invocation to be disposed during actual page render)

There are a few other goodies floating around in the code.

It's sitting on dpp_stateless in the repository.

Thanks,

David

--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Ross Mellgren

unread,
Oct 11, 2010, 11:24:54 AM10/11/10
to lif...@googlegroups.com
On Oct 11, 2010, at 11:21 AM, David Pollak wrote:

Folks,

Thanks to an excellent set of sessions at the London Scala Lift Off (extra tip of the hat to Graham), I've coded up some some features into Lift where you can mark certain paths as "stateless".

On stateless paths, if you write to SessionVars or the function table, an exception is generated and in development mode, an error is produced in the browser (it's logged in all other modes).

The code also supports more designer friendly templates (snippets can be invoked via l:s="snippet_name" or lift:s="snippet_name" as attributes, and you can have whole HTML pages but mark them with lift:df="true" in the <html> tag which will cause all the nodes down to the first "surround" invocation to be disposed during actual page render)

Can we use full names? lift:snippet, lift:designerfriendly (or something else)?

If I encountered lift:s and lift:df I would have no idea what they did but for this thread.

-Ross
 

There are a few other goodies floating around in the code.

It's sitting on dpp_stateless in the repository.

Thanks,

David

--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

David Pollak

unread,
Oct 11, 2010, 11:34:21 PM10/11/10
to lif...@googlegroups.com
On Mon, Oct 11, 2010 at 8:24 AM, Ross Mellgren <dri...@gmail.com> wrote:
On Oct 11, 2010, at 11:21 AM, David Pollak wrote:

Folks,

Thanks to an excellent set of sessions at the London Scala Lift Off (extra tip of the hat to Graham), I've coded up some some features into Lift where you can mark certain paths as "stateless".

On stateless paths, if you write to SessionVars or the function table, an exception is generated and in development mode, an error is produced in the browser (it's logged in all other modes).

The code also supports more designer friendly templates (snippets can be invoked via l:s="snippet_name" or lift:s="snippet_name" as attributes, and you can have whole HTML pages but mark them with lift:df="true" in the <html> tag which will cause all the nodes down to the first "surround" invocation to be disposed during actual page render)

Can we use full names? lift:snippet, lift:designerfriendly (or something else)?

lift:snippet is already used for attribute snippets, so we can't use it.  I'm all for other names.
 
Reply all
Reply to author
Forward
0 new messages