Re: Wicket Sessions, serialization and Cayenne

2011-04-15 Thread Christian Grobmeier
Hi,
i have solved it like this:
http://www.grobmeier.de/using-apache-cayenne-with-apache-wicket-05022011.html
Cheers
Christian

On Fri, Apr 15, 2011 at 8:20 PM, YK linux_2...@yahoo.fr wrote:
the datacontext was lost

 I think this is the root cause of your problems.

 A cayenne dataContext is generally created once for all for each web session
 where it is stored.
 You should have a  http://cayenne.apache.org/doc30/tutorial-webapp.html web
 filter  that stores this dataContext in the ThreadLocal context in order to
 use it
 in the persistence layer of your application like the following :
 ObjectContext context = BaseContext.getThreadObjectContext();
    List artists = context.performQuery(query);

 Make sure you are not loosing the dataContext after each request.

 take a look at  http://cayenne.apache.org/doc30/tutorial-webapp.html this
 link  for more information


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Sessions-serialization-and-Cayenne-tp3452466p3452694.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





-- 
http://www.grobmeier.de

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



Could not resolve class: my.domain.favicon.ico

2011-04-13 Thread Christian Grobmeier
Hello all,

I am a bit curious about the exceptions below... if anybody has an
idea whats going on, please let me know.
Page shows up, just in the logfile is the exception. CSS shows up,
favicon doesn't.

I am using Wicket from trunk
Thanks,
Christian

Similar stacktrace for:
java.lang.ClassNotFoundException: de.mydomain.images
java.lang.ClassNotFoundException: de.mydomain.style.css



WARN  - WicketObjects              - Could not resolve class
[de.mydomain.favicon.ico]
java.lang.ClassNotFoundException: de.mydomain.favicon.ico
       at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
       at 
org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:417)
       at 
org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:370)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:247)
       at 
org.apache.wicket.application.DefaultClassResolver.resolveClass(DefaultClassResolver.java:115)
       at 
org.apache.wicket.util.lang.WicketObjects.resolveClass(WicketObjects.java:75)
       at 
org.apache.wicket.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:140)
       at 
org.apache.wicket.request.mapper.PackageMapper.parseRequest(PackageMapper.java:125)
       at 
org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:212)
       at 
org.apache.wicket.request.mapper.mount.UnmountedMapperAdapter.mapRequest(UnmountedMapperAdapter.java:73)
       at 
org.apache.wicket.request.mapper.mount.MountMapper.mapRequest(MountMapper.java:131)
       at 
org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:129)
       at 
org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:183)
       at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:208)
       at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
       at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
       at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
       at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
       at 
org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:97)
       at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
       at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
       at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
       at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516)
       at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
       at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
       at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
       at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
       at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
       at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
       at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
       at org.eclipse.jetty.server.Server.handle(Server.java:352)
       at 
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
       at 
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
       at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:590)
       at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
       at 
org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
       at 
org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:241)
       at 
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
       at java.lang.Thread.run(Thread.java:680)



-- 
http://www.grobmeier.de

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



Re: Could not resolve class: my.domain.favicon.ico

2011-04-13 Thread Christian Grobmeier
 can you paste your MyApp#init() ?

Sure:

  @Override
public void init() {
super.init();
getComponentInstantiationListeners().add(
new SpringComponentInjector(this));
mountPackage(/, HomePage.class);
mountPackage(/feedback, FeedbackPage.class);
mountPackage(/login, LoginPage.class);
mountPackage(/test, TestPage.class);
this.getMarkupSettings().setStripWicketTags(true);
loadProperties();
initSecurity();
}

loadProperties load a property file from web-inf as the name suggests
initSecurity is setting an getSecuritySettings().setauthorizationStrategy()
- guess the latter two methods have nothing to do with my problem

Cheers

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



Re: Could not resolve class: my.domain.favicon.ico

2011-04-13 Thread Christian Grobmeier
 do you really need mountPackage() ?
 I guess you actually need #mountPage()
 I find mountPackage(/, HomePage.class); as the culprit

