Re: Terracotta Sessions and Wicket

2011-09-06 Thread Jeremy Levy
Actually, after thinking about this some more, it has nothing to do with the
jvmRoute on the session per se, it's because the node from which the session
originated never has the unbind/method called for that session.



On Tue, Sep 6, 2011 at 7:44 PM, Jeremy Levy  wrote:

> We've been using Terracotta Sessions with Wicket successfully for some time
> now with a fairly onerous side effect. The DiskPageStore temporary directory
> grows steadily and never gets cleaned up, eventually leading to us having to
> manually go and clean up the directory.
>
> The issue appears to be that if a session fails over to the other node it
> maintains the sessionid from the other server (as expected) however, because
> we use sticky sessions via the jvmRoute in tomcat a session ID looks like
> "2uWDurCx3V07Oe8LBn0V.node1" even if its currently on node2.
>
> Therefore when the unbind/cleanup method of DiskPageStore/SessionEntry
> attempts to clean it up it doesn't find anything and leaves the orphaned
> session on the node where the session originated.
>
> I was thinking that a easy fix for this would be to extend the
> DiskPageStore and have it ignore the jvmRoute when serializing the session.
> Does this sound like a good idea?
>
> Thanks.
>
> Jeremy
>
>
>
> --
> Jeremy Levy
>



-- 
Jeremy Levy


Terracotta Sessions and Wicket

2011-09-06 Thread Jeremy Levy
We've been using Terracotta Sessions with Wicket successfully for some time
now with a fairly onerous side effect. The DiskPageStore temporary directory
grows steadily and never gets cleaned up, eventually leading to us having to
manually go and clean up the directory.

The issue appears to be that if a session fails over to the other node it
maintains the sessionid from the other server (as expected) however, because
we use sticky sessions via the jvmRoute in tomcat a session ID looks like
"2uWDurCx3V07Oe8LBn0V.node1" even if its currently on node2.

Therefore when the unbind/cleanup method of DiskPageStore/SessionEntry
attempts to clean it up it doesn't find anything and leaves the orphaned
session on the node where the session originated.

I was thinking that a easy fix for this would be to extend the DiskPageStore
and have it ignore the jvmRoute when serializing the session. Does this
sound like a good idea?

Thanks.

Jeremy



-- 
Jeremy Levy


Re: Include wicket into jsp page

2011-09-06 Thread Martin Grigorov
Few years back I also had to do this exercise. But we just started
removing JSP pages and replacing them with Wicket based ones.
So we just had to generate proper links in both directions.

Another approach which is similar to what you do is described at
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/

On Tue, Sep 6, 2011 at 4:57 PM, Ilya German  wrote:
> Hello!
>
> We're slowly migrating a big legacy jsp application into wicket and I'm
> evaluating the ways incorporate wicket components into existing jsp pages.
> Right now I'm trying to figure out how to include a wicket component through
>  tag. As I've spent some time debugging I think that's what's
> going on:
>
> 1. When I use the  tag the RequestDispatcher.include(request,
> response, ...) is being called.
> 2. The RequestDispatcher tries to preserve original Request, so it puts the
> actual include's request URI into some attribute inside the request, while
> leaving the original requestURI and contextPath unmodified from the original
> request - I see that Catalina's servlets (e.g. DefaultServlet) specifically
> accounts for the case that the request might be from include and, later,
> grabs the URI from these attributes.
> 3. Once WicketFilter tries to determine whether the request is to be
> processed by Wicket it takes the requestURI and contextPath from the
> original Request and ignores the path I've used in  tag.
>
> As far as I understand I can try to modify the Request and replace the
> requestURI and the contextPath with the ones I need (from the tag), but
> before I go through this path I wanted to do a sanity check :)
>
> Is there, perhaps, a more convenient way to achieve the same result? Would
> there be some gotchas to look out for?
>
> Regards,
> Ilya
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Include wicket into jsp page

2011-09-06 Thread Ilya German
Hello!

We're slowly migrating a big legacy jsp application into wicket and I'm
evaluating the ways incorporate wicket components into existing jsp pages.
Right now I'm trying to figure out how to include a wicket component through
 tag. As I've spent some time debugging I think that's what's
going on:

