SDN Controller Programming Guide

175
<init-param>
<param-
name>com.sun.jersey.config.property.resourceConfigClass</param-name>
<param-
value>com.sun.jersey.api.core.ClassNamesResourceConfig</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.classnames</param-
name>
<param-value>
<! Application REST API -->
com.hp.hm.ui.rs.SwitchViewResource
<! Application Error Handlers -->
<!-- Provided Error Handlers -->
com.hp.sdn.rs.misc.DuplicateIdErrorHandler
com.hp.sdn.rs.misc.NotFoundErrorHandler
com.hp.sdn.rs.misc.ServiceNotFoundErrorHandler
com.hp.sdn.rs.misc.IllegalDataHandler
com.hp.sdn.rs.misc.IllegalStateHandler
com.hp.sdn.rs.misc.AuthenticationHandler
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>GUI REST Services</servlet-name>
<url-pattern>/app/rs/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>Token Authentication Filter</filter-name>
<filter-class>com.hp.sdn.rs.misc.TokenAuthFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Token Authentication Filter</filter-name>
<url-pattern>/app/rs/*</url-pattern>
</filter-mapping>
</web-app>
Now update the switches view from Creating Views on page 165 under the “hm-switches.js” listing
to make the remote call as illustrated in the following listing:
hm-switches.js Requesting Data to the Controller:
...
// Create a view with a toolbar button