<%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> Test Interceptor

An Interceptor Sample

Test Section One

<% String intcpt1 = String.valueOf(request.getAttribute("Intcpt1IsValid")); intcpt1 = (intcpt1.equals("null")||intcpt1.length()<=0) ? "uncheck" : intcpt1; request.setAttribute("Intcpt1IsValid", null); request.removeAttribute("Intcpt1IsValid"); String intcpt2 = String.valueOf(request.getAttribute("Intcpt2IsValid")); intcpt2 = (intcpt2.equals("null")||intcpt1.length()<=0) ? "uncheck" : intcpt2; request.setAttribute("Intcpt2IsValid", null); request.removeAttribute("Intcpt2IsValid"); String date1 = String.valueOf(request.getAttribute("date1")); date1 = (date1.equals("null")||date1.length()<=0) ? "uncheck" : date1; request.setAttribute("date1", null); request.removeAttribute("date1"); String date2 = String.valueOf(request.getAttribute("date2")); date2 = (date2.equals("null")||date2.length()<=0) ? "uncheck" : date2; request.setAttribute("date2", null); request.removeAttribute("date2"); String sysmi1 = String.valueOf(request.getAttribute("sysmi1")); sysmi1 = (sysmi1.equals("null")||sysmi1.length()<=0) ? "uncheck" : sysmi1; request.setAttribute("sysmi1", null); request.removeAttribute("sysmi1"); String sysmi2 = String.valueOf(request.getAttribute("sysmi2")); sysmi2 = (sysmi2.equals("null")||sysmi2.length()<=0) ? "uncheck" : sysmi2; request.setAttribute("sysmi2", null); request.removeAttribute("sysmi2"); %>

Input Operation
Interceptor 1 Time 1 SystemTimeMillis 1
<%=intcpt1 %> <%=date1%> <%=sysmi1%>
Interceptor 2 Time 2 SystemTimeMillis 2
<%=intcpt2 %> <%=date2%> <%=sysmi2%>

Test Section Two

Click here to check @AroundTimeout


Test Section Three

Click here to check @Interceptor, @InterceptorBinding


1.This example checks the input value in Section One.
   Interceptor 1 says valid & Interceptor 2 says invalid if the value is greater than or equal zero.
   Interceptor 1 says invalid & Interceptor 2 says valid if the value is less than zero.
2.This example also present the invoking sequence of the interceptors.
   It should firstly invoke Interceptor 1 and Interceptor 2 happens afterwards.
   You can check the invoking sequence through Time and SystemTimeMillis.
3.This example presents the @AroundTimeout annotation in interceptor-1.1 in Section Two.
4.This example presents the @Interceptor and @InterceptorBinding annotation in interceptor-1.1 in Section Three.