if I use only mountPage it leads to the situation of some components not found.
My structure is like following:

/HomePage.class
/App.class
/pages/login/LoginPage.class
/pages/login/LoginForm.class
/pages/login/LoginEntities.class
/pages/login/LoginBusinessLogic.class
/pages/login/LoginPage.html
...

The docs told me I could mount a whole package. As subfolders are not
mounted, I thougth this would work.

However, if I only use mountPage, the missing css error is gone. But
then I am puzzled about mountPackage

It seems I should restructure my app... is there a recommended way?




 On Wed, Apr 13, 2011 at 11:07 AM, Christian Grobmeier
 grobme...@gmail.comwrote:

  can you paste your MyApp#init() ?

 Sure:

  @Override
    public void init() {
        super.init();
        getComponentInstantiationListeners().add(
                new SpringComponentInjector(this));
        mountPackage(/, HomePage.class);
        mountPackage(/feedback, FeedbackPage.class);
        mountPackage(/login, LoginPage.class);
        mountPackage(/test, TestPage.class);
        this.getMarkupSettings().setStripWicketTags(true);
        loadProperties();
        initSecurity();
    }

 loadProperties load a property file from web-inf as the name suggests
 initSecurity is setting an getSecuritySettings().setauthorizationStrategy()
 - guess the latter two methods have nothing to do with my problem

 Cheers

 -
 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 http://jweekend.com/




-- 
http://www.grobmeier.de

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



Re: Could not resolve class: my.domain.favicon.ico

2011-04-13 Thread Christian Grobmeier
 mountPackage() will mount all *Page* classes in the same package as the page
 used for the mount
 but it doesn't do anything else, i.e. it doesn't handle components or models
 or ...

OK, I have imagined that. But it seems mountPackage does also mount the forms.
If I mountPackage everything the LoginForm is available.

If I do mountPage my LoginForm is not available after I submit (same
package as LoginPage). Which does not make sense to me:
ComponentNotFoundException: Could not find component 'loginForm' on
page 'class de.mydomain.HomePage

The HomePage does not have this component at all.

Even when I do:
mountPage(HomePage)
mountPackage(LoginPage)

it changes.
Only when i mountPackage everything it seems to work.

Btw, HomePage is in the root folder, while LoginPage is in a subfolder.



 mountPage() mounts just a single page without any knowledge about other
 pages, panels, models ...

 On Wed, Apr 13, 2011 at 11:19 AM, Christian Grobmeier
 grobme...@gmail.comwrote:

  do you really need mountPackage() ?
  I guess you actually need #mountPage()
  I find mountPackage(/, HomePage.class); as the culprit

 if I use only mountPage it leads to the situation of some components not
 found.
 My structure is like following:

 /HomePage.class
 /App.class
 /pages/login/LoginPage.class
 /pages/login/LoginForm.class
 /pages/login/LoginEntities.class
 /pages/login/LoginBusinessLogic.class
 /pages/login/LoginPage.html
 ...

 The docs told me I could mount a whole package. As subfolders are not
 mounted, I thougth this would work.

 However, if I only use mountPage, the missing css error is gone. But
 then I am puzzled about mountPackage

 It seems I should restructure my app... is there a recommended way?



 
  On Wed, Apr 13, 2011 at 11:07 AM, Christian Grobmeier
  grobme...@gmail.comwrote:
 
   can you paste your MyApp#init() ?
 
  Sure:
 
   @Override
     public void init() {
         super.init();
         getComponentInstantiationListeners().add(
                 new SpringComponentInjector(this));
         mountPackage(/, HomePage.class);
         mountPackage(/feedback, FeedbackPage.class);
         mountPackage(/login, LoginPage.class);
         mountPackage(/test, TestPage.class);
         this.getMarkupSettings().setStripWicketTags(true);
         loadProperties();
         initSecurity();
     }
 
  loadProperties load a property file from web-inf as the name suggests
  initSecurity is setting an
 getSecuritySettings().setauthorizationStrategy()
  - guess the latter two methods have nothing to do with my problem
 
  Cheers
 
  -
  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 http://jweekend.com/
 



 --
 http://www.grobmeier.de

 -
 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 http://jweekend.com/




