16

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?

user3531270
  • 169
  • 1
  • 2
  • 6

3 Answers3

5

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.

Community
  • 1
  • 1
avijendr
  • 3,958
  • 2
  • 31
  • 46
  • can you please give names of API's which are similar to ASP.NET Web api for developing REST applications through http services in JAVA? – user3531270 Apr 14 '14 at 10:53
  • Thanks Avigen. Is there any conversion or migration tools available for conversion of controllers and other .net code to Java? – user3531270 Apr 14 '14 at 10:57
  • Probably this answers your question. There isn't any and even if so I wouldn't use, as you may still have to manually verify every line of code. http://stackoverflow.com/questions/78811/is-there-an-effective-tool-to-convert-c-sharp-code-to-java-code – avijendr Apr 14 '14 at 11:01
  • Thanks. can you please give names of API's which are similar to ASP.NET Web api for developing REST applications through http services in JAVA? – user3531270 Apr 14 '14 at 11:18
  • sorry i didn't see. Thanks Avigen – user3531270 Apr 14 '14 at 11:19
  • @user3531270 - I've updated my answer with some of the Java rest apis available – avijendr Apr 14 '14 at 11:23
  • 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? – user3531270 Apr 14 '14 at 14:10
  • Modified my question by adding doubt related to few key areas of webapi like Content negotiation, Flexibility, Separation of concerns. can you please answer how those key areas supported in spring mvc api or jersey api? – user3531270 Apr 14 '14 at 14:28
5

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.

Community
  • 1
  • 1
Julio Rodrigues
  • 3,373
  • 3
  • 24
  • 33
1

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/

Saeed Sharman
  • 765
  • 5
  • 24