JSP – Session Page Directive

Session Attribute Of JSP Page Directive

This attribute checks whether JSP page is in a particular HTTP session or not. It can have true or false value. Default value is true.


<%@ page session=”value”%>


<%@ page session=”true” %>
                        <title>session page directive example</title>
                        <h2>In JSP Session automatically created</h2>
                        <h2>Every session has unique ID</h2>
                                    out.print(“Session id:” + session.getId());

Scroll to Top