我无法使用球衣中的数据重定向到html页面。 以下是代码
@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();
}
}
在成功验证供应商之后,url应该重定向到带有一些数据的page2。但它没有发生。我也检查了浏览器(Mozilla Firefox)进行调试,在浏览器中它显示了下一个(即page2)页面代码的代码。但它不会重定向到第2页。
下面是我的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>