-- 
http://www.grobmeier.de

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



Re: preferred php framework by wicketeers...

2011-03-08 Thread Christian Grobmeier
 Sadly reality is that PHP is more widely adopted. Apache comes almost
 by default with PHP. So I was wondering, does anything come close to
 Wicket, to ease the pain.. Or to have a stronger case for Wicket in
 discussions.

Do you know Zeta Components which entered the apache incubator for a while?
http://incubator.apache.org/projects/zetacomponents.html
They have some MVC stuff inside. Thsi is mostly used in PHP world
(unfortunately)

An other approach is piwi:
http://code.google.com/a/apache-extras.org/p/piwi/
I am involved in this project, so this i my first choice. But you
should know that it's in an early state. Helping hands welcome.

Anything like Wicket in PHP world is unknown to me. I am not sure if
it makes sense tough

Cheers
Christian


 So Scala is not an option either... it's on my wish-list to learn
 though. I'm aware of the Scala/Wicket integration.


 Antoine


 2011/3/8 Josh Kamau joshnet2...@gmail.com:
 I dont know of any. If you prefer scripting languages, there is a
 scala+wicket integration. Just google it if you are interested.

 Josh.


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





-- 
http://www.grobmeier.de

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



Re: 1.5RC1 url mounting/encoding

2011-02-18 Thread Christian Grobmeier
Hi,

 Using Wicket 1.5RC1, how do I mount a Page to root that is other than the
 home page? E.g.:

 www.myapp.com -IndexPage.class

can you try this?
mountPackage(/, IndexPage.class);
Not sure about - try mountPage if you don't want to mount the package
Christian


 www.myapp.com/${username} -OtherPage.class with ${username} as a
 pageparameter

 thanks,
 Nim
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3312989.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





-- 
http://www.grobmeier.de

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



Dropdown + Model

2011-02-17 Thread Christian Grobmeier
Hi folks,

coming from the struts world, i need to get used to Wicket models. I
am still unsure if I use them correct, so i would like to ask about
the correctness of my code and hopefully learn more about models.

 super(id, new CompoundPropertyModelValueMap(new ValueMap()));

 ListSelectOption options = new ArrayListSelectOption();
 options.add(new SelectOption(, AND));
 options.add(new SelectOption(!, OR));

  ChoiceRendererSelectOption choiceRenderer = new
ChoiceRendererSelectOption(value, key);

 PropertyModelSelectOption propertyModel = new
PropertyModelSelectOption(getModel(), parentproject);

DropDownChoiceSelectOption ddc =
 new DropDownChoiceSelectOption(
parentproject,
propertyModel,
options, choiceRenderer);
add(ddc);

This works well so far.

Now to my questions. I added the compoundPropertyModel to my page in
first line. It means a new ValueMap is available with the getModel()
method. And it means my page is stateful from now on. Correct?

For my DropDownBox I wrapped a specifica part of my CompoundModel,
namely the parentproject. If I imagine, with the call above I use the
key parentproject in my ValueMap for a SelectOption object.

Putting this in DropDownChoice, it means my value gets filled into my
getModel() at the slot parentproject

That being said, my CompoundPropertyModel is cared about from Wicket
in terms of memory and everything. I don't need to clean up here,
because it will become detached when the game is over.

Its fine to wrap the compoundmodel into a propertymodel in my case,
because I can store my value in the page model and make sure it will
stored at the slot I like.

Are my assumptions correct?

Thanks!

Best regards,
Christian

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



Strange behaviour of BookmarkablePageLink

2011-02-14 Thread Christian Grobmeier
Hello

I have two forms in my app. One is behaving correct, one not. So I
assume I did something bad, but I cannot find my failure - maybe one
of you guys had a similar problem in the past. I am using 1.5 trunk
version.

