You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/05/01 15:16:19 UTC
t5: appending a query string to a page name?
Hi,
following code redirects to a results page under mysearch:
Object onSuccessFromMySearchForm() {
return "mysearch/results";
}
now I need to append a query string after the page name:
return "mysearch/results?12345";
this will trigger an exception:
Unable to resolve 'mysearch/results?12345' to a known page name.
question: how to append a query string to a page name? Thanks,
Angelo
--
View this message in context: http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23332958.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by Joachim Van der Auwera <jo...@progs.be>.
Try returning a URL instead of a String. The string is interpreted as
page name and thus cannot include parameters.
Kind regards,
Joachim
Angelo Chen wrote:
> Hi,
>
> following code redirects to a results page under mysearch:
>
> Object onSuccessFromMySearchForm() {
> return "mysearch/results";
> }
>
> now I need to append a query string after the page name:
>
> return "mysearch/results?12345";
>
> this will trigger an exception:
>
> Unable to resolve 'mysearch/results?12345' to a known page name.
>
> question: how to append a query string to a page name? Thanks,
>
> Angelo
>
>
>
--
Joachim Van der Auwera
PROGS bvba, progs.be
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,
MySearchResuls can be directly called by:
http://localhost:8080/mysearchresults?type=1&group=2
thus need to find a way to activate those page in another class with query
string approach.
Harald Geritzer-2 wrote:
>
>
> you could inject the mysearchresults page:
>
> @Inject
> private MySearchResults mySearchResults;
>
> Object onSuccessFromMySearchForm() {
> mySearchResults.setPropertyXXX('12345');
> return mySearchResults;
> }
>
> Angelo Chen schrieb:
>> Hi,
>>
>> following code redirects to a results page under mysearch:
>>
>> Object onSuccessFromMySearchForm() {
>> return "mysearch/results";
>> }
>>
>> now I need to append a query string after the page name:
>>
>> return "mysearch/results?12345";
>>
>> this will trigger an exception:
>>
>> Unable to resolve 'mysearch/results?12345' to a known page name.
>>
>> question: how to append a query string to a page name? Thanks,
>>
>> Angelo
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23341668.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by Harald Geritzer <h....@gmail.com>.
you could inject the mysearchresults page:
@Inject
private MySearchResults mySearchResults;
Object onSuccessFromMySearchForm() {
mySearchResults.setPropertyXXX('12345');
return mySearchResults;
}
Angelo Chen schrieb:
> Hi,
>
> following code redirects to a results page under mysearch:
>
> Object onSuccessFromMySearchForm() {
> return "mysearch/results";
> }
>
> now I need to append a query string after the page name:
>
> return "mysearch/results?12345";
>
> this will trigger an exception:
>
> Unable to resolve 'mysearch/results?12345' to a known page name.
>
> question: how to append a query string to a page name? Thanks,
>
> Angelo
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by Geoffrey Wiseman <ge...@gmail.com>.
On Fri, May 1, 2009 at 9:16 AM, Angelo Chen <an...@yahoo.com.hk>wrote:
>
> Hi,
>
> following code redirects to a results page under mysearch:
>
> Object onSuccessFromMySearchForm() {
> return "mysearch/results";
> }
>
> now I need to append a query string after the page name:
>
> return "mysearch/results?12345";
>
> this will trigger an exception:
>
> Unable to resolve 'mysearch/results?12345' to a known page name.
>
> question: how to append a query string to a page name? Thanks,
>
Rather than query string, you'd tend to append to the path in Tapestry. I
don't think you can do that with the "page name" string return, though, so
the simplest way is to return a configured page object that can passivate.
public class Results {
Integer value;
public void onActivate(EventContext context) {
if( context.getCount() > 0 )
value = context.get(String.class,0);
}
public Integer onPassivate() {
return value;
}
public Results forValue( Integer value ) {
this.value = value;
return this;
}
}
public class MySearch {
@Inject
private Results resultPage;
public Object onSuccessFromMySearchForm() {
return resultPage.forValue(12345);
}
}
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/
Re: t5: appending a query string to a page name?
Posted by Geoff Callender <ge...@gmail.com>.
There are several ways to pass data between pages in T5. They're all
demonstrated here:
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/state/passingdatabetweenpages1
The one you want is labelled "Request Parameters". Does that help?
Geoff
On 02/05/2009, at 6:15 PM, Andrew Court wrote:
>
> In order to do what you ask I believe you have to manually pull the
> querystring parameters out of the request:
>
> mysearch/results?country=US&state=NY
>
> @Inject
> private RequestGlobals requestGlobals;
>
> void onActivate()
> {
> Request req = requestGlobals.getRequest();
> String country = req.getParameter("country");
> String state = req.getParameter("state");
> }
>
>
>
> Angelo Chen wrote:
>>
>> Hi,
>>
>> the problem is, when it is this which is very common in the query
>> string,
>> T5 will not accept:
>>
>> mysearch/results/country=US&state=NY
>>
>>
>>
>>
>> ஸ்ரீராம் கீர்த்தி wrote:
>>>
>>> Angelo,
>>>
>>> you can make it like this...
>>> Object onSuccessFromMySearchForm() {
>>> return "mysearch/results/12345"; // note the '/' 12345 is
>>> not a
>>> part
>>> of the query string but part of the url path itself
>>> }
>>>
>>> and in Results.java use onActivation method ... something like ...
>>>
>>> @Property
>>> private String resultValue;
>>>
>>> void onActivate( String resultValue) // or you can use int or long.
>>> Tapestry
>>> will take care ;-)
>>> {
>>> this.resultValue= resultValue; // member field 'resultValue'
>>> will now
>>> contain 12345
>>> }
>>>
>>> I am not sure if you needed such a way to solve your problem, but
>>> this
>>> way
>>> will work for the example you have given.
>>>
>>> - keerthy
>>>
>>> On Fri, May 1, 2009 at 6:46 PM, Angelo Chen
>>> <an...@yahoo.com.hk>wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> following code redirects to a results page under mysearch:
>>>>
>>>> Object onSuccessFromMySearchForm() {
>>>> return "mysearch/results";
>>>> }
>>>>
>>>> now I need to append a query string after the page name:
>>>>
>>>> return "mysearch/results?12345";
>>>>
>>>> this will trigger an exception:
>>>>
>>>> Unable to resolve 'mysearch/results?12345' to a known page name.
>>>>
>>>> question: how to append a query string to a page name? Thanks,
>>>>
>>>> Angelo
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23332958.html
>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23344050.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by Andrew Court <an...@gmail.com>.
In order to do what you ask I believe you have to manually pull the
querystring parameters out of the request:
mysearch/results?country=US&state=NY
@Inject
private RequestGlobals requestGlobals;
void onActivate()
{
Request req = requestGlobals.getRequest();
String country = req.getParameter("country");
String state = req.getParameter("state");
}
Angelo Chen wrote:
>
> Hi,
>
> the problem is, when it is this which is very common in the query string,
> T5 will not accept:
>
> mysearch/results/country=US&state=NY
>
>
>
>
> ஸ்ரீராம் கீர்த்தி wrote:
>>
>> Angelo,
>>
>> you can make it like this...
>> Object onSuccessFromMySearchForm() {
>> return "mysearch/results/12345"; // note the '/' 12345 is not a
>> part
>> of the query string but part of the url path itself
>> }
>>
>> and in Results.java use onActivation method ... something like ...
>>
>> @Property
>> private String resultValue;
>>
>> void onActivate( String resultValue) // or you can use int or long.
>> Tapestry
>> will take care ;-)
>> {
>> this.resultValue= resultValue; // member field 'resultValue' will now
>> contain 12345
>> }
>>
>> I am not sure if you needed such a way to solve your problem, but this
>> way
>> will work for the example you have given.
>>
>> - keerthy
>>
>> On Fri, May 1, 2009 at 6:46 PM, Angelo Chen
>> <an...@yahoo.com.hk>wrote:
>>
>>>
>>> Hi,
>>>
>>> following code redirects to a results page under mysearch:
>>>
>>> Object onSuccessFromMySearchForm() {
>>> return "mysearch/results";
>>> }
>>>
>>> now I need to append a query string after the page name:
>>>
>>> return "mysearch/results?12345";
>>>
>>> this will trigger an exception:
>>>
>>> Unable to resolve 'mysearch/results?12345' to a known page name.
>>>
>>> question: how to append a query string to a page name? Thanks,
>>>
>>> Angelo
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23332958.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23344050.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,
the problem is, when it is this which is very common in the query string, T5
will not accept:
mysearch/results/country=US&state=NY
ஸ்ரீராம் கீர்த்தி wrote:
>
> Angelo,
>
> you can make it like this...
> Object onSuccessFromMySearchForm() {
> return "mysearch/results/12345"; // note the '/' 12345 is not a
> part
> of the query string but part of the url path itself
> }
>
> and in Results.java use onActivation method ... something like ...
>
> @Property
> private String resultValue;
>
> void onActivate( String resultValue) // or you can use int or long.
> Tapestry
> will take care ;-)
> {
> this.resultValue= resultValue; // member field 'resultValue' will now
> contain 12345
> }
>
> I am not sure if you needed such a way to solve your problem, but this way
> will work for the example you have given.
>
> - keerthy
>
> On Fri, May 1, 2009 at 6:46 PM, Angelo Chen
> <an...@yahoo.com.hk>wrote:
>
>>
>> Hi,
>>
>> following code redirects to a results page under mysearch:
>>
>> Object onSuccessFromMySearchForm() {
>> return "mysearch/results";
>> }
>>
>> now I need to append a query string after the page name:
>>
>> return "mysearch/results?12345";
>>
>> this will trigger an exception:
>>
>> Unable to resolve 'mysearch/results?12345' to a known page name.
>>
>> question: how to append a query string to a page name? Thanks,
>>
>> Angelo
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23332958.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23343807.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: appending a query string to a page name?
Posted by ஸ்ரீராம் கீர்த்தி <sr...@gmail.com>.
Angelo,
you can make it like this...
Object onSuccessFromMySearchForm() {
return "mysearch/results/12345"; // note the '/' 12345 is not a part
of the query string but part of the url path itself
}
and in Results.java use onActivation method ... something like ...
@Property
private String resultValue;
void onActivate( String resultValue) // or you can use int or long. Tapestry
will take care ;-)
{
this.resultValue= resultValue; // member field 'resultValue' will now
contain 12345
}
I am not sure if you needed such a way to solve your problem, but this way
will work for the example you have given.
- keerthy
On Fri, May 1, 2009 at 6:46 PM, Angelo Chen <an...@yahoo.com.hk>wrote:
>
> Hi,
>
> following code redirects to a results page under mysearch:
>
> Object onSuccessFromMySearchForm() {
> return "mysearch/results";
> }
>
> now I need to append a query string after the page name:
>
> return "mysearch/results?12345";
>
> this will trigger an exception:
>
> Unable to resolve 'mysearch/results?12345' to a known page name.
>
> question: how to append a query string to a page name? Thanks,
>
> Angelo
>
>
> --
> View this message in context:
> http://www.nabble.com/t5%3A-appending-a-query-string-to-a-page-name--tp23332958p23332958.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>