views:

63

answers:

2

Hello!

I want to realize the following scenario: The frontend is based on HTML5 / CSS3 / JavaScript (with a JavaScript framework like ExtJS or jQuery). I have full HTML pages with forms, buttons, text fields, which have submit buttons which should send the data to the webserver. On the other hand I also have a website in this web application which get/send the data via a JSON webservice.

The backend should be realized with Java EE (MySQL database, Hibernate as ORM, ...). But which basic technology should I use? JavaServer Faces? Or JavaServer Pages? What is the best method to handle JSON and HTTP GET/POST requests?

Thank you in advance & Best Regards.

A: 
  • Spring MVC has a very good support for rendering JSON responses and REST-like URLs. So you can use it for both your standard views and your JSON responses.
  • RESTEasy is a REST framework by JBoss. With it you can use anything - JSF, Wicket, etc.

Be careful not to duplicate code. Whatever solution you choose, move the code into services, and consume them from the json and regular response renderers.

Bozho
Thank you for your response. I will need normal webpages .../page1.html, .../page2.html with forms. And one page3.html has to communicate (update and get data) via JSON. So this is possible with Spring MVC? What do I need: Tomcat, Java EE, Spring + the MVC extension, what else? What are the alternatives? Couldn't I take JSF/JSP? I am a normal Java SE programmer, this is my first EE project.
Tim
Bozho
Okay, thanks a lot!
Tim
+1  A: 

Take a look at Play Framework, which has excellent JSON support, built-in JPA support and jQuery included.

Nils Weinander