In my apps init method i mounted some pages/packages:

mountPackage(app, HomePage.class);
mountPackage(app/feedback, FeedbackPage.class);
mountPackage(app/login, LoginPage.class);
mountPackage(app, TestPage.class);

After the mount, LoginPage can be accessed at:
http://localhost:8080/app/login/LoginPage?4
similar to all other pages.

In my LoginPage is a a form included: LoginForm. On submit it sets
HelloPage.class as response like this:

if (session.signIn(getUsername(), getPassword())) {
if (!continueToOriginalDestination()) {
this.setResponsePage(TestPage.class);
}
}

However, whenever I successfully sign on, I reach the TestPage BUT my
links change to:

http://localhost:8080/wicket/TestPage

I should mention that these links are generated in a parent page, from
which all my other pages extend.

In my other form it works perfectly. It has the same package structure
and looks pretty similar to login. It just sends an e-mail instead of
setting a user object to the session.

Any ideas why I could loos my mounting?

My links are generated in the parents page like this:

BookmarkablePageLinkParentPage home = new
BookmarkablePageLinkParentPage(home, HomePage.class);
add(home);


Thanks in advance,
Christian

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



Re: Strange behaviour of BookmarkablePageLink

2011-02-14 Thread Christian Grobmeier
Hi Robson,

 I noticed that there are two pages mounted in the same URL: both HomePage
 and TestPage are mounted on /app. I'm not sure if this is the cause of the
 problem, but you can try changing the mount point of one of them.

actually you are right. It seems mounting different packages to the
same mount point is not possible.

Thanks for your pointer! One of these days :-)

Cheers
Christian


 Regards,
  Robson Paniago



 2011/2/14 Christian Grobmeier grobme...@gmail.com

 Hello

 I have two forms in my app. One is behaving correct, one not. So I
 assume I did something bad, but I cannot find my failure - maybe one
 of you guys had a similar problem in the past. I am using 1.5 trunk
 version.

 In my apps init method i mounted some pages/packages:

 mountPackage(app, HomePage.class);
 mountPackage(app/feedback, FeedbackPage.class);
 mountPackage(app/login, LoginPage.class);
 mountPackage(app, TestPage.class);

 After the mount, LoginPage can be accessed at:
 http://localhost:8080/app/login/LoginPage?4
 similar to all other pages.

 In my LoginPage is a a form included: LoginForm. On submit it sets
 HelloPage.class as response like this:

 if (session.signIn(getUsername(), getPassword())) {
            if (!continueToOriginalDestination()) {
                this.setResponsePage(TestPage.class);
            }
        }

 However, whenever I successfully sign on, I reach the TestPage BUT my
 links change to:

 http://localhost:8080/wicket/TestPage

 I should mention that these links are generated in a parent page, from
 which all my other pages extend.

 In my other form it works perfectly. It has the same package structure
 and looks pretty similar to login. It just sends an e-mail instead of
 setting a user object to the session.

 Any ideas why I could loos my mounting?

 My links are generated in the parents page like this:

 BookmarkablePageLinkParentPage home = new
 BookmarkablePageLinkParentPage(home, HomePage.class);
        add(home);


 Thanks in advance,
 Christian

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






-- 
http://www.grobmeier.de

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



Re: Strange behaviour of BookmarkablePageLink

2011-02-14 Thread Christian Grobmeier
Hello again,

it still something weird

I meanwhile have:

mountPackage(/, HomePage.class);
mountPackage(/feedback, FeedbackPage.class);
mountPackage(/login, LoginPage.class);
mountPackage(/test, TestPage.class);

Everything fine so far. After I have logged in (in the onSubmit()), I
redirect to the TestPage:
setResponsePage(TestPage.class);

And when this happens, my TestPage Bookmarkablelink has the wrong URL.
Instead of /test/TestPage it show wicket/TestPage

I figured out that the mount only fails for the response page. I
created a second one for testing. If I used this as my response page,
the url gets lost.

I cannot explain how this happens. I debugged Wicket but couldn't find
the problem.

