Tim, Ahh...
I see what you mean. Just bypass lift altogether. Now you see why I'm just a novice lifter. I suppose the same applies to retrieving data from external sources (other than a db connection)? Thanks. Glenn... On May 5, 10:13 am, David Pollak <feeder.of.the.be...@gmail.com> wrote: > On Tue, May 5, 2009 at 9:43 AM, glenn <gl...@exmbly.com> wrote: > > > Tim, > > > I'm not sure what you mean by "programatic POST" or "post to the 3rd > > part...", > > but it seems a simple, yet necessary use-case to be able to post to > > any available > > URL and receive a response within the lift framework. > > If you're going to do a POST on an external resource, you can form the valid > XHTML to post to that resource: > > <form method="post" action="http://myservice.com"> > ... form body here > </form> > > In this scenario, you're posting to an external server. Why would you > expect something to come back to your Lift app? The HTTP request is being > made on an external service. > > > > > Particularly if > > one is doing mashups, getting > > and storing data, RSS and Atom feeds, etc., it shouldn't be > > extroardinary, yet I find no documentation, > > or at least no coherent documentation, on how exactly to do that. > > > I think you are suggesting that I should post to a lift snippet that > > wraps the HTTP request stuff, using plain > > old Java EE, is that right? But why should that be necessary? If I > > wanted to write Java EE servlets, I'd do it > > from the beginning and not use lift at all. > > > By the way,I thought lift already wraps HttpServlet. Aren't there some > > method calls I can use to do the job? > > > Glenn... > > > On May 5, 5:45 am, Timothy Perrett <timo...@getintheloop.eu> wrote: > > > Glenn, > > > > If you are posting to an external URL im not sure there is a good case > > > for using bind(...) as that binds served HTML with a server side > > > function to be executed upon form submission. If you want to post > > > directly to another URL that is not managed by lift, there is little > > > point executing something on the lift side of things right? > > > > Alterntivly, if you want the post to the 3rd part to be transparent, > > > you could do a programatic POST using Apache HTTP lib or something so > > > that its transparent to the user. Is this the functionality you > > > desire? > > > > Cheers, Tim > > > > On May 5, 7:15 am, glenn <gl...@exmbly.com> wrote: > > > > > This may be a dumb question from a lift novice, but here goes... > > > > I want to post a form to an external url for processing. Specifically, > > > > I have in mind inserting a node into an Apache Sling instance (JCR). > > > > > I have a form like so: > > > > > <lift:Sling.add form="POST" action="http://admin:ad...@localhost:8888/ > > > > content/first"> > > > > <entry:title/><entry:text/><br/> > > > > <entry:submit/> > > > > </lift:Sling.add> > > > > > and a snippet: > > > > > class Sling { > > > > object title extends RequestVar("") > > > > object text extends RequestVar("") > > > > > def add(xhtml:NodeSeq):NodeSeq = { > > > > def processEntryAdd() = {println("You entered: " + title.is + " > > > > = " + text.is)} > > > > > bind("entry", xhtml, > > > > "title" -> SHtml.text(title.is, title(_)), > > > > "text" -> SHtml.text(text.is, text(_)), > > > > "submit" -> SHtml.submit("Submit", processEntryAdd)) > > > > > } > > > > > } > > > > > Of course, lift removes the action attribute on the form, substituting > > > > just "/" for the url. > > > > > Does this call for a custom dispatch function? If so, what would it > > > > look like. I understand the path part is just > > > > a list, but what about the context-path and how would I set that up? > > > > > Glenn Silverman > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---