T5: Problem with <url-pattern> in web.xml

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

T5: Problem with <url-pattern> in web.xml

Ritesh_121
Hello everybody,

I am new to tapestry and I am using Tapestry core 5.0.5.
I integrated Tapestry 5 with spring and hibernate.

I configured my application's web.xml as below -

<-spring-app configuration is here->


        <context-param>               
                <param-name>tapestry.app-package</param-name>
                <param-value>com.myproject</param-value>
        </context-param>
       
<- some other filters here ->
       
        <filter>
            <filter-name>tapestryFilter</filter-name>
            <filter-class>org.apache.tapestry.spring.TapestrySpringFilter</filter-class>
        </filter>

        <filter-mapping>
                        <filter-name>tapestryFilter</filter-name>
                        <url-pattern>/*</url-pattern>
        </filter-mapping>       

        <listener>
                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

<- hibernate listener->

This works perfect with all Tapestry related pages.
At certain operation in my application when a file is uploaded from jsp page by using
servlet it generates output with .htm which fires a Tapestry Page not found exception.
I doesn't understand why?

I tried to change <url-pattern> to - /package/* , this solves my problem of uploading and
all tapestry action requests are successfully handled but all Tapestry pages are displayed
with   -  [Error] - like icons in front of every Tapestry component on that page.
I doesn't understand why?

Can anybody tell me why this is happening. I am trying solution for this from last 2-3 days.
Any help is appreciated. :)

Thanks in advance. ;)

From,
Ritesh S.
Reply | Threaded
Open this post in threaded view
|

T3: session length

Jsherwood
Hello,

Is there a way in T3 to make your session last until the browser is closed?

Thanks,
--James

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Emmanuel Sowah
No, I don't think so.

E.

On Dec 3, 2007 3:00 PM, James Sherwood <[hidden email]> wrote:

> Hello,
>
> Is there a way in T3 to make your session last until the browser is
> closed?
>
> Thanks,
> --James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Filip S. Adamsen-2
In reply to this post by Jsherwood
I suppose you could set session-timeout to 0 in your web.xml, but that's
not recommended.

-Filip

James Sherwood skrev:

> Hello,
>
> Is there a way in T3 to make your session last until the browser is closed?
>
> Thanks,
> --James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Jsherwood
What is the downfall to this?

--James

----- Original Message -----
From: "Filip S. Adamsen" <[hidden email]>
To: "Tapestry users" <[hidden email]>
Sent: Monday, December 03, 2007 2:23 PM
Subject: Re: T3: session length


>I suppose you could set session-timeout to 0 in your web.xml, but that's
>not recommended.
>
> -Filip
>
> James Sherwood skrev:
>> Hello,
>>
>> Is there a way in T3 to make your session last until the browser is
>> closed?
>>
>> Thanks,
>> --James
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> __________ NOD32 2698 (20071203) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Thiago H de Paula Figueiredo
On 12/4/07, James Sherwood <[hidden email]> wrote:
>
> What is the downfall to this?

Each user session will last forerever even when the user is not using the
application, leading to an always increasing server memory usage. Of course
you could release the session (session.invalidate()), but I don't think it's
your case.
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Jsherwood
So there is no way to have it last the length of the browser being open?

I have seen tricks using JavaScript to contact images and such to keep
sessions alive.

--James

----- Original Message -----
From: "Thiago HP" <[hidden email]>
To: "Tapestry users" <[hidden email]>
Sent: Tuesday, December 04, 2007 11:57 AM
Subject: Re: T3: session length


> On 12/4/07, James Sherwood <[hidden email]> wrote:
>>
>> What is the downfall to this?
>
> Each user session will last forerever even when the user is not using the
> application, leading to an always increasing server memory usage. Of
> course
> you could release the session (session.invalidate()), but I don't think
> it's
> your case.
> Thiago
>
>
>
> __________ NOD32 2701 (20071204) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Richard Kirby
Hi James,

As the others have said, there is no way with the servlet spec to use
the servlet session mechanism in the fashion you want. So, one solution
is for you to manage sessions yourself.

At the end of the day, all you need to recognise a request from any
given browser is a cookie. Long time since I did T3 stuff, but I would
suggest you create your own cookie representing a session, and use that
as a key to lookup any session data you need, and not use the standard
Tapestry session mechanisms that are built ontop of the Java servlet
session cookie.

Richard

James Sherwood wrote:

> So there is no way to have it last the length of the browser being open?
>
> I have seen tricks using JavaScript to contact images and such to keep
> sessions alive.
>
> --James
>
> ----- Original Message ----- From: "Thiago HP" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Sent: Tuesday, December 04, 2007 11:57 AM
> Subject: Re: T3: session length
>
>
>> On 12/4/07, James Sherwood <[hidden email]> wrote:
>>>
>>> What is the downfall to this?
>>
>> Each user session will last forerever even when the user is not using
>> the
>> application, leading to an always increasing server memory usage. Of
>> course
>> you could release the session (session.invalidate()), but I don't
>> think it's
>> your case.
>> Thiago
>>
>>
>>
>> __________ NOD32 2701 (20071204) Information __________
>>
>> This message was checked by NOD32 antivirus system.
>> http://www.eset.com
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


--

Richard Kirby
Email: [hidden email]

Phone:  0131 477 8629
Fax: 0131 477 8621
Email: [hidden email]
Website: www.capdm.com
CAPDM Limited     Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 22 Forth Street, Edinburgh, EH1 3LH, UK
===========================================


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Thiago H de Paula Figueiredo
In reply to this post by Jsherwood
On 12/4/07, James Sherwood <[hidden email]> wrote:
>
> So there is no way to have it last the length of the browser being open?

No way unless you use some Javascript hack that keeps requesting something
to the server. You must remember the nature of HTTP. The browser connects to
the server, receives the answer and the connection is closed. There is
nothing like a browser closing event notification sent to the server.
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Richard Kirby
Hi James, et al.

Opps - I answered the wrong question. As Thiago writes, you would indeed
need to use javascript to periodically fetch something from the server,
and in particular something that the servlet engine processes, so that
it knows to update the last accessed timestamp on its internal
HttpSession object mapping to that browser. A simple AJAX call would do
well here - just ping a dummy T3 page or something. Alternatively, use a
Frame (perhaps a hidden size 0 Frame) with a body reload - which will
work even if the browser doesn't support javascript.

You can then leave the default servlet timeout for sessions, so that if
the browser is closed, the session object will eventually timeout and be
GCed.

Cheers

Richard

Thiago HP wrote:

> On 12/4/07, James Sherwood <[hidden email]> wrote:
>  
>> So there is no way to have it last the length of the browser being open?
>>    
>
> No way unless you use some Javascript hack that keeps requesting something
> to the server. You must remember the nature of HTTP. The browser connects to
> the server, receives the answer and the connection is closed. There is
> nothing like a browser closing event notification sent to the server.
> Thiago
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

Jsherwood
I think the JavaScript is the way I will go as the hidden frame refreshing
creates a click in IE I believe.

Is there a way to do this built into the later Tapestrys?

--James

----- Original Message -----
From: "Richard Kirby" <[hidden email]>
To: "Tapestry users" <[hidden email]>
Sent: Tuesday, December 04, 2007 12:43 PM
Subject: Re: T3: session length


> Hi James, et al.
>
> Opps - I answered the wrong question. As Thiago writes, you would indeed
> need to use javascript to periodically fetch something from the server,
> and in particular something that the servlet engine processes, so that it
> knows to update the last accessed timestamp on its internal HttpSession
> object mapping to that browser. A simple AJAX call would do well here -
> just ping a dummy T3 page or something. Alternatively, use a Frame
> (perhaps a hidden size 0 Frame) with a body reload - which will work even
> if the browser doesn't support javascript.
>
> You can then leave the default servlet timeout for sessions, so that if
> the browser is closed, the session object will eventually timeout and be
> GCed.
>
> Cheers
>
> Richard
>
> Thiago HP wrote:
>> On 12/4/07, James Sherwood <[hidden email]> wrote:
>>
>>> So there is no way to have it last the length of the browser being open?
>>>
>>
>> No way unless you use some Javascript hack that keeps requesting
>> something
>> to the server. You must remember the nature of HTTP. The browser connects
>> to
>> the server, receives the answer and the connection is closed. There is
>> nothing like a browser closing event notification sent to the server.
>> Thiago
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
> __________ NOD32 2701 (20071204) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: T3: session length

joshcanfield-2
If all you need to do is ping a url consider setting the src attribute of an
image object to the url you want to hit. The image can be a simple 1x1
spacer image, as long as it's served up by your application.

Josh

On Dec 4, 2007 8:57 AM, James Sherwood <[hidden email]> wrote:

> I think the JavaScript is the way I will go as the hidden frame refreshing
> creates a click in IE I believe.
>
> Is there a way to do this built into the later Tapestrys?
>
> --James
>
> ----- Original Message -----
> From: "Richard Kirby" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Sent: Tuesday, December 04, 2007 12:43 PM
> Subject: Re: T3: session length
>
>
>  > Hi James, et al.
> >
> > Opps - I answered the wrong question. As Thiago writes, you would indeed
> > need to use javascript to periodically fetch something from the server,
> > and in particular something that the servlet engine processes, so that
> it
> > knows to update the last accessed timestamp on its internal HttpSession
> > object mapping to that browser. A simple AJAX call would do well here -
> > just ping a dummy T3 page or something. Alternatively, use a Frame
> > (perhaps a hidden size 0 Frame) with a body reload - which will work
> even
> > if the browser doesn't support javascript.
> >
> > You can then leave the default servlet timeout for sessions, so that if
> > the browser is closed, the session object will eventually timeout and be
> > GCed.
> >
> > Cheers
> >
> > Richard
> >
> > Thiago HP wrote:
> >> On 12/4/07, James Sherwood <[hidden email]> wrote:
> >>
> >>> So there is no way to have it last the length of the browser being
> open?
> >>>
> >>
> >> No way unless you use some Javascript hack that keeps requesting
> >> something
> >> to the server. You must remember the nature of HTTP. The browser
> connects
> >> to
> >> the server, receives the answer and the connection is closed. There is
> >> nothing like a browser closing event notification sent to the server.
> >> Thiago
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> > __________ NOD32 2701 (20071204) Information __________
> >
> > This message was checked by NOD32 antivirus system.
> > http://www.eset.com
> >
> >
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.