You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by mohammad hassan shamsi <m....@gmail.com> on 2005/09/03 23:54:53 UTC

can i Redirect a Request in Tapestry 4 ???

Hi All

can i  Redirect a Request in Tapestry  4 ???

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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by "Jone.hwk" <jo...@yahoo.com.cn>.
There are two way at least:

1.try:throw new PageRedirectException("PageName");

2.In "ExceptionPresenter" service implementation,catch "CustomException" 
wrapped by ApplicationRuntimeException,then active "CustomPage" in 
method "presentException(IRequestCycle cycle, Throwable cause) "

Jone.hwk


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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by Joseph Hannon <ja...@gmail.com>.
I tested Howard's example again on Tapestry 4 beta 8 and made sure my
listener, 'orderListener', was taking an IPage, which I wasn't doing before.
I am assuming Howard's 'redirect' method name could be called 'foo'. At
least the exception was different this time. This is what I saw:

Exception invoking listener method orderListener of component PlaceOrder: No
listener method named 'orderListener' suitable for no listener parameters
found in $PlaceOrder_29@881cb3[PlaceOrder].
binding: org.apache.tapestry.binding.ListenerMethodBinding@1bbd583[parameter
listener, component=PlaceOrder, methodName=orderListener,
location=context:/WEB-INF/PlaceOrder.page, line 22, column 64]

How do I tell Tapestry that my listener takes an IPage? I am I calling the
listener correctly? Will you show me a piece of code that would call this
listener with an IPage param?

Page:

<component id="form" type="Form">
<binding name="listener" value="listener:orderListener"/>
</component>

Class:

@InjectObject("engine-service:page")
public abstract IEngineService getPageService() ;

public ILink orderListener (IPage page)
{
return getPageService().getLink(getRequestCycle(), false, getPageName()) ;
}

Thanks,
Joseph

On 9/28/05, Leonardo Quijano Vincenzi <le...@dtqsoftware.com> wrote:
>
> Checkout what Howard wrote below. That's basically it.
>
> Though we'd like the framework to facilitate the redirect work (right
> now it's like going against the framework).
>
> --
> Ing. Leonardo Quijano Vincenzi
> Director Técnico
> DTQ Software
>
> Joseph Hannon escribió:
>
> >It appears that returning an ILink is working for you. I would like to do
> >whatever you have done so I can return an ILink. Please see list subject
> >'RedirectException issues' for more information about an exception I am
> >getting attempting to return an ILink. How did you get your stuff
> working?
> >What specific version of Tapestry are you using? Does anything need to be
> >setup in Hivemind to enable returning ILinks.
> >
> >Thanks,
> >Joseph
> >
> >On 9/5/05, Leonardo Quijano Vincenzi <le...@dtqsoftware.com> wrote:
> >
> >
> >>I was looking the other day some article about Redirect-After-Post in
> >>Tapestry. But I don't think it was updated to Tapestry 4.
> >>I guess *this* is the way to do that, or are the any special
> >>considerations?
> >>
> >>--
> >>
> >>Ing. Leonardo Quijano Vincenzi
> >>Director Técnico
> >>DTQ Software
> >>
> >>Howard Lewis Ship escribió:
> >>
> >>
> >>
> >>>Which can be shortened to:
> >>>
> >>>
> >>>@InjectObject("engine-service:page")
> >>>public abstract IEngineService getPageService();
> >>>
> >>>public ILink redirect(IPage page)
> >>>{
> >>>IRequestCycle cycle = getRequestCycle();
> >>>
> >>>return getPageService().getLink(cycle, false, getPageName());
> >>>}
> >>>
> >>>On 9/5/05, Pete <pe...@gmx.org> wrote:
> >>>
> >>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: can i Redirect a Request in Tapestry 4 ???

Posted by Leonardo Quijano Vincenzi <le...@dtqsoftware.com>.
Checkout what Howard wrote below. That's basically it.

Though we'd like the framework to facilitate the redirect work (right 
now it's like going against the framework).

-- 
Ing. Leonardo Quijano Vincenzi
Director Técnico
DTQ Software

Joseph Hannon escribió:

