Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread 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-namewicketsite/servlet-name

 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-namewicketsite/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.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
 Tauren Mills
 Sent: 27 June 2008 07:30
 To: users@wicket.apache.org
 Subject: Home page accepting IndexedParamUrlCodingStrategy


 How do I go about making my HomePage accept index parameters?  I want
 a home page that will accept URLs like:
 localhost:8080/us/ca/sacramento

 Instead of having a mount point first, for example /home:
 localhost:8080/home/us/ca/sacramento

 I've tried this in my app:

 getHomePage() {
return HomePage.class;
 }
 init() {
mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
 }

 This returns in a 404 error for the home page (localhost:8080/).  I
 also tried with  instead of / as the mount point, but the same
 problem.

 If I use this with the /home mount point, everything works perfectly:
 mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

 FYI... I get the PageParameters in HomePage like this (which is
 working fine);

   setCountry(pageParams.getString(0,null));
   setState(pageParams.getString(1,null));
   setCity(pageParams.getString(2,null));

 Any suggestions?

 Thanks,
 Tauren

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread Erik van Oosten

It is not possible. Unfortunately.

You can write your own IRequestCycleProcessor. See 
WebApplication#newRequestCycleProcessor().


Get hints at: 
http://www.nabble.com/How-to-catch-unknown-(not-mounted)-URLs--td14949092.html#a14956131


Regards,
   Erik.


Tauren Mills wrote:

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-namewicketsite/servlet-name
   
servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
   init-param
   param-nameapplicationFactoryClassName/param-name
   
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
   /init-param
   load-on-startup1/load-on-startup
   /servlet
   servlet-mapping
   servlet-namewicketsite/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.


  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Tauren Mills
Sent: 27 June 2008 07:30
To: users@wicket.apache.org
Subject: Home page accepting IndexedParamUrlCodingStrategy


How do I go about making my HomePage accept index parameters?  I want
a home page that will accept URLs like:
localhost:8080/us/ca/sacramento

Instead of having a mount point first, for example /home:
localhost:8080/home/us/ca/sacramento

I've tried this in my app:

getHomePage() {
   return HomePage.class;
}
init() {
   mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
}

This returns in a 404 error for the home page (localhost:8080/).  I
also tried with  instead of / as the mount point, but the same
problem.

If I use this with the /home mount point, everything works perfectly:
mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

FYI... I get the PageParameters in HomePage like this (which is
working fine);

  setCountry(pageParams.getString(0,null));
  setState(pageParams.getString(1,null));
  setCity(pageParams.getString(2,null));

Any suggestions?

Thanks,
Tauren

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread Peter Ertl

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-namewicketsite/servlet-name
  servlet-classorg.apache.wicket.protocol.http.WicketServlet/ 
servlet-class

  init-param
  param-nameapplicationFactoryClassName/param-name
  param- 
valueorg.apache.wicket.spring.SpringWebApplicationFactory/param- 
value

  /init-param
  load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
  servlet-namewicketsite/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.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Tauren Mills
Sent: 27 June 2008 07:30
To: users@wicket.apache.org
Subject: Home page accepting IndexedParamUrlCodingStrategy


How do I go about making my HomePage accept index parameters?  I  
want

a home page that will accept URLs like:
localhost:8080/us/ca/sacramento

Instead of having a mount point first, for example /home:
localhost:8080/home/us/ca/sacramento

I've tried this in my app:

getHomePage() {
  return HomePage.class;
}
init() {
  mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
}

This returns in a 404 error for the home page (localhost:8080/).  I
also tried with  instead of / as the mount point, but the same
problem.

If I use this with the /home mount point, everything works  
perfectly:

mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

FYI... I get the PageParameters in HomePage like this (which is
working fine);

 setCountry(pageParams.getString(0,null));
 setState(pageParams.getString(1,null));
 setCity(pageParams.getString(2,null));

Any suggestions?

Thanks,
Tauren

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread Erik van Oosten

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-namewicketsite/servlet-name
  
servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class 


  init-param
  param-nameapplicationFactoryClassName/param-name
  
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value 


  /init-param
  load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
  servlet-namewicketsite/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]



Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread Tauren Mills
Thanks for the help!  After messing with it for a while, I was
thinking it wasn't possible too.  I appreciate the link, as it looks
to be a possible solution that I hadn't found while searching on
nabble...

Tauren


