首页>代码>spring mvc+spring整合cxf服务端和客户端之间访问(jaxws与jaxrs的使用)>/WebServiceDemoAndSpringMVC/src/main/java/com/jbw/intercepter/AuthInterceptor.java
package com.jbw.intercepter; import java.util.logging.Logger; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.common.util.StringUtils; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.Message; import org.apache.cxf.message.XMLMessage; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; public class AuthInterceptor extends AbstractPhaseInterceptor<Message> { private static final Logger logger = LogUtils.getLogger(AuthInterceptor.class); public AuthInterceptor() { super(Phase.RECEIVE); } public void handleMessage(Message message) throws Fault { String method=getMethod(message); logger.info("访问的远程接口的方法名:"+method); } @Override public void handleFault(Message message) { super.handleFault(message); } private String getMethod(Message message) { String requestUri = (String) message.get(XMLMessage.REQUEST_URI); String[] methods = StringUtils.split(requestUri, "/"); return methods != null && methods.length > 0 ? methods[methods.length - 1] : ""; } }

liweiyishuo LV3
2021年12月2日
miaozhenyu LV2
2020年4月9日
eddxbb LV3
2019年9月9日
wsupsup LV16
2019年8月12日
wbbhappy LV13
2019年2月21日
zhu6272051 LV1
2019年2月20日
jywdream LV11
2019年2月13日
x646936674 LV10
2018年10月20日
67806686 LV1
2018年7月20日
ccccjb LV3
2018年6月8日