>It appears that returning an ILink is working for you. I would like to do
>whatever you have done so I can return an ILink. Please see list subject
>'RedirectException issues' for more information about an exception I am
>getting attempting to return an ILink. How did you get your stuff working?
>What specific version of Tapestry are you using? Does anything need to be
>setup in Hivemind to enable returning ILinks.
>
>Thanks,
>Joseph
>
>On 9/5/05, Leonardo Quijano Vincenzi <le...@dtqsoftware.com> wrote:
>  
>
>>I was looking the other day some article about Redirect-After-Post in
>>Tapestry. But I don't think it was updated to Tapestry 4.
>>I guess *this* is the way to do that, or are the any special
>>considerations?
>>
>>--
>>
>>Ing. Leonardo Quijano Vincenzi
>>Director Técnico
>>DTQ Software
>>
>>Howard Lewis Ship escribió:
>>
>>    
>>
>>>Which can be shortened to:
>>>
>>>
>>>@InjectObject("engine-service:page")
>>>public abstract IEngineService getPageService();
>>>
>>>public ILink redirect(IPage page)
>>>{
>>>IRequestCycle cycle = getRequestCycle();
>>>
>>>return getPageService().getLink(cycle, false, getPageName());
>>>}
>>>
>>>On 9/5/05, Pete <pe...@gmx.org> wrote:
>>>      
>>>



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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by Joseph Hannon <ja...@gmail.com>.
It appears that returning an ILink is working for you. I would like to do
whatever you have done so I can return an ILink. Please see list subject
'RedirectException issues' for more information about an exception I am
getting attempting to return an ILink. How did you get your stuff working?
What specific version of Tapestry are you using? Does anything need to be
setup in Hivemind to enable returning ILinks.

Thanks,
Joseph

On 9/5/05, Leonardo Quijano Vincenzi <le...@dtqsoftware.com> wrote:
>
> I was looking the other day some article about Redirect-After-Post in
> Tapestry. But I don't think it was updated to Tapestry 4.
> I guess *this* is the way to do that, or are the any special
> considerations?
>
> --
>
> Ing. Leonardo Quijano Vincenzi
> Director Técnico
> DTQ Software
>
> Howard Lewis Ship escribió:
>
> >Which can be shortened to:
> >
> >
> > @InjectObject("engine-service:page")
> > public abstract IEngineService getPageService();
> >
> > public ILink redirect(IPage page)
> > {
> > IRequestCycle cycle = getRequestCycle();
> >
> > return getPageService().getLink(cycle, false, getPageName());
> > }
> >
> >On 9/5/05, Pete <pe...@gmx.org> wrote:
> >
> >
> >>Will this help?
> >>
> >>[snip]
> >>
> >> @InjectObject("engine-service:page")
> >> public abstract IEngineService getPageService();
> >>
> >> public void redirect(IPage page)
> >> {
> >> IRequestCycle cycle = getRequestCycle();
> >> Object param = page.getPageName();
> >> ILink link = getPageService().getLink(cycle, false, param);
> >>
> >> throw new RedirectException(link.getURL());
> >> }
> >>
> >>[snip]
> >>
> >>
> >>
> >>On Mon, 05 Sep 2005 10:12:27 +0200, Mohammad Hassan Shamsi
> >><m....@gmail.com> wrote:
> >>
> >>
> >>
> >>>Jone.hwk wrote:
> >>>
> >>>
> >>>
> >>>>However,in tapetry4,in rendered page "actived" by "throw a
> >>>>PageRedirectException",you'll see all unicode characters("utf-8")
> >>>>coming into "????"
> >>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Hi .
> >>>
> >>>Beacuse of Back and Froward, i neeed to use Redirect Page.
> >>>Please help me.
> >>>
> >>>---------------------------------------------------------------------
> >>>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
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: can i Redirect a Request in Tapestry 4 ???

Posted by Leonardo Quijano Vincenzi <le...@dtqsoftware.com>.
I was looking the other day some article about Redirect-After-Post in 
Tapestry. But I don't think it was updated to Tapestry 4.
I guess *this* is the way to do that, or are the any special considerations?

-- 

Ing. Leonardo Quijano Vincenzi
Director Técnico
DTQ Software

Howard Lewis Ship escribió:

