4 Replies Latest reply on Jan 27, 2010 11:58 PM by Greg Zoller

    Seam and Wicket Newbie

    Greg Zoller Newbie

      I decided to try Wicket with a Seam project.  I read this great howto by Peter Muir: http://in.relation.to/Bloggers/SeamlessWicket, but am having trouble.


      I created the HelloPage.html in the src/web directory, seeing that wicket html pages needed to go with their corresponding source files.


      But what url do I hit to access this page?  localhost:8080/HelloPage.html gave me a 404.


      In the deployed ear file I can see that in WEB-INF/lib the wicket.jar and jboss-seam-wicket.jar files are present.  The components.xml has wicket set up and points to my application class.


      In WEB-INF/wicket there is a directory tree containing my application (extends SeamApplication), my HomePage.class and HomePage.html files.


      As per the article, all the JSF/RF stuff has been stripped out and I don't see references to them in either the libs or the config.


      A 404 suggests that something that is supposed to intercept my page request and process it through Wicket isn't happening.


      Any ideas?
      Thanks!
      Greg

        • 1. Re: Seam and Wicket Newbie
          Rob Shepherd Newbie

          If you didn't create a link to the page using the normal wicket components then you may be able to browse to:


          /...web app context.../?wicket:bookmarkablePage=:com.example.MyClass


          Wicket also let's you conveniently mount pages at particular paths like /...web app context.../Something


          ...but I haven't tried that in SEAM app, don't see why it wouldn't work, though.


          Try out making links in your Main class to point to your new class.  You'll find how it work easy enough.


          Regards


          Rob

          • 2. Re: Seam and Wicket Newbie
            Greg Zoller Newbie

            Rob,


            Thanks for the info!  The wicket:bookmarkablePage url worked fine.


            But I still have a problem getting my seam/wicket app bootstrapped, i.e. getting past the first page.  The seam view directory isn't wicket-enabled so how can I (from plan html) link into a wicket page in my application?  Looks like once inside the wicket page graph I'll be ok if I use the wicket:link tags.


            Thanks!
            Greg

            • 3. Re: Seam and Wicket Newbie
              Rob Shepherd Newbie

              if you just want to move from HTML-files to your app, then try mounts, as suggested previously.


              Wicket API Ref


              This provides a convenient layer of direction to any direct typing/linking you need.


              Regards


              Rob

              • 4. Re: Seam and Wicket Newbie
                Greg Zoller Newbie

                Woohoo!  That was what I needed.


                BTW, for anyone else reading this thread wanting to do a seam/wicket project I highly recommend this thread regarding a patch for seam-gen.  Works great with one hitch: the patch references a .classpath file containing a line mvel14.jar.  Seam 2.2.0 now uses mvel2.jar so you'll need to update this line in the patch but otherwise looks good.


                http://seamframework.org/Community/WicketSupportForSeamgen


                Thanks!
                Greg