Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • How do I do a Servlet filter, or similar functionality... help please!

    5 answers - 744 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi all,
    I have tried to implement a Servlet Filter but my Tapestry 4 app will not
    take it I get some weird errors - is it not supposed to work?
    I have also read about the ServletRequestServicerFilter but I cannot find
    any decent documentation - is there any? I lack documentation about many
    things - where is the best way to go anyway?
    What I'm really trying to do is to manage my Hibernate transactions, I'd
    like to have one transaction per HTTP request. So I thought I'd do it like a
    servlet filter - is this the wrong way?
    Then I thought maybe I could use my border component which wraps all pages -
    would that be possible? Better?
    Any help appreciated.
    Malin
  • No.1 | | 1090 bytes | |

    Why reinvent the wheel? Try tapernate:

    You can use anonymous/anon to check it out from the SVN repository.

    Hi all,

    I have tried to implement a Servlet Filter but my Tapestry 4 app will not
    take it I get some weird errors - is it not supposed to work?

    I have also read about the ServletRequestServicerFilter but I cannot find
    any decent documentation - is there any? I lack documentation about
    many
    things - where is the best way to go anyway?

    What I'm really trying to do is to manage my Hibernate transactions, I'd
    like to have one transaction per HTTP request. So I thought I'd do it like
    a
    servlet filter - is this the wrong way?
    Then I thought maybe I could use my border component which wraps all pages
    -
    would that be possible? Better?

    Any help appreciated.

    Malin

    James Carman, President
    Carman Consulting, Inc.

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.2 | | 1571 bytes | |

    Thank you James.

    Maybe Tapernate is a good idea it's just that my project is really small
    and I would rather avoid another dependency. And I have not introduced
    Hivemind yet. But I'll sure check it out carefully.

    And I'm still curious for the answer to my question - anyone? :)

    Malin

    7/18/06, James Carman <james (AT) carmanconsulting (DOT) comwrote:

    Why reinvent the wheel? Try tapernate:

    You can use anonymous/anon to check it out from the SVN repository.

    Hi all,

    I have tried to implement a Servlet Filter but my Tapestry 4 app will
    not
    take it I get some weird errors - is it not supposed to work?

    I have also read about the ServletRequestServicerFilter but I cannot
    find
    any decent documentation - is there any? I lack documentation about
    many
    things - where is the best way to go anyway?

    What I'm really trying to do is to manage my Hibernate transactions, I'd
    like to have one transaction per HTTP request. So I thought I'd do it
    like
    a
    servlet filter - is this the wrong way?
    Then I thought maybe I could use my border component which wraps all
    pages
    -
    would that be possible? Better?

    Any help appreciated.

    Malin
    >
    >
    >

    James Carman, President
    Carman Consulting, Inc.
    --

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    --
  • No.3 | | 2485 bytes | |

    Tapernate uses a Tapestry WebRequestServicerFilter to implement the
    open-session-in-view pattern.

    Thank you James.

    Maybe Tapernate is a good idea it's just that my project is really
    small
    and I would rather avoid another dependency. And I have not introduced
    Hivemind yet. But I'll sure check it out carefully.

    And I'm still curious for the answer to my question - anyone? :)

    Malin
    --
    7/18/06, James Carman <james (AT) carmanconsulting (DOT) comwrote:
    >>

    >Why reinvent the wheel? Try tapernate:
    >>

    >
    >>

    >You can use anonymous/anon to check it out from the SVN repository.
    >>

    >Hi all,
    >>

    >I have tried to implement a Servlet Filter but my Tapestry 4 app will
    >not
    >take it I get some weird errors - is it not supposed to work?
    >>

    >I have also read about the ServletRequestServicerFilter but I cannot
    >find
    >any decent documentation - is there any? I lack documentation
    >about
    >many
    >things - where is the best way to go anyway?
    >>

    >What I'm really trying to do is to manage my Hibernate transactions,
    >I'd
    >like to have one transaction per HTTP request. So I thought I'd do it
    >like
    >a
    >servlet filter - is this the wrong way?
    >Then I thought maybe I could use my border component which wraps all
    >pages
    >-
    >would that be possible? Better?
    >>

    >Any help appreciated.
    >>

    >Malin
    >>
    >>
    >>

    >James Carman, President
    >Carman Consulting, Inc.
    >>
    >>

    >
    >To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    >>
    >>

    >


    James Carman, President
    Carman Consulting, Inc.

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.4 | | 2627 bytes | |

    This is what I did

    public class MyFilter implements WebRequestServicerFilter{

    public void service(WebRequest request, WebResponse response,
    WebRequestServicer servicer)
    throws IException
    {

    try
    {
    //do whatever u want
    servicer.service(request, response);
    }
    finally
    {
    //do whatever u want
    }
    }

    }

    In hivemodule.xml add the following

    <service-point id="MyFilter"
    interface="">

    Filter used to optionally discard the session at the end of a
    request (typically after a logout).

    <invoke-factory>
    <construct class="MyFilter">
    </construct>
    </invoke-factory>

    </service-point>

    Hope it helps.
    Thanks,
    Pratibha

    Malin Ljungh wrote:

    Hi all,

    I have tried to implement a Servlet Filter but my Tapestry 4 app will not
    take it I get some weird errors - is it not supposed to work?

    I have also read about the ServletRequestServicerFilter but I cannot find
    any decent documentation - is there any? I lack documentation
    about many
    things - where is the best way to go anyway?

    What I'm really trying to do is to manage my Hibernate transactions, I'd
    like to have one transaction per HTTP request. So I thought I'd do it
    like a
    servlet filter - is this the wrong way?
    Then I thought maybe I could use my border component which wraps all
    pages -
    would that be possible? Better?

    Any help appreciated.

    Malin

    This message is for the named person's use only. It may contain
    confidential, proprietary or legally privileged information. No
    confidentiality or privilege is waived or lost by any mistransmission.

    If you receive this message in error, please immediately delete it and
    all copies of it from your system, destroy any hard copies of it and
    notify the sender. You must not, directly or indirectly, use, disclose,
    distribute, print, or copy any part of this message if you are not the
    intended recipient.

    Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each
    reserve the right to monitor all e-mail communications through its
    networks.

    Any views expressed in this message are those of the
    individual sender, except where the message states otherwise and the
    sender is authorized to state them to be the views of any such entity.

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
  • No.5 | | 2960 bytes | |

    Thank you all.
    It turns out my servlet filter does actually work! I had some other issues
    :[

    I now use the filter from here:
    and it seems to satisfy my needs for now anyway :)

    Malin

    7/18/06, Pratibha Gopalam <pratibha (AT) ltp (DOT) soft.netwrote:
    --
    This is what I did

    public class MyFilter implements WebRequestServicerFilter{

    public void service(WebRequest request, WebResponse response,
    WebRequestServicer servicer)
    throws IException
    {

    try
    {
    //do whatever u want
    servicer.service(request, response);
    }
    finally
    {
    //do whatever u want
    }
    }

    }

    In hivemodule.xml add the following

    <service-point id="MyFilter"
    interface="">

    Filter used to optionally discard the session at the end of a
    request (typically after a logout).

    <invoke-factory>
    <construct class="MyFilter">
    </construct>
    </invoke-factory>

    </service-point>

    Hope it helps.
    Thanks,
    Pratibha

    Malin Ljungh wrote:

    Hi all,

    I have tried to implement a Servlet Filter but my Tapestry 4 app will
    not
    take it I get some weird errors - is it not supposed to work?

    I have also read about the ServletRequestServicerFilter but I cannot
    find
    any decent documentation - is there any? I lack documentation
    about many
    things - where is the best way to go anyway?

    What I'm really trying to do is to manage my Hibernate transactions, I'd
    like to have one transaction per HTTP request. So I thought I'd do it
    like a
    servlet filter - is this the wrong way?
    Then I thought maybe I could use my border component which wraps all
    pages -
    would that be possible? Better?

    Any help appreciated.

    Malin
    >
    >
    >


    This message is for the named person's use only. It may contain
    confidential, proprietary or legally privileged information. No
    confidentiality or privilege is waived or lost by any mistransmission.

    If you receive this message in error, please immediately delete it and
    all copies of it from your system, destroy any hard copies of it and
    notify the sender. You must not, directly or indirectly, use, disclose,
    distribute, print, or copy any part of this message if you are not the
    intended recipient.

    Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each
    reserve the right to monitor all e-mail communications through its
    networks.

    Any views expressed in this message are those of the
    individual sender, except where the message states otherwise and the
    sender is authorized to state them to be the views of any such entity.

    To unsubscribe, e-mail: users-unsubscribe (AT) tapestry (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tapestry (DOT) apache.org
    --

Re: How do I do a Servlet filter, or similar functionality... help please!


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Java"

EMSDN.COM