There are 2 problems in this code:
1. mount specifies that the mount point is given without a leading '/'
(even though it tolerates it)
2. you can not call mount with "", it will throw an exception (and
therefore not with "/" either)
Actually, it would be nice if you could do the latter. As long as the
target class is the same as the home page class, I should perhaps not be
prohibited.
I'd say: open a jira issue and attach a patch :)
Regards,
Erik.
Peter Ertl wrote:
pseudo code example:
mount("/", ... indexed HomePage.class)
mount("/foo", FooPage.class)
What should happen with this path:
url = /foo
-> call HomePage with indexed parameter 'foo' ?
-> call page FooPage.class ?
not having indexed urls for '/' makes sense for me
Am 27.06.2008 um 19:59 schrieb Tauren Mills:
Does anyone have suggestions on how to do this? Or is it just not
possible to use IndexedParamUrlCodingStrategy without a mount point
(from the root of the site)?
Thanks!
Tauren
On Thu, Jun 26, 2008 at 3:53 PM, Tauren Mills <[EMAIL PROTECTED]> wrote:
Thanks for the suggestion, but I'm unclear on how to mount the home
page on "/". I guess that is the main problem I'm having. Before
adding PageParameters to the page, I used this:
mountBookmarkablePage("/home", HomePage.class);
With that, going to localhost:8080/ would redirect to
localhost:8080/home. Then I changed it to the following:
mount(new IndexedParamUrlCodingStrategy("/home",
HomePage.class));
// mountBookmarkablePage("/home", HomePage.class);
Everything still worked the same (going to site root would redirect to
/home), but it would also accept parameters. Functions perfectly, but
I need to get rid of the /home mount point. So I tried this:
mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
// mount(new IndexedParamUrlCodingStrategy("/home",
HomePage.class));
// mountBookmarkablePage("/home", HomePage.class);
Doing so gives a 404 error when I go to the root of the site. So how
do I mount the home page on "/"? I tried both "" and "/".
MyWebApplication:
public Class<? extends WebPage> getHomePage() {
return HomePage.class;
}
protected void init() {
super.init();
mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
// mount(new IndexedParamUrlCodingStrategy("/home",
HomePage.class));
// mountBookmarkablePage("/home", HomePage.class);
}
Jetty launcher code (for testing):
WebAppContext context = new WebAppContext();
context.setServer(server);
context.setContextPath("/");
context.setWar("src/webapp");
web.xml:
<servlet>
<servlet-name>wicketsite</servlet-name>
<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>wicketsite</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Thanks for the help!
Tauren
On Thu, Jun 26, 2008 at 3:38 PM, David Leangen <[EMAIL PROTECTED]>
wrote:
IIUC, the home page is automatically mounted on the path where you
wicket
app is located.
So, if you put your wicket on "/home", then the home page will be
mounted on
/home.
Guess you'll need to put your home page on "/" to make this work.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]