Page 1 of 1

Queries About REST

Posted: Mon Apr 08, 2013 12:01 am
by ANITHA
Hi all.

i have many queries regarding REST tutorial!!!

Whether the demosite application ie heat clinic has already implemented RESTful web service or the services are of different style!!!?
if not how to implement REST sercice for the same application?

pls reply for my queries ASAP!
tHANKS

Re: Queries About REST

Posted: Mon Apr 08, 2013 10:24 am
by phillipuniverse
No, the Heat Clinic application does not have the REST services already implemented. You should be able to follow the REST tutorial from our docs (http://docs.broadleafcommerce.org/curre ... rials.html) to plug it into the Heat Clinic/your application.

Re: Queries About REST

Posted: Wed Apr 10, 2013 1:14 am
by ANITHA
but some jersey jars available know. what are those?why we need it? Can u help in pluging REST services into heatclinic demo application?
Give me detailed steps in your own words pls

Re: Queries About REST

Posted: Wed Apr 10, 2013 1:40 am
by ANITHA
In order to plug default broadleaf's rest services into heat clinic application i'm following tutorial

http://docs.broadleafcommerce.org/curre ... rials.html
ive the following queries . pls help me out
1)
<servlet>
<servlet-name>JerseyServlet</servlet-name>
<servlet-class>
com.sun.jersey.spi.spring.container.servlet.SpringServlet
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>JerseyServlet</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
where should i add this servlet mapping section. pls give me exact path. whether in admin or site's web.xml


2)
<context:component-scan base-package="org.broadleafcommerce.core.web.api"/> in which application context should we add this?

Re: Queries About REST

Posted: Wed Apr 10, 2013 10:03 am
by phillipuniverse
You probably want that servlet to be in site/web.xml.

The component scan should go in any of the applicationContext's in your patchConfigLocations. This is pointed out in the docs:

This component scan needs to be in one of the application contexts referenced in the patchConfigLocations parameter in your web.xml. You will run into problems if you instead put this scan into your applicationContext-servlet.xml.


For instance, you could put this is site/src/main/webapp/WEB-INF/applicationContext.xml.