I would like to post to a form given an URL how do I do this in jsf What we actually want to do is post from smart phones to an URL
and get back a response from it...
i.e http://www.myform.com is some kinda servlet and I post to this
Joined: May 16, 2004
I am really banging my head over this we are developing an application using JSF and I would like to be able to POST to a specific url and on POST I want to invoke a action method
How do I do that in JSF i.e no command button or command link we just want to do http://blablabla.com/app/handle.iface and post to that url somehow and then trigger an action
I could normally do http://blablabla.com/app?action=doStuff and it would trigger doStuff method how do I do it using a url in jsf
No you wouldn't. That behavior is something that a special Struts action processor does, and in fact, I stopped using Struts before it even became available. I think it came in with Struts 1.2. One reason I don't do Struts anymore was because of awkward constructs like that.
JSF is based on presenting a View with a Form in it and posting back the Form data, repeating until the action process indicated that a different View was needed. Handling raw GET/POST requests isn't what JSF is all about. However, you can mix servlets, raw JSPs and even Struts actions with JSF if you need to, and they would process POST requests in the normal way.
There are also 2 alternatives within JSF. One is to get the HttpRequest object from the internal JSF context and extract the data by brute force. I don't really recommend this, as it detracts from the portability and testability of the JSF backing beans. Another is to use the PrettyFaces add-on for JSF, but I think that that only works on GET requests.
An IDE is no substitute for an Intelligent Developer.