My guess is that the form, which baseparam is:
http://localhost:8080/wicket/page?0-1.IFormSubmitListener-loginForm
replaces for some reason my path with its own wicket.

thanks in advance,
Christian
.


On Mon, Feb 14, 2011 at 4:02 PM, Christian Grobmeier
grobme...@gmail.com wrote:
 Hi Robson,

 I noticed that there are two pages mounted in the same URL: both HomePage
 and TestPage are mounted on /app. I'm not sure if this is the cause of the
 problem, but you can try changing the mount point of one of them.

 actually you are right. It seems mounting different packages to the
 same mount point is not possible.

 Thanks for your pointer! One of these days :-)

 Cheers
 Christian


 Regards,
  Robson Paniago



 2011/2/14 Christian Grobmeier grobme...@gmail.com

 Hello

 I have two forms in my app. One is behaving correct, one not. So I
 assume I did something bad, but I cannot find my failure - maybe one
 of you guys had a similar problem in the past. I am using 1.5 trunk
 version.

 In my apps init method i mounted some pages/packages:

 mountPackage(app, HomePage.class);
 mountPackage(app/feedback, FeedbackPage.class);
 mountPackage(app/login, LoginPage.class);
 mountPackage(app, TestPage.class);

 After the mount, LoginPage can be accessed at:
 http://localhost:8080/app/login/LoginPage?4
 similar to all other pages.

 In my LoginPage is a a form included: LoginForm. On submit it sets
 HelloPage.class as response like this:

 if (session.signIn(getUsername(), getPassword())) {
            if (!continueToOriginalDestination()) {
                this.setResponsePage(TestPage.class);
            }
        }

 However, whenever I successfully sign on, I reach the TestPage BUT my
 links change to:

 http://localhost:8080/wicket/TestPage

 I should mention that these links are generated in a parent page, from
 which all my other pages extend.

 In my other form it works perfectly. It has the same package structure
 and looks pretty similar to login. It just sends an e-mail instead of
 setting a user object to the session.

 Any ideas why I could loos my mounting?

 My links are generated in the parents page like this:

 BookmarkablePageLinkParentPage home = new
 BookmarkablePageLinkParentPage(home, HomePage.class);
        add(home);


 Thanks in advance,
 Christian

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






 --
 http://www.grobmeier.de




-- 
http://www.grobmeier.de

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



Re: Strange behaviour of BookmarkablePageLink

2011-02-14 Thread Christian Grobmeier
OK i solved it now. Sorry for the mailinglist noise.

This link:
https://cwiki.apache.org/WICKET/faqs.html#FAQs-WhatisthedifferencebetweensetResponsePage%2528newMyWebPage%2528%2529%2529andsetResponsePage%2528MyWebPage.class%2529

describes the difference between setReponse(instance) and setResponse(class).

I switched to the instance version:
this.setResponsePage(new TestPage());

and it worked.

I will now debug into the method to see why this difference was so huge.

Cheers
Christian

