Hi Thusitha, Yes. It can be done like that too. I sent that PR thinking that it would be much simpler to have a way to set the application base common context URI, rather than using sub resources. So it would apply to the router(main resource) classes too.
Thanks. On Tue, Oct 4, 2016 at 3:12 PM, Thusitha Thilina Dayaratne < [email protected]> wrote: > hi Lakshan, > > If I understood your requirement correct, you should be able to get it > done via sub resources. > > e.g. > You can define a base resource with a base path and use that resource > class as the router for other resources (sub resources) > > @Path("/service/v1/company) > class CompanyRouter { > @Path("/finance) > public Finance getFinance() { > ... > return new Finance(); > } > > > @Path("/engineering) > public Engineering getFinance() { > ... > return new Engineering(); > } > .... > } > > @Path("/") > class Engineering { > @Path("/getEngineer/{empId}) > @GET > public String getEngineer(@PathParam("empId")String empId) { > ... > return ...; > } > } > > Thanks > Thusitha > > On Mon, Oct 3, 2016 at 11:14 AM, Lakshan Gamage <[email protected]> wrote: > >> Hi Sagara, >> >> Thanks for the information. >> I will try to do that. >> >> Thanks. >> >> On Mon, Oct 3, 2016 at 11:08 AM, Sagara Gunathunga <[email protected]> >> wrote: >> >>> >>> Hi Lakshan, >>> >>> On Mon, Oct 3, 2016 at 9:22 AM, Lakshan Gamage <[email protected]> wrote: >>> >>>> Hi Sagara, >>>> >>>> Yes. I am using sub resources. But I wanted to know whether I can have >>>> a base URI across several resource Classes for the whole application. >>>> >>> >>> ATM we don't have this feature but +1 to implement. >>> >>> Why don't you try to implement this feature and send a PR ? >>> >>> Thanks ! >>> >>> >>>> >>>> Thanks. >>>> >>>> On Mon, Oct 3, 2016 at 8:53 AM, Sagara Gunathunga <[email protected]> >>>> wrote: >>>> >>>>> >>>>> >>>>> On Mon, Oct 3, 2016 at 7:54 AM, Lakshan Gamage <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> Is there a way which I can set an application base URI to msf4j >>>>>> services? For example, http://localhost:8080/baseUri/resources. >>>>>> @ApplicationPath annotation is not supported, right? >>>>>> >>>>> >>>>> Can't you use sub-resources for your use case ? >>>>> https://github.com/wso2/msf4j/blob/master/samples/subresourc >>>>> e/src/main/java/org/wso2/msf4j/example/Country.java >>>>> >>>>> Thanks ! >>>>> >>>>>> >>>>>> Thanks. >>>>>> -- >>>>>> >>>>>> *Lakshan Gamage*Software Engineering Intern >>>>>> WSO2 Inc.; http://wso2.com >>>>>> >>>>>> *E-mail: [email protected] <[email protected]>* >>>>>> *Mobile: +94773472649 <%2B94773472649>*Lean . Enterprise . Middleware >>>>>> <http://wso2.com/signature> >>>>>> >>>>>> _______________________________________________ >>>>>> Dev mailing list >>>>>> [email protected] >>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Sagara Gunathunga >>>>> >>>>> Associate Director / Architect; WSO2, Inc.; http://wso2.com >>>>> V.P Apache Web Services; http://ws.apache.org/ >>>>> Linkedin; http://www.linkedin.com/in/ssagara >>>>> Blog ; http://ssagara.blogspot.com >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> *Lakshan Gamage*Software Engineering Intern >>>> WSO2 Inc.; http://wso2.com >>>> >>>> *E-mail: [email protected] <[email protected]>* >>>> *Mobile: +94773472649 <%2B94773472649>*Lean . Enterprise . Middleware >>>> <http://wso2.com/signature> >>>> >>> >>> >>> >>> -- >>> Sagara Gunathunga >>> >>> Associate Director / Architect; WSO2, Inc.; http://wso2.com >>> V.P Apache Web Services; http://ws.apache.org/ >>> Linkedin; http://www.linkedin.com/in/ssagara >>> Blog ; http://ssagara.blogspot.com >>> >>> >> >> >> -- >> >> *Lakshan Gamage*Software Engineering Intern >> WSO2 Inc.; http://wso2.com >> >> *E-mail: [email protected] <[email protected]>* >> *Mobile: +94773472649 <%2B94773472649>*Lean . Enterprise . Middleware >> <http://wso2.com/signature> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Thusitha Dayaratne > Software Engineer > WSO2 Inc. - lean . enterprise . middleware | wso2.com > > Mobile +94712756809 > Blog alokayasoya.blogspot.com > About http://about.me/thusithathilina > <http://wso2.com/signature> > > -- *Lakshan Gamage*Software Engineering Intern WSO2 Inc.; http://wso2.com *E-mail: [email protected] <[email protected]>* *Mobile: +94773472649*Lean . Enterprise . Middleware <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
