0

I am new in JSF and I am starting an application with se following architecture:

  • JSF Server
  • Android Client

Some functionalities will be common in Android and JSF (web pages), only the interface will change.

I know how to communicate an Android client with a servlet, but I don't know how to do it with a JSF server. I have searched a lot in web, but nothing was found.

Can someone help me?

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Paulo Roberto
  • 29
  • 1
  • 5

1 Answers1

1

JSF is a framework that deals with UI generation (HTML). It is not a "server", but a tool that you can use in a server and that many server offer with its default instalation. In fact, it works on top of servlets.

Given that is HTML, its use would make sense only when you are using an HTML client (web browser). If you are using an android app, you will be better off using messaging frameworks (v.g., SOAP and WS, or directly servlets. You can use bare servlets together with JSF just by mapping the servlets to URLs that do not collide with the JSF ones (if you recall JSF configuration, what you tell the webserver is which URLs will be served by the JSF servlet).

SJuan76
  • 24,532
  • 6
  • 47
  • 87
  • Or even better, create RESTful services using JAX-RS. And yes, JSF has *nothing* to do with your client-server communication. – Luiggi Mendoza Sep 09 '13 at 15:32
  • More info: [What is the difference between JSF, Servlet and JSP?](http://stackoverflow.com/q/2095397/1065197) – Luiggi Mendoza Sep 09 '13 at 15:33
  • Is a good practice to use bare servlets together JSF? If not, can you recommend me some frameworks that can process web pages and Android client (but with only one business model layer on server side). Thanks. – Paulo Roberto Sep 09 '13 at 15:44
  • If it is something simple, then you could go with a few servlets together with the JSF webapp. If it gets complicated (specially if you begin using WS and the like), I would go with deploying the messaging layer in a different WAR than the JSF one. – SJuan76 Sep 09 '13 at 16:08