SpringFramework
SpringFramework

Reputation: 86

I want to deploy a simple rest API to webspphere application server

I have not worked on websphere aplication server, i have a simple rest api i want to deploy that to websphere application server.

need to know the detailed configuration of the websphere application server from scratch

want to understand how the websphere application server works, what are the ports number that are configured, how to access the logs if i am having any issues with the code of starting up the server.

Upvotes: 0

Views: 1974

Answers (1)

Gas
Gas

Reputation: 18050

Kind of broad question. WebSphere dosn't have anything special here. Just use standard Java EE rest apis, dont use Spring as it doesnt bring any additional value.

So simplified steps:

  • Create class with @ApplicationPath("/api")
  • Create service class with @Path("/hello")
  • implement methods e.g.

    @GET @Produces(MediaType.TEXT_PLAIN) public String getHello() { return "Hello from rest "; }

  • package as war

  • install on server (if on tWAS via admin console, if on WebSphere Liberty put to dropins)
  • access via http://localhost:9080/warfileName/api/hello (assuming default installation ports)

Upvotes: 1

Related Questions