Re: Batch process message to user

2012-06-02 Thread chrome1235
Hi Dan,
Thanks for your reply.
I found a solution with your help. 

public class MyRequestMapper implements IRequestMapper {
PageProvider pageProvider;
final IRequestMapper rootRequestMapper; // original RootMapper
final WicketApplication wicketApplication;
public MyRequestMapper(final IRequestMapper rootRequestMapper,
WicketApplication wicketApplication) {
this.rootRequestMapper= rootRequestMapper;
this.wicketApplication=wicketApplication;
pageProvider= new PageProvider(BusyPage.class);
}
public int getCompatibilityScore(Request request) {
return 0;
}
public Url mapHandler(IRequestHandler iRequestHandler) {
return rootRequestMapper.mapHandler(iRequestHandler);
}
public IRequestHandler mapRequest(Request request) {
if (wicketApplication.isBusy()) {
return new RenderPageRequestHandler(pageProvider);
} 
return rootRequestMapper.mapRequest(request);
}
}

public class WicketApplication extends WebApplication {
public void init()
{
super.init();
mountPage("/Home", HomePage.class);
mountPage("/busy", BusyPage.class);
setRootRequestMapper(new 
MyRequestMapper(getRootRequestMapper(), this));
}

}





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Batch-process-message-to-user-tp4649662p4649674.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Batch process message to user

2012-06-01 Thread Dan Retzlaff
Hi Kemal,

You could register your own root IRequestMapper. See the last paragraph
under "The new way in Wicket 1.5":
https://cwiki.apache.org/WICKET/request-mapping.html

Dan

On Fri, Jun 1, 2012 at 9:52 AM, chrome1235  wrote:

> Hi,
> My Application has some batch processes, therefore I want to response to
> users a message like "server is busy now".
> I mean, all user request will forward to single page. And I want to do it
> in
> Application class, not pages.
>
> Can I solve this problem?
>
>
> Best regards,
> kemal.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Batch-process-message-to-user-tp4649662.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>