2

I have an JSF web application that needs to get some information from a native android app.

I've read about creating HTTP requests in android, and I think I can figure it out, but I have no clue on what to do on the JSF side of things. Do I create a new page, bean or what? Is http requests even the proper way to go?

I simply want to send a string from the Android app, to the JSF web app and store it in a bean somewhere. Any help would be greatly appreciated thanks!

Additional info Using Android API 16 JBoss Server 7.1 Eclipse JSF

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
SikhWarrior
  • 1,037
  • 5
  • 17
  • 34
  • I don't know how to do this with plain JSF, but IMO you could create a Servlet to process your HTTP request. – Luiggi Mendoza Oct 13 '12 at 02:54
  • Based on [this question](http://stackoverflow.com/q/3302933/1065197), the best approach for your case should be creating a raw Servlet or maybe a Filter, IMO I would use a Servlet. – Luiggi Mendoza Oct 13 '12 at 02:58
  • Thanks for the responses, I have no idea what a servlet is, so how exactly would I go about doing this? Is there some examples that you can point me to? I have my JSF app in eclipse at the moment, is there a certain file I create, or do I write something inside a web page? – SikhWarrior Oct 13 '12 at 03:07
  • Check the basic info for Servlets in [our wiki](http://stackoverflow.com/tags/servlets/info) – Luiggi Mendoza Oct 13 '12 at 03:12

1 Answers1

2

JSF is a component based MVC framework for HTML form based applications. What you're concretely asking is more a job for a web service, not a HTML form controller. JSF is not a web service framework and is hence the wrong tool for the job. You're better off using JAX-WS (SOAP) or JAX-RS (RESTful) or maybe even "plain vanilla" servlet.

Then, to let your JSF web application share the same data, just use the same data store (DB).

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555