As per David's remarks, no framework, Lift included, can grab something that you post to a 3rd party server... Its just not going to your server to be able to handle it; its going to the 3rd party! Is there a special reason you thought that lift does this?
My suggestion about the programmatic POST would be your only option if you wanted to deal with this 100% within *your* lift app - its not overly difficult to implement (checkout the paypal stuff as it does something similar for PDT transaction handling). Cheers, Tim On 05/05/2009 18:13, "David Pollak" <[email protected]> wrote: > > > On Tue, May 5, 2009 at 9:43 AM, glenn <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 >>>> <http://title.is> + " >>>> = " + text.is <http://text.is> )} >>> >>>> bind("entry", xhtml, >>>> "title" -> SHtml.text(title.is <http://title.is> , title(_)), >>>> "text" -> SHtml.text(text.is <http://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 >> >> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
