I am not able to redirect to html page with data in jersey . Below is the code
@POST
@Path("/vendorAuthentication")
@Consumes({MediaType.APPLICATION_JSON})
@Produces("application/json")
public Response vendorAuthentication(final VendorAuthenticationRequest vendorAuthenticationRequest) {
if(isVendorAuthenticated == true)
{
Map<String, Object> map = new HashMap<String, Object>();
map.put("vendorId", "V111");
map.put("vendorName","XXX")
return Response.ok(new Viewable("/page2", map)).build();
}
}
After successful authentication of vendor, url should redirected to page2 with some data.But its not happening.Also I checked the brower(Mozilla Firefox) for debugging, in browser it shows the code of next(i.e. page2) page code.But it will not redirect to page2.
Below is my web.xml
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.abc.rest</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
<param-value>/WEB-INF/jsp</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/(WEB-INF/jsp)/.*</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<welcome-file-list>
<welcome-file>/WEB-INF/jsp/Login.jsp</welcome-file>
</welcome-file-list>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>