>Which can be shortened to:
>
>
>   @InjectObject("engine-service:page")
>   public abstract IEngineService getPageService();
>
>   public ILink redirect(IPage page)
>   {
>      IRequestCycle cycle = getRequestCycle();
>     
>      return getPageService().getLink(cycle, false, getPageName());
>   }
>
>On 9/5/05, Pete <pe...@gmx.org> wrote:
>  
>
>>Will this help?
>>
>>[snip]
>>
>>    @InjectObject("engine-service:page")
>>    public abstract IEngineService getPageService();
>>
>>    public void redirect(IPage page)
>>    {
>>       IRequestCycle cycle = getRequestCycle();
>>       Object param = page.getPageName();
>>       ILink link = getPageService().getLink(cycle, false, param);
>>
>>       throw new RedirectException(link.getURL());
>>    }
>>
>>[snip]
>>
>>
>>
>>On Mon, 05 Sep 2005 10:12:27 +0200, Mohammad Hassan Shamsi
>><m....@gmail.com> wrote:
>>
>>    
>>
>>>Jone.hwk wrote:
>>>
>>>      
>>>
>>>>However,in tapetry4,in rendered page "actived" by "throw a
>>>>PageRedirectException",you'll see all unicode characters("utf-8")
>>>>coming into "????"
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>Hi .
>>>
>>>Beacuse of Back and Froward, i neeed to use Redirect Page.
>>>Please help me.
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>    
>>
>
>
>  
>



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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by Howard Lewis Ship <hl...@gmail.com>.
Which can be shortened to:


   @InjectObject("engine-service:page")
   public abstract IEngineService getPageService();

   public ILink redirect(IPage page)
   {
      IRequestCycle cycle = getRequestCycle();
     
      return getPageService().getLink(cycle, false, getPageName());
   }

On 9/5/05, Pete <pe...@gmx.org> wrote:
> Will this help?
> 
> [snip]
> 
>     @InjectObject("engine-service:page")
>     public abstract IEngineService getPageService();
> 
>     public void redirect(IPage page)
>     {
>        IRequestCycle cycle = getRequestCycle();
>        Object param = page.getPageName();
>        ILink link = getPageService().getLink(cycle, false, param);
> 
>        throw new RedirectException(link.getURL());
>     }
> 
> [snip]
> 
> 
> 
> On Mon, 05 Sep 2005 10:12:27 +0200, Mohammad Hassan Shamsi
> <m....@gmail.com> wrote:
> 
> > Jone.hwk wrote:
> >
> >> However,in tapetry4,in rendered page "actived" by "throw a
> >> PageRedirectException",you'll see all unicode characters("utf-8")
> >> coming into "????"
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> > Hi .
> >
> > Beacuse of Back and Froward, i neeed to use Redirect Page.
> > Please help me.
> >
> > ---------------------------------------------------------------------
> > 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
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by Pete <pe...@gmx.org>.
Will this help?

[snip]

    @InjectObject("engine-service:page")
    public abstract IEngineService getPageService();

    public void redirect(IPage page)
    {
       IRequestCycle cycle = getRequestCycle();
       Object param = page.getPageName();
       ILink link = getPageService().getLink(cycle, false, param);

       throw new RedirectException(link.getURL());
    }

[snip]



On Mon, 05 Sep 2005 10:12:27 +0200, Mohammad Hassan Shamsi  
<m....@gmail.com> wrote:

> Jone.hwk wrote:
>
>> However,in tapetry4,in rendered page "actived" by "throw a  
>> PageRedirectException",you'll see all unicode characters("utf-8")  
>> coming into "????"
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
> Hi .
>
> Beacuse of Back and Froward, i neeed to use Redirect Page.
> Please help me.
>
> ---------------------------------------------------------------------
> 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: can i Redirect a Request in Tapestry 4 ???

Posted by Mohammad Hassan Shamsi <m....@gmail.com>.
Jone.hwk wrote:

>However,in tapetry4,in rendered page "actived" by "throw a 
>PageRedirectException",you'll see all unicode characters("utf-8") coming 
>into "????"
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>
Hi .

Beacuse of Back and Froward, i neeed to use Redirect Page.
Please help me.

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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by "Jone.hwk" <jo...@yahoo.com.cn>.
However,in tapetry4,in rendered page "actived" by "throw a 
PageRedirectException",you'll see all unicode characters("utf-8") coming 
into "????"



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


Re: can i Redirect a Request in Tapestry 4 ???

Posted by Tomáš Drenčák <to...@gmail.com>.
throw a PageRedirectException

2005/9/3, mohammad hassan shamsi <m....@gmail.com>:
> Hi All
> 
> can i  Redirect a Request in Tapestry  4 ???
> 
> ---------------------------------------------------------------------
> 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