On Mon, Feb 14, 2011 at 6:02 PM, Christian Grobmeier
grobme...@gmail.com wrote:
 Hello again,

 it still something weird

 I meanwhile have:

 mountPackage(/, HomePage.class);
 mountPackage(/feedback, FeedbackPage.class);
 mountPackage(/login, LoginPage.class);
 mountPackage(/test, TestPage.class);

 Everything fine so far. After I have logged in (in the onSubmit()), I
 redirect to the TestPage:
 setResponsePage(TestPage.class);

 And when this happens, my TestPage Bookmarkablelink has the wrong URL.
 Instead of /test/TestPage it show wicket/TestPage

 I figured out that the mount only fails for the response page. I
 created a second one for testing. If I used this as my response page,
 the url gets lost.

 I cannot explain how this happens. I debugged Wicket but couldn't find
 the problem.

 My guess is that the form, which baseparam is:
 http://localhost:8080/wicket/page?0-1.IFormSubmitListener-loginForm
 replaces for some reason my path with its own wicket.

 thanks in advance,
 Christian
 .


 On Mon, Feb 14, 2011 at 4:02 PM, Christian Grobmeier
 grobme...@gmail.com wrote:
 Hi Robson,

 I noticed that there are two pages mounted in the same URL: both HomePage
 and TestPage are mounted on /app. I'm not sure if this is the cause of the
 problem, but you can try changing the mount point of one of them.

 actually you are right. It seems mounting different packages to the
 same mount point is not possible.

 Thanks for your pointer! One of these days :-)

 Cheers
 Christian


 Regards,
  Robson Paniago



 2011/2/14 Christian Grobmeier grobme...@gmail.com

 Hello

 I have two forms in my app. One is behaving correct, one not. So I
 assume I did something bad, but I cannot find my failure - maybe one
 of you guys had a similar problem in the past. I am using 1.5 trunk
 version.

 In my apps init method i mounted some pages/packages:

 mountPackage(app, HomePage.class);
 mountPackage(app/feedback, FeedbackPage.class);
 mountPackage(app/login, LoginPage.class);
 mountPackage(app, TestPage.class);

 After the mount, LoginPage can be accessed at:
 http://localhost:8080/app/login/LoginPage?4
 similar to all other pages.

 In my LoginPage is a a form included: LoginForm. On submit it sets
 HelloPage.class as response like this:

 if (session.signIn(getUsername(), getPassword())) {
            if (!continueToOriginalDestination()) {
                this.setResponsePage(TestPage.class);
            }
        }

 However, whenever I successfully sign on, I reach the TestPage BUT my
 links change to:

 http://localhost:8080/wicket/TestPage

 I should mention that these links are generated in a parent page, from
 which all my other pages extend.

 In my other form it works perfectly. It has the same package structure
 and looks pretty similar to login. It just sends an e-mail instead of
 setting a user object to the session.

 Any ideas why I could loos my mounting?

 My links are generated in the parents page like this:

 BookmarkablePageLinkParentPage home = new
 BookmarkablePageLinkParentPage(home, HomePage.class);
        add(home);


 Thanks in advance,
 Christian

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






 --
 http://www.grobmeier.de




 --
 http://www.grobmeier.de




-- 
http://www.grobmeier.de

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



Re: User configuration files

2011-01-30 Thread Christian Grobmeier
Igor,

thanks for your excellent tipps.

 the application settings are meant there for you to configure wicket,
 not your own application.

If ApplicationSettings is not to store settings for your application,
then I feel this name confusing. In the past years the name webapp
referred to my own webapplication, not the underlying framework.


 simply expose the properties in the application and then your
 components can get them like this:

 MyApplication.get().getProperty(foo);

 not so bad.

Yes, but I need to expose my applications class to the components,
which is not very generic and lets me create non-reusable stuff.
However, it is possible for prototyping or trivial apps.

 write a IComponentInstantiationListener and inject the properties, so
 you can have

 @Properties Properties props; fields in your component that are
 magically populated.

This is great thanks. I will use this now.

 there is no one way to do this, and its certainly not the job of the
 UI layer to handle it for you. thus we do not do it.

I understand there are hundreds of ways to go. But there should be at
least one standard way. Configuration of a web app is so basic. Even
UI frameworks need to be configured, at least when they are small
(prototyping). There are thousand ways for doing i18n, but wicket has
provided one way which can be extended.

 as a last note, you can leverage wicket's i18n to load properties
 stored in your MyApplication.properties.
 getString(myproperty) is all you need.

It feels a bit weird to use i18n for my configuration :-) But good to know :-)

Cheers + thanks for the conversation, I have learned much of it.
Christian


 -igor


 On Sat, Jan 29, 2011 at 11:02 AM, Christian Grobmeier
 grobme...@gmail.com wrote:
 On Sat, Jan 29, 2011 at 6:27 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 that actually looks pretty simple to me...

 On first glance yes. But bringing the application parameters into
 another component or api will become complicated.

 WIth this code I can only extend my Application with a new method
 (getProperties). I have to introduce a new interface to make my
 components generic, otherwise I need casting.

 I looked at the ApplicationSettings and I am wondering why this class
 does not provide the functionality to set user defined parameters in
 key/value manner. Are there any reasons against this? I can imagine a
 loadUserProperties which does what I wrote below and stores the
 key/values in ApplicationSettings.getValue( String key)

 -
 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





