You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andrei Stroescu <an...@ime.ro> on 2005/09/01 09:09:56 UTC

overriding handleStaleSessionException

I tried to override handleStaleSessionException in my Own Class that 
excends BasePage but dindn't work.

this is overriding method:

private void handleStaleSessionException(StaleSessionException ex, 
IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
ServletException
    {

    System.out.println("StaleSessionException!");
   SearchM search= (SearchM) cycle.getPage("SearchM");
    cycle.activate(search);
    
    }

Anybody could tell me where is the problem ?

Thank you!


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: overriding handleStaleSessionException

Posted by Kent Tong <ke...@cpttm.org.mo>.
Andrei Stroescu <andrei <at> ime.ro> writes:

> 
> Ok!
> I made what are you tell me to do but I don't realy know how to 
> implement this.
> My java class extends BasePage already and implements PageRenderListener
> I saw an example (VLIB) from tapestry 4 package but I didn't undersand 
> how it works.
> 
> I made class MyEngine.java

Then register it in your .application:

<application ... engine-class="app.web.MyEngine">

Restart the app so that it takes effect.

--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: overriding handleStaleSessionException

Posted by Andrei Stroescu <an...@ime.ro>.
Ok!
I made what are you tell me to do but I don't realy know how to 
implement this.
My java class extends BasePage already and implements PageRenderListener
I saw an example (VLIB) from tapestry 4 package but I didn't undersand 
how it works.

I made class MyEngine.java

package app.web;


import java.io.IOException;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.StaleSessionException;
import org.apache.tapestry.event.PageEvent;
import org.apache.tapestry.event.PageRenderListener;
import org.apache.tapestry.html.BasePage;
import org.apache.tapestry.request.ResponseOutputStream;
import org.apache.tapestry.form.*;
import org.apache.tapestry.engine.BaseEngine;
import org.apache.tapestry.form.IPropertySelectionModel;
import javax.servlet.ServletException;

public class MyEngine extends BaseEngine
{
    private void handleStaleSessionException(StaleSessionException ex, 
IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
ServletException
                 {
                 System.out.println("StaleSessionException!");
                 MeniuCautare search= (MeniuCautare) 
cycle.getPage("MeniuCautare");
                 cycle.activate(search);
                 renderResponse(cycle, output);
              }

 
}

How should I implement this class in my application ?

Thank you




Kent Tong wrote:

>Andrei Stroescu <andrei <at> ime.ro> writes:
>
>  
>
>>I tried to override handleStaleSessionException in my Own Class that 
>>excends BasePage but dindn't work.
>>    
>>
>
>You need to extend BaseEngine, not BasePage.
>
>  
>
>>this is overriding method:
>>
>>private void handleStaleSessionException(StaleSessionException ex, 
>>IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
>>ServletException
>>    {
>>
>>    System.out.println("StaleSessionException!");
>>   SearchM search= (SearchM) cycle.getPage("SearchM");
>>    cycle.activate(search);
>>
>>    }
>>    
>>
>
>Try:
>private void handleStaleSessionException(StaleSessionException ex, 
> IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
> ServletException
>     {
>     System.out.println("StaleSessionException!");
>     SearchM search= (SearchM) cycle.getPage("SearchM");
>     cycle.activate(search);
>     renderResponse(cycle, output);
>  }
>
>--
>Author of e-book for learning Tapestry (www.agileskills2.org/EWDT)
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: overriding handleStaleSessionException

Posted by Andrei Stroescu <an...@ime.ro>.
Andrei Stroescu wrote:

> Ok!
> I made what are you tell me to do but I don't realy know how to 
> implement this.
> My java class extends BasePage already and implements PageRenderListener
> I saw an example (VLIB) from tapestry 4 package but I didn't undersand 
> how it works.
>
> I made class MyEngine.java
>
> package app.web;
>
>
> import java.io.IOException;
> import org.apache.tapestry.IRequestCycle;
> import org.apache.tapestry.StaleSessionException;
> import org.apache.tapestry.event.PageEvent;
> import org.apache.tapestry.event.PageRenderListener;
> import org.apache.tapestry.html.BasePage;
> import org.apache.tapestry.request.ResponseOutputStream;
> import org.apache.tapestry.form.*;
> import org.apache.tapestry.engine.BaseEngine;
> import org.apache.tapestry.form.IPropertySelectionModel;
> import javax.servlet.ServletException;
>
> public class MyEngine extends BaseEngine
> { 
>
>     private void handleStaleSessionException(StaleSessionException ex, 
> IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
> ServletException
>                  {
>                  System.out.println("StaleSessionException!");
>                  MeniuCautare search= (MeniuCautare) 
> cycle.getPage("MeniuCautare");
>                  cycle.activate(search);
>                  renderResponse(cycle, output);
>               }
>
>  
> }
>
> How should I implement this class in my application ?
>
> Thank you
>
>
>
>
>
> Kent Tong wrote:
>
>>Andrei Stroescu <andrei <at> ime.ro> writes:
>>
>>  
>>
>>>I tried to override handleStaleSessionException in my Own Class that 
>>>excends BasePage but dindn't work.
>>>    
>>>
>>
>>You need to extend BaseEngine, not BasePage.
>>
>>  
>>
>>>this is overriding method:
>>>
>>>private void handleStaleSessionException(StaleSessionException ex, 
>>>IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
>>>ServletException
>>>    {
>>>
>>>    System.out.println("StaleSessionException!");
>>>   SearchM search= (SearchM) cycle.getPage("SearchM");
>>>    cycle.activate(search);
>>>
>>>    }
>>>    
>>>
>>
>>Try:
>>private void handleStaleSessionException(StaleSessionException ex, 
>> IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
>> ServletException
>>     {
>>     System.out.println("StaleSessionException!");
>>     SearchM search= (SearchM) cycle.getPage("SearchM");
>>     cycle.activate(search);
>>     renderResponse(cycle, output);
>>  }
>>
>>--
>>Author of e-book for learning Tapestry (www.agileskills2.org/EWDT)
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>  
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: overriding handleStaleSessionException

Posted by Kent Tong <ke...@cpttm.org.mo>.
Andrei Stroescu <andrei <at> ime.ro> writes:

> 
> I tried to override handleStaleSessionException in my Own Class that 
> excends BasePage but dindn't work.

You need to extend BaseEngine, not BasePage.

> this is overriding method:
> 
> private void handleStaleSessionException(StaleSessionException ex, 
> IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
> ServletException
>     {
> 
>     System.out.println("StaleSessionException!");
>    SearchM search= (SearchM) cycle.getPage("SearchM");
>     cycle.activate(search);
> 
>     }

Try:
private void handleStaleSessionException(StaleSessionException ex, 
 IRequestCycle cycle, ResponseOutputStream output) throws IOException, 
 ServletException
     {
     System.out.println("StaleSessionException!");
     SearchM search= (SearchM) cycle.getPage("SearchM");
     cycle.activate(search);
     renderResponse(cycle, output);
  }

--
Author of e-book for learning Tapestry (www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org