-1

I have java web application which is already developed.

The framework is JSP, Spring, hibernate.

the database is MySQL.

Now for application, I want to create rest services so I can give it to the Android developer.

Can anybody help me how to create rest web services for this?

fool-dev
  • 7,671
  • 9
  • 40
  • 54
Sejal Rudani
  • 372
  • 4
  • 19

3 Answers3

0

Possible duplicate of Calling REST API from an android app

Added with the above url: You need to write rest services in server side so you can handle the rest calls from android app. From restful you can call the business logic. If the business logic in Spring framework itself, better to separate the business logic and you can call from Spring as well from Restful. There is another way to handle it if possible for you. From JSP as well you can call server side through restful so both endpoint will be restful for this case.

Arindam
  • 555
  • 1
  • 8
  • 24
0

Your all code (business logic) is already there is your web application classes. You will copy paste same code in webmethod that are now exposed as webservice.

You can create different project for webservice or you can convert the same project. You have to add depedency fir rest and little changes in that..

Better you create new project with springboot and reuse that code in this..

In webservice except html or jsp you will return json. You just return class configuration will convert it to json. Uf u configured the things

om sharma
  • 311
  • 1
  • 4
  • 8
0

Your all code (business logic) is already there is your web application classes. You will copy paste same code in webmethod that are now exposed as webservice.

You can create different project for webservice or you can convert the same project. You have to add dependency for rest and little changes in that..

Better you create new project with springboot and reuse that code in this..

In webservice except html or jsp you will return json and some annotation will change. that you can check how write basic rest service. Use of spring boot will be easy and fast.

om sharma
  • 311
  • 1
  • 4
  • 8