You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Major Péter <ma...@sch.bme.hu> on 2010/08/12 00:53:39 UTC
Wicket 1.5-M1 migration experiences
Hi,
I've just tried to move our application to Wicket 1.5-M1, and I've faced
with the following problems:
* new HeaderContributor(new IHeaderContributor() {...} isn't working
anymore, the constructor is gone.
After looking into JavaDoc I've find out that HeaderContributor.forCss
and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
* PageParameters#getAsLong and other helper methods are missing, instead
we have PageParameters#getNamedParameter()#toLong and etc.
There are Indexed Parameters and Named Parameters, what's the difference?
based on the JavaDoc I would thought indexed parameter is like
'/show/id/1' and named is 'show?id=1'
if this is true, why isn't there simply a
getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
both of them?
The deprecated PageParameters constructors are lacking JavaDoc
deprecation note, or it could be a bit enhanced at least.
* AjaxButton now has onError function, which needs to be implemented
* IBehavior#unbind
* In MyApplication I've had a method like this:
@Override
public RequestCycle newRequestCycle(Request request, Response
response) {
if
(!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
return super.newRequestCycle(request, response);
} else {
return new WebRequestCycle(this, (WebRequest) request,
(WebResponse) response) {
@Override
public Page onRuntimeException(Page page,
RuntimeException ex) {
if (ex instanceof PageExpiredException) {
return new PageExpiredError();
}
return new InternalServerError(page, ex);
}
};
}
}
now newRequestCycle is gone, we have createRequestCycle, which is final
and it uses RequestCycleProvider. so changing this to
setRequestCycleProvider(new IRequestCycleProvider() {
@Override
public RequestCycle get(RequestCycleContext context) {
if
(!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
return new RequestCycle(context);
} else {
return new RequestCycle(context) {
@Override
protected IRequestHandler
handleException(Exception e) {
//etc
}
};
}
}
});
should have the same behavior, or??
Also I couldn't find a substitute for this:
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
Where can I find out more about these new requestmapper stuff? (Please
don't say in wicket-examples, I'm looking for a doc, like
https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
Thanks
Regards,
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5-M1 migration experiences
Posted by Martin Grigorov <mg...@apache.org>.
Thanks for the feedback, Peter!
As soon as I have time to look at the points I'll let you know with the
outcome.
Hopefully this will happen this week.
2010/8/12 Major Péter <ma...@sch.bme.hu>
> Hi,
>
> I've just tried to move our application to Wicket 1.5-M1, and I've faced
> with the following problems:
> * new HeaderContributor(new IHeaderContributor() {...} isn't working
> anymore, the constructor is gone.
> After looking into JavaDoc I've find out that HeaderContributor.forCss
> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>
> * PageParameters#getAsLong and other helper methods are missing, instead
> we have PageParameters#getNamedParameter()#toLong and etc.
>
> There are Indexed Parameters and Named Parameters, what's the difference?
> based on the JavaDoc I would thought indexed parameter is like
> '/show/id/1' and named is 'show?id=1'
> if this is true, why isn't there simply a
> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
> both of them?
>
> The deprecated PageParameters constructors are lacking JavaDoc
> deprecation note, or it could be a bit enhanced at least.
>
> * AjaxButton now has onError function, which needs to be implemented
> * IBehavior#unbind
>
> * In MyApplication I've had a method like this:
> @Override
> public RequestCycle newRequestCycle(Request request, Response
> response) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return super.newRequestCycle(request, response);
> } else {
> return new WebRequestCycle(this, (WebRequest) request,
> (WebResponse) response) {
>
> @Override
> public Page onRuntimeException(Page page,
> RuntimeException ex) {
> if (ex instanceof PageExpiredException) {
> return new PageExpiredError();
> }
> return new InternalServerError(page, ex);
> }
> };
> }
> }
>
> now newRequestCycle is gone, we have createRequestCycle, which is final
> and it uses RequestCycleProvider. so changing this to
>
> setRequestCycleProvider(new IRequestCycleProvider() {
>
> @Override
> public RequestCycle get(RequestCycleContext context) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return new RequestCycle(context);
> } else {
> return new RequestCycle(context) {
>
> @Override
> protected IRequestHandler
> handleException(Exception e) {
> //etc
> }
> };
> }
> }
> });
>
> should have the same behavior, or??
>
> Also I couldn't find a substitute for this:
>
> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
> Where can I find out more about these new requestmapper stuff? (Please
> don't say in wicket-examples, I'm looking for a doc, like
> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>
> Thanks
>
> Regards,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket 1.5-M1 migration experiences
Posted by Matej Knopp <ma...@inmethod.com>.
We don't have convenience urlfor methods on request cycle any more,
however there is a convenience urlFor(Class, PageParameters) on
Component, so look there to see how it's done.
Instead of setRequestTarget you can do this
RequestCycle#scheduleRequestHandlerAfterCurrent(handler)
-Matej
2010/8/12 Major Péter <ma...@sch.bme.hu>:
> What's the substitute for RequestCycle#urlFor(Class, PageParameters) ?
>
> In 1.4 I was using RequestCycle#setRequestTarget(IResourceStream) and
> ResourceStreamRequestTarget to make dynamically generated PDF/CSV/etc
> files downloadable for users. How is that possible in 1.5-M1?
>
> Thanks,
> Peter
>
> 2010-08-12 12:11 keltezéssel, Martin Grigorov írta:
>> Good catch!
>>
>> There is no WebRequestCycle anymore. You'll need to extend RequestCycle now.
>> Override org.apache.wicket.Application.createRequestCycle(Request, Response)
>> to return your class.
>> The current entry point
>> is org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
>> For now you'll have to wrap this method with try/finally to simulate
>> onBefore/onEnd.
>>
>> We will discuss it and probably these two methods will be added again there
>> for M2.
>>
>> 2010/8/12 dzb <ze...@gmail.com>
>>
>>> Hi,
>>>
>>> It seems RequestCycle has a big change in 1.5-M1.
>>>
>>> How can I do things like below codes on 1.5 ?
>>>
>>> public class MyRequestCycle extends WebRequestCycle {
>>>
>>> @Override
>>> protected void onBeginRequest() {
>>> super.onBeginRequest();
>>> ...
>>> }
>>>
>>> @Override
>>> protected void onEndRequest() {
>>> ...
>>> super.onEndRequest();
>>> }
>>> }
>>>
>>> Where is the request pipline's entry?
>>>
>>> dzb,zenberg.ding@gmail.com
>>> 2010-08-12
>>> ----- Original Message -----
>>> From: Major_P閠er
>>> To: users
>>> Sent: 2010-08-12, 06:53:39
>>> Subject: Wicket 1.5-M1 migration experiences
>>>
>>>
>>> Hi,
>>>
>>> I've just tried to move our application to Wicket 1.5-M1, and I've faced
>>> with the following problems:
>>> * new HeaderContributor(new IHeaderContributor() {...} isn't working
>>> anymore, the constructor is gone.
>>> After looking into JavaDoc I've find out that HeaderContributor.forCss
>>> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>>>
>>> * PageParameters#getAsLong and other helper methods are missing, instead
>>> we have PageParameters#getNamedParameter()#toLong and etc.
>>>
>>> There are Indexed Parameters and Named Parameters, what's the difference?
>>> based on the JavaDoc I would thought indexed parameter is like
>>> '/show/id/1' and named is 'show?id=1'
>>> if this is true, why isn't there simply a
>>> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
>>> both of them?
>>>
>>> The deprecated PageParameters constructors are lacking JavaDoc
>>> deprecation note, or it could be a bit enhanced at least.
>>>
>>> * AjaxButton now has onError function, which needs to be implemented
>>> * IBehavior#unbind
>>>
>>> * In MyApplication I've had a method like this:
>>> @Override
>>> public RequestCycle newRequestCycle(Request request, Response
>>> response) {
>>> if
>>> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
>>> return super.newRequestCycle(request, response);
>>> } else {
>>> return new WebRequestCycle(this, (WebRequest) request,
>>> (WebResponse) response) {
>>>
>>> @Override
>>> public Page onRuntimeException(Page page,
>>> RuntimeException ex) {
>>> if (ex instanceof PageExpiredException) {
>>> return new PageExpiredError();
>>> }
>>> return new InternalServerError(page, ex);
>>> }
>>> };
>>> }
>>> }
>>>
>>> now newRequestCycle is gone, we have createRequestCycle, which is final
>>> and it uses RequestCycleProvider. so changing this to
>>>
>>> setRequestCycleProvider(new IRequestCycleProvider() {
>>>
>>> @Override
>>> public RequestCycle get(RequestCycleContext context) {
>>> if
>>> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
>>> return new RequestCycle(context);
>>> } else {
>>> return new RequestCycle(context) {
>>>
>>> @Override
>>> protected IRequestHandler
>>> handleException(Exception e) {
>>> //etc
>>> }
>>> };
>>> }
>>> }
>>> });
>>>
>>> should have the same behavior, or??
>>>
>>> Also I couldn't find a substitute for this:
>>>
>>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
>>> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
>>> Where can I find out more about these new requestmapper stuff? (Please
>>> don't say in wicket-examples, I'm looking for a doc, like
>>> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>>>
>>> Thanks
>>>
>>> Regards,
>>> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5-M1 migration experiences
Posted by Major Péter <ma...@sch.bme.hu>.
What's the substitute for RequestCycle#urlFor(Class, PageParameters) ?
In 1.4 I was using RequestCycle#setRequestTarget(IResourceStream) and
ResourceStreamRequestTarget to make dynamically generated PDF/CSV/etc
files downloadable for users. How is that possible in 1.5-M1?
Thanks,
Peter
2010-08-12 12:11 keltezéssel, Martin Grigorov írta:
> Good catch!
>
> There is no WebRequestCycle anymore. You'll need to extend RequestCycle now.
> Override org.apache.wicket.Application.createRequestCycle(Request, Response)
> to return your class.
> The current entry point
> is org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
> For now you'll have to wrap this method with try/finally to simulate
> onBefore/onEnd.
>
> We will discuss it and probably these two methods will be added again there
> for M2.
>
> 2010/8/12 dzb <ze...@gmail.com>
>
>> Hi,
>>
>> It seems RequestCycle has a big change in 1.5-M1.
>>
>> How can I do things like below codes on 1.5 ?
>>
>> public class MyRequestCycle extends WebRequestCycle {
>>
>> @Override
>> protected void onBeginRequest() {
>> super.onBeginRequest();
>> ...
>> }
>>
>> @Override
>> protected void onEndRequest() {
>> ...
>> super.onEndRequest();
>> }
>> }
>>
>> Where is the request pipline's entry?
>>
>> dzb,zenberg.ding@gmail.com
>> 2010-08-12
>> ----- Original Message -----
>> From: Major_P閠er
>> To: users
>> Sent: 2010-08-12, 06:53:39
>> Subject: Wicket 1.5-M1 migration experiences
>>
>>
>> Hi,
>>
>> I've just tried to move our application to Wicket 1.5-M1, and I've faced
>> with the following problems:
>> * new HeaderContributor(new IHeaderContributor() {...} isn't working
>> anymore, the constructor is gone.
>> After looking into JavaDoc I've find out that HeaderContributor.forCss
>> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>>
>> * PageParameters#getAsLong and other helper methods are missing, instead
>> we have PageParameters#getNamedParameter()#toLong and etc.
>>
>> There are Indexed Parameters and Named Parameters, what's the difference?
>> based on the JavaDoc I would thought indexed parameter is like
>> '/show/id/1' and named is 'show?id=1'
>> if this is true, why isn't there simply a
>> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
>> both of them?
>>
>> The deprecated PageParameters constructors are lacking JavaDoc
>> deprecation note, or it could be a bit enhanced at least.
>>
>> * AjaxButton now has onError function, which needs to be implemented
>> * IBehavior#unbind
>>
>> * In MyApplication I've had a method like this:
>> @Override
>> public RequestCycle newRequestCycle(Request request, Response
>> response) {
>> if
>> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
>> return super.newRequestCycle(request, response);
>> } else {
>> return new WebRequestCycle(this, (WebRequest) request,
>> (WebResponse) response) {
>>
>> @Override
>> public Page onRuntimeException(Page page,
>> RuntimeException ex) {
>> if (ex instanceof PageExpiredException) {
>> return new PageExpiredError();
>> }
>> return new InternalServerError(page, ex);
>> }
>> };
>> }
>> }
>>
>> now newRequestCycle is gone, we have createRequestCycle, which is final
>> and it uses RequestCycleProvider. so changing this to
>>
>> setRequestCycleProvider(new IRequestCycleProvider() {
>>
>> @Override
>> public RequestCycle get(RequestCycleContext context) {
>> if
>> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
>> return new RequestCycle(context);
>> } else {
>> return new RequestCycle(context) {
>>
>> @Override
>> protected IRequestHandler
>> handleException(Exception e) {
>> //etc
>> }
>> };
>> }
>> }
>> });
>>
>> should have the same behavior, or??
>>
>> Also I couldn't find a substitute for this:
>>
>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
>> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
>> Where can I find out more about these new requestmapper stuff? (Please
>> don't say in wicket-examples, I'm looking for a doc, like
>> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>>
>> Thanks
>>
>> Regards,
>> Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Re: Wicket 1.5-M1 migration experiences
Posted by dzb <ze...@gmail.com>.
Thanks peter, I'll handle that
dzb,zenberg.ding@gmail.com
2010-08-12
----- Original Message -----
From: Major Péter
To: users
Sent: 2010-08-12, 18:19:55
Subject: Re: Wicket 1.5-M1 migration experiences
Hi,
> There is no WebRequestCycle anymore. You'll need to extend RequestCycle now.
> Override org.apache.wicket.Application.createRequestCycle(Request, Response)
> to return your class.
that method is final, you should use setRequestCycleProvider() IMHO.
Regards,
Peter
> The current entry point
> is org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
> For now you'll have to wrap this method with try/finally to simulate
> onBefore/onEnd.
>
> We will discuss it and probably these two methods will be added again there
> for M2.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5-M1 migration experiences
Posted by Major Péter <ma...@sch.bme.hu>.
Hi,
> There is no WebRequestCycle anymore. You'll need to extend RequestCycle now.
> Override org.apache.wicket.Application.createRequestCycle(Request, Response)
> to return your class.
that method is final, you should use setRequestCycleProvider() IMHO.
Regards,
Peter
> The current entry point
> is org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
> For now you'll have to wrap this method with try/finally to simulate
> onBefore/onEnd.
>
> We will discuss it and probably these two methods will be added again there
> for M2.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Re: Wicket 1.5-M1 migration experiences
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
Correct!
Please add your findings in the wiki about migration [1] so that other users
can benefit too.
Thanks for your help!
1.
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5
2010/8/12 dzb <ze...@gmail.com>
> Hi, Martin Grigorov
>
> sorry, still about RequestCycle.
>
> There's a another method wicket users preffer to override for custom
> exception page on RequestCycle on 1.4.x.
>
> public Page onRuntimeException(Page page, RuntimeException e) {
> ...
> DB transaction rollback .
> ...
> if (e instanceof MyException) return new MyErrorPage(e);
> ...
> }
>
> so, we should create a new ExceptionMapper class to handle that, right?
>
>
> dzb,zenberg.ding@gmail.com
> 2010-08-12
>
> ----- Original Message -----
> *From: *Martin Grigorov <mg...@apache.org>
> *To: *users,zenberg.ding <us...@gmail.com>
> *Sent: *2010-08-12, 18:11:39
> *Subject: *Re: Wicket 1.5-M1 migration experiences
>
> Good catch!
>
> There is no WebRequestCycle anymore. You'll need to extend RequestCycle
> now.
> Override org.apache.wicket.Application.createRequestCycle(Request,
> Response) to return your class.
> The current entry point is
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
> For now you'll have to wrap this method with try/finally to simulate
> onBefore/onEnd.
>
> We will discuss it and probably these two methods will be added again there
> for M2.
>
> 2010/8/12 dzb <ze...@gmail.com>
>
>> Hi,
>>
>> It seems RequestCycle has a big change in 1.5-M1.
>>
>> How can I do things like below codes on 1.5 ?
>>
>> public class MyRequestCycle extends WebRequestCycle {
>>
>> @Override
>> protected void onBeginRequest() {
>> super.onBeginRequest();
>> ...
>> }
>>
>> @Override
>> protected void onEndRequest() {
>> ...
>> super.onEndRequest();
>> }
>> }
>>
>> Where is the request pipline's entry?
>>
>> dzb,zenberg.ding@gmail.com
>> 2010-08-12
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
Re: Wicket 1.5-M1 migration experiences
Posted by Martin Grigorov <mg...@apache.org>.
Good catch!
There is no WebRequestCycle anymore. You'll need to extend RequestCycle now.
Override org.apache.wicket.Application.createRequestCycle(Request, Response)
to return your class.
The current entry point
is org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
For now you'll have to wrap this method with try/finally to simulate
onBefore/onEnd.
We will discuss it and probably these two methods will be added again there
for M2.
2010/8/12 dzb <ze...@gmail.com>
> Hi,
>
> It seems RequestCycle has a big change in 1.5-M1.
>
> How can I do things like below codes on 1.5 ?
>
> public class MyRequestCycle extends WebRequestCycle {
>
> @Override
> protected void onBeginRequest() {
> super.onBeginRequest();
> ...
> }
>
> @Override
> protected void onEndRequest() {
> ...
> super.onEndRequest();
> }
> }
>
> Where is the request pipline's entry?
>
> dzb,zenberg.ding@gmail.com
> 2010-08-12
> ----- Original Message -----
> From: Major_P閠er
> To: users
> Sent: 2010-08-12, 06:53:39
> Subject: Wicket 1.5-M1 migration experiences
>
>
> Hi,
>
> I've just tried to move our application to Wicket 1.5-M1, and I've faced
> with the following problems:
> * new HeaderContributor(new IHeaderContributor() {...} isn't working
> anymore, the constructor is gone.
> After looking into JavaDoc I've find out that HeaderContributor.forCss
> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>
> * PageParameters#getAsLong and other helper methods are missing, instead
> we have PageParameters#getNamedParameter()#toLong and etc.
>
> There are Indexed Parameters and Named Parameters, what's the difference?
> based on the JavaDoc I would thought indexed parameter is like
> '/show/id/1' and named is 'show?id=1'
> if this is true, why isn't there simply a
> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
> both of them?
>
> The deprecated PageParameters constructors are lacking JavaDoc
> deprecation note, or it could be a bit enhanced at least.
>
> * AjaxButton now has onError function, which needs to be implemented
> * IBehavior#unbind
>
> * In MyApplication I've had a method like this:
> @Override
> public RequestCycle newRequestCycle(Request request, Response
> response) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return super.newRequestCycle(request, response);
> } else {
> return new WebRequestCycle(this, (WebRequest) request,
> (WebResponse) response) {
>
> @Override
> public Page onRuntimeException(Page page,
> RuntimeException ex) {
> if (ex instanceof PageExpiredException) {
> return new PageExpiredError();
> }
> return new InternalServerError(page, ex);
> }
> };
> }
> }
>
> now newRequestCycle is gone, we have createRequestCycle, which is final
> and it uses RequestCycleProvider. so changing this to
>
> setRequestCycleProvider(new IRequestCycleProvider() {
>
> @Override
> public RequestCycle get(RequestCycleContext context) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return new RequestCycle(context);
> } else {
> return new RequestCycle(context) {
>
> @Override
> protected IRequestHandler
> handleException(Exception e) {
> //etc
> }
> };
> }
> }
> });
>
> should have the same behavior, or??
>
> Also I couldn't find a substitute for this:
>
> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
> Where can I find out more about these new requestmapper stuff? (Please
> don't say in wicket-examples, I'm looking for a doc, like
> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>
> Thanks
>
> Regards,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
Re: Wicket 1.5-M1 migration experiences
Posted by dzb <ze...@gmail.com>.
Hi,
It seems RequestCycle has a big change in 1.5-M1.
How can I do things like below codes on 1.5 ?
public class MyRequestCycle extends WebRequestCycle {
@Override
protected void onBeginRequest() {
super.onBeginRequest();
...
}
@Override
protected void onEndRequest() {
...
super.onEndRequest();
}
}
Where is the request pipline's entry?
dzb��zenberg.ding@gmail.com
2010-08-12
----- Original Message -----
From: Major_P�ter
To: users
Sent: 2010-08-12, 06:53:39
Subject: Wicket 1.5-M1 migration experiences
Hi,
I've just tried to move our application to Wicket 1.5-M1, and I've faced
with the following problems:
* new HeaderContributor(new IHeaderContributor() {...} isn't working
anymore, the constructor is gone.
After looking into JavaDoc I've find out that HeaderContributor.forCss
and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
* PageParameters#getAsLong and other helper methods are missing, instead
we have PageParameters#getNamedParameter()#toLong and etc.
There are Indexed Parameters and Named Parameters, what's the difference?
based on the JavaDoc I would thought indexed parameter is like
'/show/id/1' and named is 'show?id=1'
if this is true, why isn't there simply a
getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
both of them?
The deprecated PageParameters constructors are lacking JavaDoc
deprecation note, or it could be a bit enhanced at least.
* AjaxButton now has onError function, which needs to be implemented
* IBehavior#unbind
* In MyApplication I've had a method like this:
@Override
public RequestCycle newRequestCycle(Request request, Response
response) {
if
(!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
return super.newRequestCycle(request, response);
} else {
return new WebRequestCycle(this, (WebRequest) request,
(WebResponse) response) {
@Override
public Page onRuntimeException(Page page,
RuntimeException ex) {
if (ex instanceof PageExpiredException) {
return new PageExpiredError();
}
return new InternalServerError(page, ex);
}
};
}
}
now newRequestCycle is gone, we have createRequestCycle, which is final
and it uses RequestCycleProvider. so changing this to
setRequestCycleProvider(new IRequestCycleProvider() {
@Override
public RequestCycle get(RequestCycleContext context) {
if
(!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
return new RequestCycle(context);
} else {
return new RequestCycle(context) {
@Override
protected IRequestHandler
handleException(Exception e) {
//etc
}
};
}
}
});
should have the same behavior, or??
Also I couldn't find a substitute for this:
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
Where can I find out more about these new requestmapper stuff? (Please
don't say in wicket-examples, I'm looking for a doc, like
https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
Thanks
Regards,
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5-M1 migration experiences
Posted by Martin Grigorov <mg...@apache.org>.
See my comments inline.
2010/8/12 Major Péter <ma...@sch.bme.hu>
> Hi,
>
> I've just tried to move our application to Wicket 1.5-M1, and I've faced
> with the following problems:
> * new HeaderContributor(new IHeaderContributor() {...} isn't working
> anymore, the constructor is gone.
>
HeaderContributor is removed now in 1.5.
> After looking into JavaDoc I've find out that HeaderContributor.forCss
> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>
Component and IBehavior implement IHeaderContributor and too add js/css
you'll need to override renderHead(IHeaderResponse)
>
> * PageParameters#getAsLong and other helper methods are missing, instead
> we have PageParameters#getNamedParameter()#toLong and etc.
>
> There are Indexed Parameters and Named Parameters, what's the difference?
> based on the JavaDoc I would thought indexed parameter is like
> '/show/id/1' and named is 'show?id=1'
> if this is true, why isn't there simply a
> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
> both of them?
>
Johan described it already earlier.
Also
see org.apache.wicket.request.Request: getPostParameters(),
getQueryParameters()
and getRequestParameters()
>
> The deprecated PageParameters constructors are lacking JavaDoc
> deprecation note, or it could be a bit enhanced at least.
>
> * AjaxButton now has onError function, which needs to be implemented
> * IBehavior#unbind
>
> * In MyApplication I've had a method like this:
> @Override
> public RequestCycle newRequestCycle(Request request, Response
> response) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return super.newRequestCycle(request, response);
> } else {
> return new WebRequestCycle(this, (WebRequest) request,
> (WebResponse) response) {
>
> @Override
> public Page onRuntimeException(Page page,
> RuntimeException ex) {
> if (ex instanceof PageExpiredException) {
> return new PageExpiredError();
> }
> return new InternalServerError(page, ex);
> }
> };
> }
> }
>
> now newRequestCycle is gone, we have createRequestCycle, which is final
> and it uses RequestCycleProvider. so changing this to
>
> setRequestCycleProvider(new IRequestCycleProvider() {
>
> @Override
> public RequestCycle get(RequestCycleContext context) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return new RequestCycle(context);
> } else {
> return new RequestCycle(context) {
>
> @Override
> protected IRequestHandler
> handleException(Exception e) {
> //etc
> }
> };
> }
> }
> });
>
> should have the same behavior, or??
>
Will work, but better extend
org.apache.wicket.Application.newExceptionMapper().
>
> Also I couldn't find a substitute for this:
>
> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
> Where can I find out more about these new requestmapper stuff? (Please
> don't say in wicket-examples, I'm looking for a doc, like
> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>
> Indeed it seems we missed this mapper.I'll create a ticket for it and I'll
see what I can do with such docu.
> Thanks
>
> Regards,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket 1.5-M1 migration experiences
Posted by Major Péter <ma...@sch.bme.hu>.
hmm, that makes (more) sense, thanks for the clarification.
Peter
2010-08-12 09:46 keltezéssel, Johan Compagner írta:
> If NamedParameter is something like;
>
> /show?id=10&test=11
>
> IndexedParameter is not something like:
>
> /show/id/10/test/11
>
> thats still named, just differently outputed, but
>
> show/10/11
>
> indexed then the name is presumed (its 1 ,2 ,3 ,...)
>
> johan
>
>
> 2010/8/12 Major Péter <ma...@sch.bme.hu>:
>> Hi,
>>
>> I've just tried to move our application to Wicket 1.5-M1, and I've faced
>> with the following problems:
>> * new HeaderContributor(new IHeaderContributor() {...} isn't working
>> anymore, the constructor is gone.
>> After looking into JavaDoc I've find out that HeaderContributor.forCss
>> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>>
>> * PageParameters#getAsLong and other helper methods are missing, instead
>> we have PageParameters#getNamedParameter()#toLong and etc.
>>
>> There are Indexed Parameters and Named Parameters, what's the difference?
>> based on the JavaDoc I would thought indexed parameter is like
>> '/show/id/1' and named is 'show?id=1'
>> if this is true, why isn't there simply a
>> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
>> both of them?
>>
>> The deprecated PageParameters constructors are lacking JavaDoc
>> deprecation note, or it could be a bit enhanced at least.
>>
>> * AjaxButton now has onError function, which needs to be implemented
>> * IBehavior#unbind
>>
>> * In MyApplication I've had a method like this:
>> @Override
>> public RequestCycle newRequestCycle(Request request, Response
>> response) {
>> if
>> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
>> return super.newRequestCycle(request, response);
>> } else {
>> return new WebRequestCycle(this, (WebRequest) request,
>> (WebResponse) response) {
>>
>> @Override
>> public Page onRuntimeException(Page page,
>> RuntimeException ex) {
>> if (ex instanceof PageExpiredException) {
>> return new PageExpiredError();
>> }
>> return new InternalServerError(page, ex);
>> }
>> };
>> }
>> }
>>
>> now newRequestCycle is gone, we have createRequestCycle, which is final
>> and it uses RequestCycleProvider. so changing this to
>>
>> setRequestCycleProvider(new IRequestCycleProvider() {
>>
>> @Override
>> public RequestCycle get(RequestCycleContext context) {
>> if
>> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
>> return new RequestCycle(context);
>> } else {
>> return new RequestCycle(context) {
>>
>> @Override
>> protected IRequestHandler
>> handleException(Exception e) {
>> //etc
>> }
>> };
>> }
>> }
>> });
>>
>> should have the same behavior, or??
>>
>> Also I couldn't find a substitute for this:
>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
>> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
>> Where can I find out more about these new requestmapper stuff? (Please
>> don't say in wicket-examples, I'm looking for a doc, like
>> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>>
>> Thanks
>>
>> Regards,
>> Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5-M1 migration experiences
Posted by Johan Compagner <jc...@gmail.com>.
If NamedParameter is something like;
/show?id=10&test=11
IndexedParameter is not something like:
/show/id/10/test/11
thats still named, just differently outputed, but
show/10/11
indexed then the name is presumed (its 1 ,2 ,3 ,...)
johan
2010/8/12 Major Péter <ma...@sch.bme.hu>:
> Hi,
>
> I've just tried to move our application to Wicket 1.5-M1, and I've faced
> with the following problems:
> * new HeaderContributor(new IHeaderContributor() {...} isn't working
> anymore, the constructor is gone.
> After looking into JavaDoc I've find out that HeaderContributor.forCss
> and other methods are deprecated in 1.4.9, but not in 1.5-M1, so wtf?
>
> * PageParameters#getAsLong and other helper methods are missing, instead
> we have PageParameters#getNamedParameter()#toLong and etc.
>
> There are Indexed Parameters and Named Parameters, what's the difference?
> based on the JavaDoc I would thought indexed parameter is like
> '/show/id/1' and named is 'show?id=1'
> if this is true, why isn't there simply a
> getParameterIDon'tCareAboutTheTypeOfIt function, if I want to support
> both of them?
>
> The deprecated PageParameters constructors are lacking JavaDoc
> deprecation note, or it could be a bit enhanced at least.
>
> * AjaxButton now has onError function, which needs to be implemented
> * IBehavior#unbind
>
> * In MyApplication I've had a method like this:
> @Override
> public RequestCycle newRequestCycle(Request request, Response
> response) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return super.newRequestCycle(request, response);
> } else {
> return new WebRequestCycle(this, (WebRequest) request,
> (WebResponse) response) {
>
> @Override
> public Page onRuntimeException(Page page,
> RuntimeException ex) {
> if (ex instanceof PageExpiredException) {
> return new PageExpiredError();
> }
> return new InternalServerError(page, ex);
> }
> };
> }
> }
>
> now newRequestCycle is gone, we have createRequestCycle, which is final
> and it uses RequestCycleProvider. so changing this to
>
> setRequestCycleProvider(new IRequestCycleProvider() {
>
> @Override
> public RequestCycle get(RequestCycleContext context) {
> if
> (!Configuration.getEnvironment().equals(Environment.PRODUCTION)) {
> return new RequestCycle(context);
> } else {
> return new RequestCycle(context) {
>
> @Override
> protected IRequestHandler
> handleException(Exception e) {
> //etc
> }
> };
> }
> }
> });
>
> should have the same behavior, or??
>
> Also I couldn't find a substitute for this:
> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/protocol/http/WebApplication.html#mount(java.lang.String,%20org.apache.wicket.util.lang.PackageName)
> and also for HybridUrlCodingStrategy. Or is hybrid even needed anymore?
> Where can I find out more about these new requestmapper stuff? (Please
> don't say in wicket-examples, I'm looking for a doc, like
> https://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies )
>
> Thanks
>
> Regards,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org