每点击一次菜单,就会触发事件,然后到这个action,经过处理把值传入session中,之所以要清空session是因为有多个菜单
,每个菜单都有自己的固有值,现在打印的内容显示清空了值,但是debug里面还是原来的值public class ContentAction extends ActionSupport{ private static final long serialVersionUID = 1L;

IContentService contentService = (IContentService) BeanFactory.getBean(BeanFactory.CONTENTSERVICE); public IContentService getContentService() {
return contentService;
} public void setContentService(IContentService contentService) {
this.contentService = contentService;
} //根据s2遍历内容
@SuppressWarnings({ "unchecked", "deprecation" })
public String findContentByS2(){
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
HttpSession session = request.getSession();
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = null;
Map<String, String> findContentByS21 = new TreeMap<String, String>();
Map<String, String> findContentByS22 = new TreeMap<String, String>();
try {
Enumeration e=session.getAttributeNames(); 
while(e.hasMoreElements()){ 
String sessionName=(String)e.nextElement(); 
System.out.println("存在的session 有:"+sessionName); 
System.out.println("session的值:"+session.getValue(sessionName));
session.removeAttribute(sessionName); 
System.out.println("移除成功:"+sessionName);
System.out.println("session的值:"+session.getValue(sessionName));
}
out = response.getWriter();
String s2_1 = request.getParameter("s2");
String s2 = new String(s2_1.getBytes("iso8859-1"), "UTF-8");
// System.out.println("s2 = " + s2);
List<WjContent> list = contentService.findList(s2);
Iterator<WjContent> it = list.iterator();
while(it.hasNext()){
WjContent wc = it.next();
if(s2 != null){
out.print("1");
out.flush();
out.close();
findContentByS21.put(wc.getTitle(), wc.getContent());
findContentByS22.put(wc.getTitle(), wc.getCode1());
System.out.println("map:="+wc.getTitle()+"+"+wc.getCode1());
}
else{
out.print("0");
out.flush();
out.close();
return "false";
}
}
session.setAttribute("findContentByS21", findContentByS21);
session.setAttribute("findContentByS22", findContentByS22);
} catch (ServiceException e) {
e.printStackTrace();
addActionError(e.getMessage());
} catch (IOException e) {
e.printStackTrace();
}
return "success";
}

}
打印内容: 
存在的session 有:findContentByS22
session的值:{你好=2010-08-13, 天门=2010-08-13}
移除成功:findContentByS22
session的值:null
存在的session 有:findContentByS21
session的值:{你好=同志们辛苦了      , 天门=xxxxxx}
移除成功:findContentByS21
session的值:null
Hibernate: select wjcontent0_.ID as ID0_, wjcontent0_.TITLE as TITLE0_, wjcontent0_.CONTENT as CONTENT0_, wjcontent0_.S1 as S4_0_, wjcontent0_.S2 as S5_0_, wjcontent0_.CODE1 as CODE6_0_, wjcontent0_.CODE2 as CODE7_0_, wjcontent0_.CODE3 as CODE8_0_ from WJ_CONTENT wjcontent0_ where wjcontent0_.S2=?
map:=山西+2010-08-13debug内容:
session {findContentByS22={你好=2010-08-13, 天门=2010-08-13}, findContentByS21={你好=同志们辛苦了 , 天门=xxxxxx}} 
急急!!!