1. When I use the  tag the RequestDispatcher.include(request,
response, ...) is being called.
2. The RequestDispatcher tries to preserve original Request, so it puts the
actual include's request URI into some attribute inside the request, while
leaving the original requestURI and contextPath unmodified from the original
request - I see that Catalina's servlets (e.g. DefaultServlet) specifically
accounts for the case that the request might be from include and, later,
grabs the URI from these attributes.
3. Once WicketFilter tries to determine whether the request is to be
processed by Wicket it takes the requestURI and contextPath from the
original Request and ignores the path I've used in  tag.

As far as I understand I can try to modify the Request and replace the
requestURI and the contextPath with the ones I need (from the tag), but
before I go through this path I wanted to do a sanity check :)

Is there, perhaps, a more convenient way to achieve the same result? Would
there be some gotchas to look out for?

Regards,
Ilya


Re: [Migration 1.5] Is StatelessChecker not providing hints on stateful component anymore?

2011-09-06 Thread Mike Mander

Ah, thanks.

Mike

This is fixed in trunk. The fix will be available in 1.5.1

On Tue, Sep 6, 2011 at 3:34 PM, Mike Mander  wrote:

Hi Martin,

the page itself has no behavior attached. I use a stateless form with
behaviors on components.
On first call check is passed. If i don't provide values and press submit
(validation fails) then
StatelessChecker complains.

The page stateless flag is set by PageProvider
/**
 * Creates a new page provider object. Upon calling of {@link
#getPageInstance()} this provider
 * will return the given page instance.
 *
 * @param page
 */
public PageProvider(IRequestablePage page)
{
Args.notNull(page, "page");

pageInstance = page;
pageId = page.getPageId();
renderCount = page.getRenderCount();
if (pageInstance instanceof Page)
{
((Page)pageInstance).setStatelessHint(false);
}
}

This was working in 1.4. How can i migrate that?
Thanks
Mike


That message means that you have a stateful behavior attached to the
page itself.

On Tue, Sep 6, 2011 at 1:04 PM, Mike Manderwrote:

Hi,

i use StatelessChecker from dev-utils. In 1.4 if a page was not stateless
the checker told me the offending component.
But now in 1.5 i only get this message:
ERROR - DefaultExceptionMapper - Unexpected error occurred
java.lang.IllegalArgumentException: '[Page class =
catalog.request.CatalogRequestPage, id = 5, render count = 1]' claims to
be
stateless but isn't. Possible reasons: no stateless hint, statefull
behaviors

The stateless hint for page is set. But it seems that a behavior is
stateful.
How can i identify the stateful behavior?

Thanks
Mike

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






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








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



getImageData() of Image not called on component instantiation in IE

2011-09-06 Thread martin . asenov



Hello, 


I have the following problem. I have a repeater which declares Images as
so: 


 NonCachingImage image1 = new NonCachingImage("image1", new
BufferedDynamicImageResource() { 


 private static final long serialVersionUID = 1L; 


 @Override
 protected byte[] getImageData() { 


 return detachable.getObject().getItem1().getThumbData(); 


 } 


 }); 


When the repeater is rendered and displayed in IE, getImageData is not
called and therefore images are not shown. However, if I copy the image src
and hit that URL, the image gets loaded. 


I believe for some reason IE thinks the image is cached, although it has
never beed loaded and therefore does not retrieve the source of the image.
Don't know if this is the real reason. 


Has anybody been into this issue before? 


Regards,
Martin

-

Сега е по-лесно да получиш най-добрата куриерска услуга на 
телефон *3456(*DHL6)
 http://www.dhl.bg/bg.html

Re: [Migration 1.5] Is StatelessChecker not providing hints on stateful component anymore?

2011-09-06 Thread Martin Grigorov
This is fixed in trunk. The fix will be available in 1.5.1

