I am glad you got an understanding of the problem... but it did not explain
what was going on
to me. No matter what I did, the default decorator would always be used.
Below is my decorators
file. You can see I pretty much tried every path I could think of.
Eventually I tracked it 
down to a bug in site mesh version 2.2.1 in
com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper.getDecorator(...)
where the path is not correctly determined.

<decorators defaultdir="/decorators">    
    <excludes>
        <pattern>/resources/*</pattern>
        <pattern>/dwr/*</pattern>
    </excludes> 

   <decorator name="developer2" page="2col.jsp">                
        <pattern>/developer/*</pattern>
        <pattern>/developer/developer.html</pattern>
        <pattern>/pages/developer/test2.jsp</pattern>        
        <pattern>/pages/developer/*</pattern>
        <pattern>*developer*</pattern>
    </decorator>

    <decorator name="default" page="3col.jsp">
        <pattern>/*</pattern>
    </decorator>
</decorators>

The bug is fixed in sitemesh version 2.3. Please create a bug report
requesting an upgrade of the sitemesh dependency. In the mean time you can
modify your pom to work as follows:

    <dependencies>
        <dependency>
            <groupId>org.appfuse</groupId>
            <artifactId>appfuse-${web.framework}</artifactId>
            <version>${appfuse.version}</version>
            <type>war</type>
            
                        <exclusions> <!-- Use a new version of site mesh -->
                                <exclusion>
                                  <groupId>opensymphony</groupId>
                                        <artifactId>sitemesh</artifactId>       
                                
                                </exclusion>
                        </exclusions>                                           
        
        </dependency>

        <!-- Sitemesh 2.3 fixes a bug in 
            
com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper.getDecorator(...)
             where the path is not correctly determined
          -->
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
            <version>2.3</version>
        </dependency>        

Cheers
     Caleb





Philip Barlow wrote:
> 
> I understand now, thanks.
> 
> I may take Sanjiv's advice and debug the code also, nothing like getting
> under the hood to see how things work...
> 
> 
> mraible wrote:
>> 
>> AFAICT, it works because the URLs you specified in your decorators.xml
>> are paths to your JSPs, which are "forwarded" to by your
>> actions/controllers.
>> 
>> Matt
>> 
>> On 5/25/07, Philip Barlow <[EMAIL PROTECTED]> wrote:
>>>
>>> I added <dispatcher>FORWARD</dispatcher> and it works, thanks alot. Now
>>> i
>>> need to understand why it works but i'll figure that out myself by RTFM!
>>>
>>> Thanks again Matt.
>>>
>>>
>>> mraible wrote:
>>> >
>>> > Since you don't have <dispatcher>FORWARD</dispatcher>, you should make
>>> > sure your URLs are what's served up by controllers/actions/etc.,
>>> > rather than view paths. If you have REQUEST and FORWARD in your
>>> > mapping, you'll need to specify both the controller/action path and
>>> > the view path.
>>> >
>>> > Matt
>>> >
>>> > On 5/25/07, Philip Barlow <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >> Thanks for the quick reply Matt, the filter mapping is below and i
>>> have
>>> >> tried
>>> >> switching the order of the decorators but to no avail, i will
>>> experiment
>>> >> with this for the time being.
>>> >>
>>> >>
>>> >> <filter>
>>> >>     <filter-name>sitemesh</filter-name>
>>> >>
>>> >>
>>> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
>>> >> </filter>
>>> >> <filter-mapping>
>>> >>     <filter-name>sitemesh</filter-name>
>>> >>     <url-pattern>/*</url-pattern>
>>> >> </filter-mapping>
>>> >>
>>> >>
>>> >>
>>> >> mraible wrote:
>>> >> >
>>> >> > If you move the main decorator under the centred one, does it work
>>> >> > better? What does your filter-mapping for SiteMesh look like?
>>> >> >
>>> >> > Matt
>>> >> >
>>> >> > On 5/25/07, Philip Barlow <[EMAIL PROTECTED]> wrote:
>>> >> >>
>>> >> >> Hi guys,
>>> >> >>
>>> >> >> Hopefully someone can help me out here. I am trying to get an old
>>> >> project
>>> >> >> that used tiles to work with Sitemesh and Struts 2. Sitemesh is
>>> pretty
>>> >> >> cool
>>> >> >> by the way but i am having a problem with specifying which pages i
>>> >> want
>>> >> >> decorated.
>>> >> >>
>>> >> >> My setup is jsp pages are in /WEB-INF/pages/[several folders]
>>> >> >> Logon pages are under /WEB-INF/pages/logon
>>> >> >>
>>> >> >> What i want to do is decorate the pages in the logon pages with
>>> >> >> centred.jsp
>>> >> >> and the other pages with  main.jsp so i have put this in my
>>> >> >> decorators.xml:
>>> >> >>
>>> >> >> <decorator name="main" page="main.jsp">
>>> >> >>     <pattern>/*</pattern>
>>> >> >> </decorator>
>>> >> >>
>>> >> >> <decorator name="centred" page="centred.jsp" >
>>> >> >>     <pattern>/WEB-INF/pages/logon/*</pattern>
>>> >> >>     <pattern>/pages/logon/*</pattern>
>>> >> >>     <pattern>../WEB-INF/pages/logon/*</pattern>
>>> >> >>     <pattern>../pages/logon/*</pattern>
>>> >> >>     .........
>>> >> >>     [and several other combinations]
>>> >> >>     .........
>>> >> >> </decorator>
>>> >> >>
>>> >> >> The problem is the logon pages don't get decorated at all. I also
>>> >> removed
>>> >> >> the main.jsp as i though this might be overriding but no joy. I
>>> tried
>>> >> >> specifying /* as a pattern under "centred" and this works.
>>> >> >>
>>> >> >> I assume this is a problem with how i am declaring the pattern to
>>> find
>>> >> >> the
>>> >> >> logon pages but i am all out of ideas at this stage and i can't
>>> find
>>> >> any
>>> >> >> help through google....
>>> >> >>
>>> >> >> Thanks in advance,
>>> >> >>
>>> >> >> Philip
>>> >> >>
>>> >> >> --
>>> >> >> View this message in context:
>>> >> >>
>>> http://www.nabble.com/Driving-me-nuts%21-tf3816362s2369.html#a10803792
>>> >> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Driving-me-nuts%21-tf3816362s2369.html#a11431793
Sent from the AppFuse - User mailing list archive at Nabble.com.

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

Reply via email to