0

Am using Jersey for REST application,

In my case most of the rest calls in server1 are just act as like proxy. for ex,

/rest/codes

/rest/suppliers

/rest/items

All the above calls are directly connected to server2 and sends back the responses.

A particular calls ie./rest/txn/update are processed in server1 before sending it to server2

So am looking for a common method which receives multiple paths for the above case.

@Path("rest")
public class UIALoginREST {
    @Path("codes | suppliers | items")
    public String connectServerr2(){
      //method content
    }
}

Please suggest an idea to do it.

Community
  • 1
  • 1
Nat4j
  • 453
  • 2
  • 7
  • 19

1 Answers1

0

The best practices says that you if can implement a restfull interface you can do it.

Try to make it for better code understanding.

A possible solution for your problem is to make 3 methods with 3 different paths and all methods calls a fourth method named connectServerr2()

João Marcos
  • 3,872
  • 1
  • 19
  • 14