com.javajy.api.c.a Maven / Gradle / Ivy
The newest version!
package com.javajy.api.c;
import com.javajy.api.component.CacheManager;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class a {
public a() {
}
public void a(ServletRequest var1, ServletResponse var2, FilterChain var3) throws IOException, ServletException {
HttpServletRequest var4 = (HttpServletRequest)var1;
HttpServletResponse var5 = (HttpServletResponse)var2;
String var6 = var4.getRequestURI();
System.out.println("requestURI=" + var6);
if (var6.indexOf("login") <= 0 && var6.indexOf("student/saveOne") <= 0) {
String var7 = var4.getMethod();
String var8 = var4.getHeader("token");
if (CacheManager.verifyToken(var8) || "get".equals(var7.toLowerCase())) {
String var9 = var4.getParameter("id");
System.out.println("obj is " + var9.toString() + ":" + var4.getAttribute("id").toString());
if (var9 != null && "get".equals(var7.toLowerCase())) {
System.out.println("caching----->");
CacheManager.put(Integer.valueOf((String)var9), var8);
}
var3.doFilter(var4, var5);
}
} else {
var3.doFilter(var4, var5);
}
}
}