Results 1 to 2 of 2

Thread: java server faces menu with mix of jsf and spring pages

  1. #1
    Join Date
    Nov 2004
    Location
    Rural Ireland
    Posts
    36

    Default java server faces menu with mix of jsf and spring pages

    Hi,
    I'm having a problem putting together a navigation menu for an application mixing both jsf and spring MVC controlled jsp pages. I'm writing the menu in jsf (using a myfaces navigationmenu component) - here's a snippet:
    Code:
        
    <x&#58;commandNavigation id="nav_2" value="#&#123;messages&#91;'rates'&#93;&#125;" >
            <x&#58;commandNavigation id="nav_2_1" value="#&#123;messages&#91;'rates_report'&#93;&#125;" action="go_rates_report" />
    This 'go_rates_report' action is defined in faces-config like this:
    Code:
            
    <navigation-case>
                <from-outcome>go_offered_rates</from-outcome>
                          <to-view-id>/myapp/rates/offered_rates_maintenance.htm</to-view-id>
    </navigation-case>
    Now, I'm mapping all .htm pages to the spring resolver itself - like this:
    Code:
        <servlet>
            <servlet-name>myapp</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>myapp</servlet-name>
            <url-pattern>*.htm</url-pattern>
        </servlet-mapping>
    However the faces menu seems not to attempt any further resolution of variables once the menu item is clicked, and I get a 'page not found' error in the jsp. I assume this is because the faces menu automatically resolves to the faces servlet, and the spring servlet is bypassed.
    My questions are:
    a) Does this approach to writing a menu for an app using both faces and spring pages make sense, and
    b) if it does, what am I doing wrong?
    and alternatively,
    c) if it doesn't, does any one else have any suggestions/sample code for easily putting together an application menu that will talk to both spring and jsf pages, and integrate with each of these pages as a template?

    Thanks
    Denis

  2. #2
    Join Date
    Nov 2004
    Location
    Rural Ireland
    Posts
    36

    Default

    FYI, I've solved this problem by using sitemesh - due to the fact that it sits in front of all controllers it plays well with both spring and jsf.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •