7 Replies Latest reply on Nov 29, 2008 8:42 AM by jesper.pedersen

    Current Web app broken due to xhtml filename case issue

    rhills

      I checked out the latest JBoss Profiler 2 source from http://anonsvn.jboss.org/repos/jbossprofiler/branches/JBossProfiler2 and then built the Web Application:

      ant web


      I deployed the resulting jboss-profiler.war file to my jboss-as/server/default/deploy directory.

      When I accessed the Web app via http://localhost:8080/jboss-profiler, it redirected to http://localhost:8080/jboss-profiler/listsnapshot.faces and returned a 404.

      I looked into the source xhtml files to try and find the problem and discovered that while all the xhtml filenames were all lower case, references to them are all camel case. For example, in www/template/head.xhtml, the following lines appear:

      <ui:include src="/addClassPanel.xhtml"></ui:include>
      <ui:include src="/removeClassPanel.xhtml"></ui:include>
      
      , but the files they refer to are named addclasspanel.xhtml and removeclasspanel.xhtml respectively.

      I then renamed the relevant xhtml files using camel case and rebuilt the war file (using "ant web" again) and the web application now works correctly.

      Should the source files be renamed, or else the references be updated to match their names? I can submit a JIRA for this if required and/or submit the changes required if I can have commit rights to the SVN repository.

      Cheers,

      Rob Hills
      Waikiki, Western Australia

        • 1. Re: Current Web app broken due to xhtml filename case issue
          jesper.pedersen

          Hi Rob.

          The web-console is far from being done - and as I stated in the latest release notes we need people to work on it - so all your contributions in this area are most welcomed !

          I have fixed the head.xhtml issue you listed - but there are a lot of other issues that needs to be fixed. I havn't completed my review of the initial code contribution - so the code will change.

          Feel free to submit patches (unified diff) through JIRA -- I'll get the 2.x project setup soon. And just create posts here in the forum to discuss implementation details.

          As for commit rights -- it is something you earn over time through your code contributions ;)

          Thanks for your feedback !

          • 2. Re: Current Web app broken due to xhtml filename case issue
            jesper.pedersen
            • 3. Re: Current Web app broken due to xhtml filename case issue
              rhills

              Hi Jesper,

              "jesper.pedersen" wrote:

              The web-console is far from being done


              Yes, I'd seen that in other posts in this forum.

              "jesper.pedersen" wrote:

              - and as I stated in the latest release notes we need people to work on it - so all your contributions in this area are most welcomed !


              I'm happy to help where I can.

              "jesper.pedersen" wrote:

              I have fixed the head.xhtml issue you listed - but there are a lot of other issues that needs to be fixed. I havn't completed my review of the initial code contribution - so the code will change.


              OK, now just so I get this straight, the all-lower-case xhtml names are intentional and that's the coding convention, is that right? I took the approach of renaming the xhtml files themselves to restore the camel-case names that they seem to have had previously. That seemed the "path of least resistance" to get the webapp working, but if the standard is to have all-lower-case names, I'll go with that and submit some patches.

              "jesper.pedersen" wrote:

              Feel free to submit patches (unified diff) through JIRA -- I'll get the 2.x project setup soon.


              I see it's there now so as soon as you've clarified the coding standard, I'll get to work!

              Cheers,

              Rob Hills
              Waikiki, Western Australia

              • 4. Re: Current Web app broken due to xhtml filename case issue
                jesper.pedersen

                 

                OK, now just so I get this straight, the all-lower-case xhtml names are intentional and that's the coding convention, is that right?


                Correct for all .xhtml files -- and basically all 'web' based files in the web-frontend - like CSS, Skins, ... Indentation should use spaces.

                Additional things to look for

                * Access to Agent/Profiler should be done the same way as client/cmd/Client
                * The navigation rules are missing in faces-config.xml
                * All managed beans are declared in session scope
                * Place common functionality (command line / web) in the .client package - the APIs can be changed, but remember that the command line client has to work ;)

                Also use the JSF/RichFaces libraries as much as possible -- e.g. <h:outputLink> instead of and so on - makes it easier to skin later on.

                I would rather see a web front-end that is working before making it "fancy" -- e.g. output existing reports inside tags before using dynamic trees to display the thread reports. Of course it is up to you ;)

                Feel free to post questions - I'm happy to help out where I can.

                • 5. Re: Current Web app broken due to xhtml filename case issue
                  jesper.pedersen

                  It should be <h:outputLink> instead of < a > and < pre > tags...

                  • 6. Re: Current Web app broken due to xhtml filename case issue
                    rhills

                    Is there a coding standards document around anywhere? It might save me asking you lots of trivial questions like the following:

                    Do you use two spaces or four for indents? It seems to me that parts of the existing code use 2 and other parts use 4.

                    I prefer to tidy up code when I first look at it (indents, formatting etc). I then prefer to commit it to the repos separately (or post diffs in the case of this project) so that whitespace cleanups don't mask code changes. Are you OK with that or would you prefer some other modus operandi?


                    Cheers

                    Rob Hills


                    • 7. Re: Current Web app broken due to xhtml filename case issue
                      jesper.pedersen

                      No, there isn't a formal coding style document for the project.

                      Use 2 spaces for indentation and you can take a look at the other formatting rules in http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossprofiler/branches/JBossProfiler2/src/main/org/jboss/profiler/agent/ClassUtil.java?revision=439&view=markup

                      Feel free to submit a JIRA issue for the indentation issues.