On Tue, Sep 6, 2011 at 3:34 PM, Mike Mander  wrote:
> Hi Martin,
>
> the page itself has no behavior attached. I use a stateless form with
> behaviors on components.
> On first call check is passed. If i don't provide values and press submit
> (validation fails) then
> StatelessChecker complains.
>
> The page stateless flag is set by PageProvider
>    /**
>     * Creates a new page provider object. Upon calling of {@link
> #getPageInstance()} this provider
>     * will return the given page instance.
>     *
>     * @param page
>     */
>    public PageProvider(IRequestablePage page)
>    {
>        Args.notNull(page, "page");
>
>        pageInstance = page;
>        pageId = page.getPageId();
>        renderCount = page.getRenderCount();
>        if (pageInstance instanceof Page)
>        {
>            ((Page)pageInstance).setStatelessHint(false);
>        }
>    }
>
> This was working in 1.4. How can i migrate that?
> Thanks
> Mike
>
>> That message means that you have a stateful behavior attached to the
>> page itself.
>>
>> On Tue, Sep 6, 2011 at 1:04 PM, Mike Mander  wrote:
>>>
>>> Hi,
>>>
>>> i use StatelessChecker from dev-utils. In 1.4 if a page was not stateless
>>> the checker told me the offending component.
>>> But now in 1.5 i only get this message:
>>> ERROR - DefaultExceptionMapper     - Unexpected error occurred
>>> java.lang.IllegalArgumentException: '[Page class =
>>> catalog.request.CatalogRequestPage, id = 5, render count = 1]' claims to
>>> be
>>> stateless but isn't. Possible reasons: no stateless hint, statefull
>>> behaviors
>>>
>>> The stateless hint for page is set. But it seems that a behavior is
>>> stateful.
>>> How can i identify the stateful behavior?
>>>
>>> Thanks
>>> Mike
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: [Migration 1.5] Is StatelessChecker not providing hints on stateful component anymore?

2011-09-06 Thread Mike Mander

Hi Martin,

the page itself has no behavior attached. I use a stateless form with 
behaviors on components.
On first call check is passed. If i don't provide values and press 
submit (validation fails) then

StatelessChecker complains.

The page stateless flag is set by PageProvider
/**
 * Creates a new page provider object. Upon calling of {@link 
#getPageInstance()} this provider

 * will return the given page instance.
 *
 * @param page
 */
public PageProvider(IRequestablePage page)
{
Args.notNull(page, "page");

pageInstance = page;
pageId = page.getPageId();
renderCount = page.getRenderCount();
if (pageInstance instanceof Page)
{
((Page)pageInstance).setStatelessHint(false);
}
}

This was working in 1.4. How can i migrate that?
Thanks
Mike


That message means that you have a stateful behavior attached to the
page itself.

On Tue, Sep 6, 2011 at 1:04 PM, Mike Mander  wrote:

Hi,

i use StatelessChecker from dev-utils. In 1.4 if a page was not stateless
the checker told me the offending component.
But now in 1.5 i only get this message:
ERROR - DefaultExceptionMapper - Unexpected error occurred
java.lang.IllegalArgumentException: '[Page class =
catalog.request.CatalogRequestPage, id = 5, render count = 1]' claims to be
stateless but isn't. Possible reasons: no stateless hint, statefull
behaviors

The stateless hint for page is set. But it seems that a behavior is
stateful.
How can i identify the stateful behavior?

Thanks
Mike

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








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



Re: [Migration 1.5] Is StatelessChecker not providing hints on stateful component anymore?

2011-09-06 Thread Martin Grigorov
That message means that you have a stateful behavior attached to the
page itself.

On Tue, Sep 6, 2011 at 1:04 PM, Mike Mander  wrote:
> Hi,
>
> i use StatelessChecker from dev-utils. In 1.4 if a page was not stateless
> the checker told me the offending component.
> But now in 1.5 i only get this message:
> ERROR - DefaultExceptionMapper     - Unexpected error occurred
> java.lang.IllegalArgumentException: '[Page class =
> catalog.request.CatalogRequestPage, id = 5, render count = 1]' claims to be
> stateless but isn't. Possible reasons: no stateless hint, statefull
> behaviors
>
> The stateless hint for page is set. But it seems that a behavior is
> stateful.
> How can i identify the stateful behavior?
>
> Thanks
> Mike
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



[Migration 1.5] Is StatelessChecker not providing hints on stateful component anymore?

2011-09-06 Thread Mike Mander

Hi,

i use StatelessChecker from dev-utils. In 1.4 if a page was not 
stateless the checker told me the offending component.

But now in 1.5 i only get this message:
ERROR - DefaultExceptionMapper - Unexpected error occurred
java.lang.IllegalArgumentException: '[Page class = 
catalog.request.CatalogRequestPage, id = 5, render count = 1]' claims to 
be stateless but isn't. Possible reasons: no stateless hint, statefull 
behaviors


The stateless hint for page is set. But it seems that a behavior is 
stateful.

How can i identify the stateful behavior?

Thanks
Mike

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



