功能:
用户登陆进来,添加,修改,删除,查看得功能记录并在jsp里显示出来谁写过共享一下。或者说一下思路谢谢了
用户登陆进来,添加,修改,删除,查看得功能记录并在jsp里显示出来谁写过共享一下。或者说一下思路谢谢了
解决方案 »
- 关于collection中的remove方法 求大侠们解答
- 报空指针错误
- 用swing做的一个小的桌面系统,怎样统一设置所有控件的显示字体
- Tomcat虚拟目录设置问题!!
- 菜鸟题---用一个线程的两个按钮控制另一个线程的wait()和notify() ,程序如下,实现不了
- 请教各位XDJM: JDK 1.3 中,能使用正则表达式吗?
- 打印问题,在线等待,解决马上结帖!!!
- 我怎么使用同一个目录下的别的类的方法?
- classloader问题
- 大家做oa的时候,在邮件部分,一定要用javamail吗?
- java类设计要注意什么?有什么规范?
- 怎样用java反射机制获得父类private 属性的值
import javax.servlet.http.HttpSession;
import org.apache.log4j.MDC;public class LoggerFilter implements Filter {
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// Retrieves the session object from the current request.
HttpSession session = ((HttpServletRequest)request).getSession();
// Put the username into the diagnostic context.
// Use %X{username} in the layout pattern to include this information.
MDC.put("username", session.getAttribute("username"));
// Continue processing the rest of the filter chain.
chain.doFilter(request, response);
// Remove the username from the diagnostic context.
MDC.remove("username");
}
...
}