Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent to ASP.NET WEB API in JAVA world?

Tags:

java

asp.net

I've been a .NET web developer for several years now, working with asp.net web forms and c#, wcf etc.But recently developed touch enabled customer facing application. Its device-agnostic application designed for any platform capable of running HTML5 applications (iOS, Android, Windows8), for Mobile devices (such as tablets), Assisted or unassisted kiosks, Laptop or desktop computers.

we used asp.net webapi, ASP.net MVC 4.0 framework, Jquery mobile libraries, HTML 5, signal R for development.

Is it possible for us to migrate or convert complete server side code(i.e controllers methods) under Java?

Does Apache tomcat server or (webspehere) supports verbs like PUT, DELETE inaddition to GET and POST?

Any thing available in Java world which is equivalent ASP.NET SignalR functionality?

what are the required softwares or libraries for developing device aganostic touch enabled applications in java?

I think Web API objectively wins out over other APIs in below few key areas.

Content negotiation, Flexibility, Separation of concerns

How much extent Spring MVC API or Jersey API will support the above areas?

like image 395
user3531270 Avatar asked Apr 14 '14 10:04

user3531270


People also ask

What is the equivalent of ASP.NET in Java?

Java Server pages (JSP) are the Java world's equivalent of ASP, and a great way to build server-side web sites and applications in the Java ecosystem.

What is Web API in Java?

What is Web API? API stands for Application Programming Interface. A Web API is an application programming interface for the Web. A Browser API can extend the functionality of a web browser. A Server API can extend the functionality of a web server.

Can you use ASP.NET with Java?

This example shows how Java classes can easily be used in an ASP.NET application through use of a Java/. NET bridge. The bridge allows the Java classes to be called directly from the ASP.NET code through proxies; to interact with a Java object, access the corresponding proxy object in exactly the same way.

Is Web API and MVC same?

There are many differences between MVC and Web API, including: We can use the MVC for developing the Web application that replies as both data and views but the Web API is used for generating the HTTP services that replies only as data.


3 Answers

Is it possible for us to migrate or convert complete server side code(i.e controllers methods) under Java?

You could, but it's not very easy as there is not direct mapping apis, but there are similar apis which you could use. There are lots of people who have done it

Does Apache tomcat server or (webspehere) supports verbs like PUT, DELETE inaddition to GET and POST?

Yes all HTTP commands can be enabled/disabled in Tomcat or any JEE compliant App servers

Any thing available in Java world which is equivalent ASP.NET SignalR functionality?

DWR (Direct Web Remoting), Vaadin, GWT etc. But I am sure there are more.

What are the required softwares or libraries for developing device aganostic touch enabled applications in java?

JavaMe, Android, GWT-Touch etc. Also this link might help you.

Java rest Apis

  1. Apache CXF, an open source Web service framework.
  2. Jersey, the reference implementation from Sun (now Oracle).
  3. RESTeasy, JBoss's implementation.
  4. Apache Wink, Apache Software Foundation Incubator project, the server module implements JAX-RS.
  5. Apache Tuscany (http://tuscany.apache.org/documentation-2x/sca-java-bindingrest.html)

Hope this helps.

like image 167
Aneesh Vijendran Avatar answered Oct 19 '22 23:10

Aneesh Vijendran


Jersey (jax-rs) is a very solid alternative to ASP.NET Web API in the Java World.

Jersey RESTful Web Services framework is open source, production quality, framework for developing RESTful Web Services in Java...

It's an annotation based approach to the problem. I think it's a very well thought and productive environment. You can customize all sorts of stuff and that contains sane defaults.

like image 42
Julio Rodrigues Avatar answered Oct 20 '22 00:10

Julio Rodrigues


The answer is yes you can create restful web service in Java with spring framework. Here is and example of how code looks

import java.util.concurrent.atomic.AtomicLong;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GreetingController {

private static final String template = "Hello, %s!";
private final AtomicLong counter = new AtomicLong();

@RequestMapping("/greeting")
public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
    return new Greeting(counter.incrementAndGet(),
                        String.format(template, name));
}

}

Link : http://spring.io/guides/gs/rest-service/

like image 44
Saeed Sharman Avatar answered Oct 20 '22 01:10

Saeed Sharman