On Fri, Jun 27, 2008 at 11:19 AM, Erik van Oosten [EMAIL PROTECTED] wrote:
 It is not possible. Unfortunately.

 You can write your own IRequestCycleProcessor. See
 WebApplication#newRequestCycleProcessor().

 Get hints at:
 http://www.nabble.com/How-to-catch-unknown-(not-mounted)-URLs--td14949092.html#a14956131

 Regards,
   Erik.


 Tauren Mills wrote:

 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-namewicketsite/servlet-name

 servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
   init-param
   param-nameapplicationFactoryClassName/param-name

 param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
   /init-param
   load-on-startup1/load-on-startup
   /servlet
   servlet-mapping
   servlet-namewicketsite/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.




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
 Tauren Mills
 Sent: 27 June 2008 07:30
 To: users@wicket.apache.org
 Subject: Home page accepting IndexedParamUrlCodingStrategy


 How do I go about making my HomePage accept index parameters?  I want
 a home page that will accept URLs like:
 localhost:8080/us/ca/sacramento

 Instead of having a mount point first, for example /home:
 localhost:8080/home/us/ca/sacramento

 I've tried this in my app:

 getHomePage() {
   return HomePage.class;
 }
 init() {
   mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
 }

 This returns in a 404 error for the home page (localhost:8080/).  I
 also tried with  instead of / as the mount point, but the same
 problem.

 If I use this with the /home mount point, everything works perfectly:
 mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

 FYI... I get the PageParameters in HomePage like this (which is
 working fine);

  setCountry(pageParams.getString(0,null));
  setState(pageParams.getString(1,null));
  setCity(pageParams.getString(2,null));

 Any suggestions?

 Thanks,
 Tauren

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

Home page accepting IndexedParamUrlCodingStrategy

2008-06-26 Thread Tauren Mills
How do I go about making my HomePage accept index parameters?  I want
a home page that will accept URLs like:
localhost:8080/us/ca/sacramento

Instead of having a mount point first, for example /home:
localhost:8080/home/us/ca/sacramento

I've tried this in my app:

getHomePage() {
   return HomePage.class;
}
init() {
   mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
}

This returns in a 404 error for the home page (localhost:8080/).  I
also tried with  instead of / as the mount point, but the same
problem.

If I use this with the /home mount point, everything works perfectly:
mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

FYI... I get the PageParameters in HomePage like this (which is working fine);

setCountry(pageParams.getString(0,null));
setState(pageParams.getString(1,null));
setCity(pageParams.getString(2,null));

Any suggestions?

Thanks,
Tauren

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Home page accepting IndexedParamUrlCodingStrategy

2008-06-26 Thread David Leangen

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.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
 Tauren Mills
 Sent: 27 June 2008 07:30
 To: users@wicket.apache.org
 Subject: Home page accepting IndexedParamUrlCodingStrategy


 How do I go about making my HomePage accept index parameters?  I want
 a home page that will accept URLs like:
 localhost:8080/us/ca/sacramento

 Instead of having a mount point first, for example /home:
 localhost:8080/home/us/ca/sacramento

 I've tried this in my app:

 getHomePage() {
return HomePage.class;
 }
 init() {
mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
 }

 This returns in a 404 error for the home page (localhost:8080/).  I
 also tried with  instead of / as the mount point, but the same
 problem.

 If I use this with the /home mount point, everything works perfectly:
 mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

 FYI... I get the PageParameters in HomePage like this (which is
 working fine);

   setCountry(pageParams.getString(0,null));
   setState(pageParams.getString(1,null));
   setCity(pageParams.getString(2,null));

 Any suggestions?

 Thanks,
 Tauren

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-26 Thread Tauren Mills
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-namewicketsite/servlet-name

servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-namewicketsite/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.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
 Tauren Mills
 Sent: 27 June 2008 07:30
 To: users@wicket.apache.org
 Subject: Home page accepting IndexedParamUrlCodingStrategy


 How do I go about making my HomePage accept index parameters?  I want
 a home page that will accept URLs like:
 localhost:8080/us/ca/sacramento

 Instead of having a mount point first, for example /home:
 localhost:8080/home/us/ca/sacramento

 I've tried this in my app:

 getHomePage() {
return HomePage.class;
 }
 init() {
mount(new IndexedParamUrlCodingStrategy(/, HomePage.class));
 }

 This returns in a 404 error for the home page (localhost:8080/).  I
 also tried with  instead of / as the mount point, but the same
 problem.

 If I use this with the /home mount point, everything works perfectly:
 mount(new IndexedParamUrlCodingStrategy(/home, HomePage.class));

 FYI... I get the PageParameters in HomePage like this (which is
 working fine);

   setCountry(pageParams.getString(0,null));
   setState(pageParams.getString(1,null));
   setCity(pageParams.getString(2,null));

 Any suggestions?

 Thanks,
 Tauren

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]