Re: [Migration 1.5] How to map custom-layout of urls?

2011-09-06 Thread Mike Mander

Ok now it's working.

My mapper looks like this.

import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.handler.PageProvider;
import org.apache.wicket.request.handler.RenderPageRequestHandler;
import org.apache.wicket.request.mapper.AbstractComponentMapper;
import org.apache.wicket.util.string.Strings;

public class DetailMovedPageMapper extends AbstractComponentMapper {

private static final boolean CASE_INSENSITIVE = false;
public static final String MOUNT_PATH = "ShowDetailPage";

public DetailMovedPageMapper() {
super();
}

@Override
public int getCompatibilityScore(Request request) {
String path = request.getUrl().getPath();
if (Strings.startsWith(path, getMountPath(), CASE_INSENSITIVE)) {
String remainder = path.substring(getMountPath().length());
if 
(remainder.matches("(^\\.html$)|(^-ii\\d*\\.html$)|(^-ti\\d*-.*\\.html$)|(^-ti\\d*-ii\\d*-.*\\.html$)")) 
{

return Integer.MAX_VALUE;
}
}
return -1;
}

private String getMountPath() {
return MOUNT_PATH;
}

@Override
public IRequestHandler mapRequest(Request request) {
Url url = request.getUrl();
if (url != null && url.getPath().startsWith(getMountPath())) {
return new RenderPageRequestHandler(new 
PageProvider(DetailMovedPage.class, extractPageParameters(request, 0, 
new DetailMovedPageParametersEncoder(;

}
return null;
}

@Override
public Url mapHandler(IRequestHandler requestHandler) {
// This is special for my usecase because i immidiatly redirect 
this call

// and i think i don't have to render an url for this component.
return null;
}
}

In Application.init i've added the mapper
getRootRequestMapperAsCompound().add(new DetailMovedPageMapper());

Thanks
Mike

You need to setup it as root mapper. This way it will be asked first
to map the request.

On Tue, Sep 6, 2011 at 10:16 AM, Mike Mander  wrote:

Sorry Martin, but i don't get it to work.

I wrote a mapper:

import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.handler.BookmarkablePageRequestHandler;
import org.apache.wicket.request.handler.PageProvider;
import org.apache.wicket.request.mapper.AbstractComponentMapper;
import org.apache.wicket.util.string.Strings;

public class DetailMovedPageMapper extends AbstractComponentMapper {

private static final boolean CASE_INSENSITIVE = false;
public static final String MOUNT_PATH = "ShowDetailPage";

public DetailMovedPageMapper() {
super();
}

@Override
public int getCompatibilityScore(Request request) {
String path = request.getUrl().getPath();
if (Strings.startsWith(path, getMountPath(), CASE_INSENSITIVE)) {
String remainder = path.substring(getMountPath().length());
if
(remainder.matches("(^\\.html$)|(^-ii\\d*\\.html$)|(^-ti\\d*-.*\\.html$)|(^-ti\\d*-ii\\d*-.*\\.html$)"))
{
return Integer.MAX_VALUE;
}
}
return -1;
}

private String getMountPath() {
return MOUNT_PATH;
}

@Override
public IRequestHandler mapRequest(Request request) {
return new BookmarkablePageRequestHandler(new
PageProvider(DetailMovedPage.class, extractPageParameters(request, 0, new
DetailMovedPageParametersEncoder(;
}

@Override
public Url mapHandler(IRequestHandler requestHandler) {
return null;
}
}

But if i add it in Application.init (mount(new DetailMovedPageMapper());)
and call the homepage
nothing is displayed (blank page, no markup, no exception or log entry).

What i try to do is simply map a call of
localhost:8080/ShowDetailPage-ti123-ii456.html
to DetailPageMoved(PageParameters[ti=123, ii=456]).

Mike


Thanks Martin,

the parameters are the appendixes to page name (-ti123-ki345-ii789).
So i think i have to provide and encoder.

Cheers
Per


Yes, you need a custom IRequestMapper. You need to set it as root
mapper (see HttpsMapper and CryptoMapper examples).
You don't need custom IPageParametersEncoder unless you encode the
parameters in a special way. The url you showed below has no
parameters at all.

On Sat, Sep 3, 2011 at 5:25 PM, Per Newgrowrote:

Hi,

we have some urls like in following pattern
http://domain.de/ShowTheme-ti123-ki345-ii789.html

With wicket 1.4 we built a
BookmarkablePageRequestTargetUrlCodingStrategy
with matches(path) based on a pattern and encoding / decoding the url /
parameters.

Now i'm not sure how i have to migrate that to wicket 1.5.

I think i have to provide a IRequestMapper.

Is the getCompatibilityScore method the "equivalent" of matches(path)?
Do i have to provide a custom IPageParametersEncoder to enco

Re: [Migration 1.5] How to map custom-layout of urls?

2011-09-06 Thread Martin Grigorov
You need to setup it as root mapper. This way it will be asked first
to map the request.

On Tue, Sep 6, 2011 at 10:16 AM, Mike Mander  wrote:
> Sorry Martin, but i don't get it to work.
>
> I wrote a mapper:
>
> import org.apache.wicket.request.IRequestHandler;
> import org.apache.wicket.request.Request;
> import org.apache.wicket.request.Url;
> import org.apache.wicket.request.handler.BookmarkablePageRequestHandler;
> import org.apache.wicket.request.handler.PageProvider;
> import org.apache.wicket.request.mapper.AbstractComponentMapper;
> import org.apache.wicket.util.string.Strings;
>
> public class DetailMovedPageMapper extends AbstractComponentMapper {
>
>    private static final boolean CASE_INSENSITIVE = false;
>    public static final String MOUNT_PATH = "ShowDetailPage";
>
>    public DetailMovedPageMapper() {
>        super();
>    }
>
>    @Override
>    public int getCompatibilityScore(Request request) {
>        String path = request.getUrl().getPath();
>        if (Strings.startsWith(path, getMountPath(), CASE_INSENSITIVE)) {
>            String remainder = path.substring(getMountPath().length());
>            if
> (remainder.matches("(^\\.html$)|(^-ii\\d*\\.html$)|(^-ti\\d*-.*\\.html$)|(^-ti\\d*-ii\\d*-.*\\.html$)"))
> {
>                return Integer.MAX_VALUE;
>            }
>        }
>        return -1;
>    }
>
>    private String getMountPath() {
>        return MOUNT_PATH;
>    }
>
>    @Override
>    public IRequestHandler mapRequest(Request request) {
>        return new BookmarkablePageRequestHandler(new
> PageProvider(DetailMovedPage.class, extractPageParameters(request, 0, new
> DetailMovedPageParametersEncoder(;
>    }
>
>    @Override
>    public Url mapHandler(IRequestHandler requestHandler) {
>        return null;
>    }
> }
>
> But if i add it in Application.init (mount(new DetailMovedPageMapper());)
> and call the homepage
> nothing is displayed (blank page, no markup, no exception or log entry).
>
> What i try to do is simply map a call of
> localhost:8080/ShowDetailPage-ti123-ii456.html
> to DetailPageMoved(PageParameters[ti=123, ii=456]).
>
> Mike
>
>> Thanks Martin,
>>
>> the parameters are the appendixes to page name (-ti123-ki345-ii789).
>> So i think i have to provide and encoder.
>>
>> Cheers
>> Per
>>
>>> Yes, you need a custom IRequestMapper. You need to set it as root
>>> mapper (see HttpsMapper and CryptoMapper examples).
>>> You don't need custom IPageParametersEncoder unless you encode the
>>> parameters in a special way. The url you showed below has no
>>> parameters at all.
>>>
>>> On Sat, Sep 3, 2011 at 5:25 PM, Per Newgro  wrote:

 Hi,

 we have some urls like in following pattern
 http://domain.de/ShowTheme-ti123-ki345-ii789.html

 With wicket 1.4 we built a
 BookmarkablePageRequestTargetUrlCodingStrategy
 with matches(path) based on a pattern and encoding / decoding the url /
 parameters.

 Now i'm not sure how i have to migrate that to wicket 1.5.

 I think i have to provide a IRequestMapper.

 Is the getCompatibilityScore method the "equivalent" of matches(path)?
 Do i have to provide a custom IPageParametersEncoder to encode / decode
 my
 url / parameters?

 Thanks for clearification
 Per

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


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



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: [Migration 1.5] How to map custom-layout of urls?

2011-09-06 Thread Mike Mander

Sorry Martin, but i don't get it to work.

I wrote a mapper:

import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.handler.BookmarkablePageRequestHandler;
import org.apache.wicket.request.handler.PageProvider;
import org.apache.wicket.request.mapper.AbstractComponentMapper;
import org.apache.wicket.util.string.Strings;

public class DetailMovedPageMapper extends AbstractComponentMapper {

private static final boolean CASE_INSENSITIVE = false;
public static final String MOUNT_PATH = "ShowDetailPage";

public DetailMovedPageMapper() {
super();
}

@Override
public int getCompatibilityScore(Request request) {
String path = request.getUrl().getPath();
if (Strings.startsWith(path, getMountPath(), CASE_INSENSITIVE)) {
String remainder = path.substring(getMountPath().length());
if 
(remainder.matches("(^\\.html$)|(^-ii\\d*\\.html$)|(^-ti\\d*-.*\\.html$)|(^-ti\\d*-ii\\d*-.*\\.html$)")) 
{

return Integer.MAX_VALUE;
}
}
return -1;
}

private String getMountPath() {
return MOUNT_PATH;
}

@Override
public IRequestHandler mapRequest(Request request) {
return new BookmarkablePageRequestHandler(new 
PageProvider(DetailMovedPage.class, extractPageParameters(request, 0, 
new DetailMovedPageParametersEncoder(;

}

@Override
public Url mapHandler(IRequestHandler requestHandler) {
return null;
}
}

But if i add it in Application.init (mount(new 
DetailMovedPageMapper());) and call the homepage

nothing is displayed (blank page, no markup, no exception or log entry).

What i try to do is simply map a call of 
localhost:8080/ShowDetailPage-ti123-ii456.html

to DetailPageMoved(PageParameters[ti=123, ii=456]).

Mike


Thanks Martin,

the parameters are the appendixes to page name (-ti123-ki345-ii789).
So i think i have to provide and encoder.

Cheers
Per


Yes, you need a custom IRequestMapper. You need to set it as root
mapper (see HttpsMapper and CryptoMapper examples).
You don't need custom IPageParametersEncoder unless you encode the
parameters in a special way. The url you showed below has no
parameters at all.

On Sat, Sep 3, 2011 at 5:25 PM, Per Newgro  wrote:

Hi,

we have some urls like in following pattern
http://domain.de/ShowTheme-ti123-ki345-ii789.html

With wicket 1.4 we built a 
BookmarkablePageRequestTargetUrlCodingStrategy

with matches(path) based on a pattern and encoding / decoding the url /
parameters.

Now i'm not sure how i have to migrate that to wicket 1.5.

I think i have to provide a IRequestMapper.

Is the getCompatibilityScore method the "equivalent" of matches(path)?
Do i have to provide a custom IPageParametersEncoder to encode / 
decode my

url / parameters?

Thanks for clearification
Per

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








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





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



Re: [Migration 1.5] How to map custom-layout of urls?

2011-09-06 Thread Mike Mander

Thanks Thomas,

that was my first try. But the consequence is that i have to handle the 
page parameter (foo) in the page.
With 1.4 we had a strategy for that with some tests. I would like to 
migrate that.


Mike


It has some basic support for this, you can just
mountPage("ShowTheme-${foo}", ShowPage.class);
and then foo will in the PageParameters
check MountedMapper javadoc

On Mon, Sep 5, 2011 at 8:10 PM, Per Newgro  wrote:


Thanks Martin,

the parameters are the appendixes to page name (-ti123-ki345-ii789).
So i think i have to provide and encoder.

Cheers
Per


  Yes, you need a custom IRequestMapper. You need to set it as root

mapper (see HttpsMapper and CryptoMapper examples).
You don't need custom IPageParametersEncoder unless you encode the
parameters in a special way. The url you showed below has no
parameters at all.

On Sat, Sep 3, 2011 at 5:25 PM, Per Newgro   wrote:


Hi,

we have some urls like in following pattern
http://domain.de/ShowTheme-**ti123-ki345-ii789.html

With wicket 1.4 we built a BookmarkablePageRequestTargetU**
rlCodingStrategy
with matches(path) based on a pattern and encoding / decoding the url /
parameters.

Now i'm not sure how i have to migrate that to wicket 1.5.

I think i have to provide a IRequestMapper.

Is the getCompatibilityScore method the "equivalent" of matches(path)?
Do i have to provide a custom IPageParametersEncoder to encode / decode
my
url / parameters?

Thanks for clearification
Per

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






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





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