-- 
http://www.grobmeier.de

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



Best practice on i18n

2011-01-29 Thread Christian Grobmeier
Hello,

I have read and understand about i18n but I am curious about best practices.
Is it really a good option to have several language files per
component? F.e. my form component needs i18n, so does my page which
holds the form alone. Wicket does of course not search in the i18n
files for the page. I have the option to put all i18n in one file
(which is ok for the moment but will be worse later) or to add 4
language files.

Another alternative is to build up a custom IStringResourceLoader
which loads the list from the database. This seems the best option to
me from maintenance aspects.

Any comments appreciated :-)

Best regards,
Christian

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



Re: 1.5.x javadoc

2011-01-29 Thread Christian Grobmeier
I uploaded a 1.5 javadoc for my own use here:
http://projects.grobmeier.de/javadoc/wicket-core/1.5-snapshot/
Its from a 2 day old trunk version - guess this will not change much
until 1.5 is released


On Fri, Jan 28, 2011 at 5:43 PM, Zhubin Salehi zhubin.sal...@route1.com wrote:
 No 1.5.x!

 -Original Message-
 From: Steve Swinsburg [mailto:steve.swinsb...@gmail.com]
 Sent: January 28, 2011 12:04 AM
 To: users@wicket.apache.org
 Subject: Re: 1.5.x javadoc

 Wicket By Example has a section for the Javadocs, but it needs a refresh.
 http://wicketbyexample.com/api/

 cheers,
 Steve

 On 28/01/2011, at 10:36 AM, Todd Wolff wrote:

 Hi,



 Is there a URL where I can pull up javadoc for latest 1.5 RC without
 having to checkout source and generate myself?  Thanks.



 -
 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





-- 
http://www.grobmeier.de

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



User configuration files

2011-01-29 Thread Christian Grobmeier
Hello

I tried to figure out how one can load own configuration files into
wicket, for example with configuration on smtp host or something like
that.

It seems there is no standard way- is this correct? My solution is
below, but it feels rather overcomplicated to me.
I have overridden the init method and used the PropertiesFactory to
load my own properties file into a member variable of my application
class. I want my properties be available as long as the application
lives (application scope) and accessible from various components.

If you know any ways to make this easier, please let me know.

Thanks
Christian



In my WebApplication class:

@Override
public void init() {
...
 PropertiesFactory properties = new PropertiesFactory(this);
String configFile = WEB-INF/config-deployment.;

if(RuntimeConfigurationType.DEVELOPMENT.equals(this.getConfigurationType()))
{
configFile = WEB-INF/config-development.;
}
Properties p = properties.load(TimeAndBillApplication.class, 
configFile);
if(p != null) {
applicationProperties = new
Properties(applicationProperties, p.getAll());
}

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



Re: User configuration files

2011-01-29 Thread Christian Grobmeier
No.

I wanted to go with plain wicket. However, is it recommended by the
wicket team to use Spring? It is possible for me, but want to keep my
project as small as possible.

On Sat, Jan 29, 2011 at 5:23 PM, James Carman
ja...@carmanconsulting.com wrote:
 Are you using Spring?

 On Sat, Jan 29, 2011 at 11:17 AM, Christian Grobmeier
 grobme...@gmail.com wrote:
 Hello

 I tried to figure out how one can load own configuration files into
 wicket, for example with configuration on smtp host or something like
 that.

 It seems there is no standard way- is this correct? My solution is
 below, but it feels rather overcomplicated to me.
 I have overridden the init method and used the PropertiesFactory to
 load my own properties file into a member variable of my application
 class. I want my properties be available as long as the application
 lives (application scope) and accessible from various components.

 If you know any ways to make this easier, please let me know.

 Thanks
 Christian



 In my WebApplication class:

        @Override
        public void init() {
 ...
  PropertiesFactory properties = new PropertiesFactory(this);
            String configFile = WEB-INF/config-deployment.;
            
 if(RuntimeConfigurationType.DEVELOPMENT.equals(this.getConfigurationType()))
 {
                configFile = WEB-INF/config-development.;
            }
            Properties p = properties.load(TimeAndBillApplication.class, 
 configFile);
            if(p != null) {
                applicationProperties = new
 Properties(applicationProperties, p.getAll());
            }

 -
 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





-- 
http://www.grobmeier.de

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



Re: User configuration files

2011-01-29 Thread Christian Grobmeier
On Sat, Jan 29, 2011 at 6:27 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 that actually looks pretty simple to me...

On first glance yes. But bringing the application parameters into
another component or api will become complicated.

WIth this code I can only extend my Application with a new method
(getProperties). I have to introduce a new interface to make my
components generic, otherwise I need casting.

I looked at the ApplicationSettings and I am wondering why this class
does not provide the functionality to set user defined parameters in
key/value manner. Are there any reasons against this? I can imagine a
loadUserProperties which does what I wrote below and stores the
key/values in ApplicationSettings.getValue( String key)

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



cannot add component to Border

2011-01-25 Thread Christian Grobmeier
Hi,

I could create a page which is rendered with in a border. But when I
am following the Navomatic-example I failed when I added a component
to the border itself.

In my NavBorder.html:
 wicket:border
       wicket:link
         a href=Page1.htmlPage1/abr/
         a href=Page2.htmlPage2/abr/
         a href=Page3.htmlPage3/a
       /wicket:link

       wicket:body /

        span wicket:id = navigationBorder
              bNavigation Links/b
        /span
/wicket:border

In my code

class NavBorder extends Border
...
add(new BoxBorder(navigationBorder));

It looks like the example but fails with the error:

occurred
org.apache.wicket.markup.MarkupException: Unable to find component
with id 'navigationBorder' in [TabulatorNavigationBorder [Component id
= navigationBorder]].
This means that you declared wicket:id=navigationBorder in your
markup, but that you either did not add the component to your page at
all, or that the hierarchy does not match.

Without the navigationBorder it works as expected.

Any ideas what I am missing?

Thanks
Christian



-- 
http://www.grobmeier.de

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



Re: cannot add component to Border

2011-01-25 Thread Christian Grobmeier
thanks it worked!

On Tue, Jan 25, 2011 at 2:46 PM, Martin Grigorov mgrigo...@apache.org wrote:
 I guess this is Wicket 1.5
 Check the migration page. There is an entry for Border.addToBody()

 On Tue, Jan 25, 2011 at 2:39 PM, Christian Grobmeier 
 grobme...@gmail.comwrote:

 Hi,

 I could create a page which is rendered with in a border. But when I
 am following the Navomatic-example I failed when I added a component
 to the border itself.

 In my NavBorder.html:
  wicket:border
        wicket:link
          a href=Page1.htmlPage1/abr/
          a href=Page2.htmlPage2/abr/
          a href=Page3.htmlPage3/a
        /wicket:link

        wicket:body /

         span wicket:id = navigationBorder
               bNavigation Links/b
         /span
 /wicket:border

 In my code

 class NavBorder extends Border
 ...
 add(new BoxBorder(navigationBorder));

 It looks like the example but fails with the error:

 occurred
 org.apache.wicket.markup.MarkupException: Unable to find component
 with id 'navigationBorder' in [TabulatorNavigationBorder [Component id
 = navigationBorder]].
 This means that you declared wicket:id=navigationBorder in your
 markup, but that you either did not add the component to your page at
 all, or that the hierarchy does not match.

 Without the navigationBorder it works as expected.

 Any ideas what I am missing?

 Thanks
 Christian



 --
 http://www.grobmeier.de

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






-- 
http://www.grobmeier.de

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