in sessionCreated create and dump an exception and check the stacktrace
to find who's responsible

On Tue, Mar 10, 2009 at 2:07 AM, Borut Bolčina <borut.bolc...@gmail.com> wrote:
> Hi,
>
> I am trying to prevent session creation when using forms and in general. I
> searched the mailing list but can not explain why the session is still being
> created. I use 5.0.18.
>
> Index.tml
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>    <body>
>        <t:form t:id="myform">
>            <t:label for="cardNumber"/>:
>            <t:textfield t:id="cardNumber" value="cardNumber" size="20"/>
>            <input type="submit" value="Submit"/>
>        </t:form>
>        <div>${cardNumber}</div>
>    </body>
> </html>
>
> Index.java
>
> @Meta("tapestry.persistence-strategy=client")
> public class Index {
>
>   �...@property
>   �...@persist
>    private String cardNumber;
>
> }
>
> Even when I remove the @Persist annotation from the cardNumber property, the
> session is still being created. Until I remove the Form from the template.
>
> I am monitoring session creation with a class in my same test project:
>
> package bb.test.session;
> import java.util.Date;
>
> import javax.servlet.http.HttpSession;
> import javax.servlet.http.HttpSessionEvent;
> import javax.servlet.http.HttpSessionListener;
>
> public class MyHttpSessionListener implements HttpSessionListener {
>    public void sessionCreated(HttpSessionEvent se)
>    {
>        HttpSession session = se.getSession();
>        System.out.print(getTime() + " (session) Created:");
>        System.out.println("ID=" + session.getId() + " MaxInactiveInterval="
> + session.getMaxInactiveInterval());
>    }
>    public void sessionDestroyed(HttpSessionEvent se)
>    {
>        HttpSession session = se.getSession();
>        // session has been invalidated and all session data (except Id)is
> no longer available
>        System.out.println(getTime() + " (session) Destroyed:ID=" +
> session.getId());
>    }
>    private String getTime()
>    {
>        return new Date(System.currentTimeMillis()).toString();
>    }
>
> }
>
> and with
>
>    <listener>
>
> <listener-class>bb.test.session.MyHttpSessionListener</listener-class>
>    </listener>
>
> in my web.xml.
>
> Of course Firefox extension FireCookie is of help.
>
> So, is this a bug?
>
> Regards,
> Borut
>



-- 
Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to