1 16 17 package org.apache.taglibs.session; 18 19 import java.util.*; 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 39 40 public class MaxInactiveIntervalTag extends BodyTagSupport 41 { 42 47 public final int doStartTag() throws JspException 48 { 49 return EVAL_BODY_TAG; 50 } 51 52 58 public final int doAfterBody() throws JspException 59 { 60 BodyContent body = getBodyContent(); 62 String s = body.getString().trim(); 63 body.clearBody(); 66 67 int interval; 68 try { 69 interval = Integer.valueOf(s).intValue(); 70 pageContext.getSession().setMaxInactiveInterval(interval); 72 } catch(NumberFormatException e) { 73 throw new JspException( 74 "session tag maxInactiveInterval, bad number format: " + s); 75 } 76 77 return SKIP_BODY; 78 } 79 } 80 | Popular Tags |