
Liferay默认提供两种接口,基于axis的webserivce,访问地址为:http:/xxx/api/axis 基于jsonws的访问地址为:http://xxx/api/jsonws。 但是这两种接口在外部分访问的时候都是需要认证的,本篇文章介绍如何对jsonws的接口进行认证访问。 基于Java的认证 示意代码如下: String pathUrl = "http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/20198"; URL url = new URL(pathUrl); HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); String userName = "test@lifer...



