Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use JAX-RS as a web framework?

Tags:

java

rest

jax-rs

I've been looking into JAX-RS lately because I really like the Java platform and a RESTful style of web development. I've read a lot about using JAX-RS for creating RESTful Web Services, but is it possible to use JAX-RS to create RESTful web sites? I guess more specifically, is it possible to use JAX-RS as a controller (to retrieve required data from the server) and then forward control to a view engine to render the appropriate HTML?

I've been googling around but haven't found any resources that show you how to do this.

Thanks for any insight/help.

like image 254
Brian DiCasa Avatar asked Jul 14 '10 00:07

Brian DiCasa


People also ask

Is JAX-RS a framework?

JAX-RS is only a specification and it needs a compatible implementation to be used. On the other hand, Spring MVC is a complete framework with REST capabilities. Like JAX-RS, it also provides us with useful annotations to abstract from low-level details.

Is JAX-RS a web services technology?

JAX-RS is a JAVA based programming language API and specification to provide support for created RESTful Web Services. Its 2.0 version was released on the 24th May 2013. JAX-RS uses annotations available from Java SE 5 to simplify the development of JAVA based web services creation and deployment.

What is the purpose of using JAX-RS?

JAX-RS also provides annotations that allow you to use different methods depending on the media types of the request and response. The media type of the request body ( Content-Type header) is compared to the value(s) of @Consumes annotations.

Is JAX-WS is the API for REST?

JAX-WS is a fundamental technology for developing SOAP (Simple Object Access Protocol) and RESTful (Web services that use representational state transfer, or REST, tools) Java Web services, where JAX-WS is designed to take the place of the JAVA-RPC (Remote Procedure Call) interface in Web services and Web-based ...


1 Answers

I think you are having difficulty with your google searches because not many people are doing this. JAX-RS was designed for web services, so developers don't think of using it as a controller for web applications. However, there is no reason it wouldn't work.

Check out this blog post: JAX-RS as the one Java web framework to rule them all?

I think it's exactly the kind of thing you are looking for.

like image 145
dbyrne Avatar answered Oct 12 '22 11:10

dbyrne