Thanks for the suggestion! I tried both methods so I can learn. I can see
myself using both approaches in the future.

Although I noticed one thing, I had a page with 2 forms and whenever I have
one of the forms submit my ajax call, a "TypeError: elements has no
properties" message is returned. This only occurs when I put the sitemesh
filter on. Most of the form elements were just generated using the struts
tags. I tried disabling the validate parameter and I didn't get the error
anymore. Could this error be part of the js code generated for validations?

Is it alright (or proper practice) to have 2 forms in one page calling
different actions?

Thanks again for the help!


Musachy Barroso wrote:
> 
> Another way (I like the pattern exclusion better) is to set a request
> attribute "decorator" to "none"
> 
> musachy
> 
> On 7/30/07, Mark Menard <[EMAIL PROTECTED]> wrote:
>> On 7/30/07 2:06 AM, "Grish" <[EMAIL PROTECTED]> wrote:
>>
>> >
>> > I tried taking a modified version of the Struts 2 + Spring 2 + JPA +
>> AJAX
>> > tutorial that I've done and integrated it with Sitemesh.
>> >
>> > I realized that if i have div tags with the ajax theme, Sitemesh will
>> > decorate that area so I will end up with and embedded decorator in the
>> main
>> > page. I need to exclude my AJAX calls from being decorated. I
>> understand
>> > that Sitemesh has a decorators.xml where you can specify which urls are
>> not
>> > to be decorated:
>> >
>> >   <!-- Any urls that are excluded will never be decorated by Sitemesh
>> -->
>> >   <excludes>
>> >     <pattern>/styles/*</pattern>
>> >     <pattern>/scripts/*</pattern>
>> >     <pattern>/images/*</pattern>
>> >     <pattern>/ajax/*</pattern>
>> >     <pattern>/dojo/*</pattern>
>> >     <pattern>/struts/*</pattern>
>> >     <pattern>/nodecorate/*</pattern>
>> >   </excludes>
>> >
>> > I first thought I simply had to move my jsps to a folder that was part
>> of
>> > the sitemesh excludes, like the ajax folder or the nodecorate folder. I
>> have
>> > a page called person.jsp and when I list the results of my search using
>> ajax
>> > I use the personList.jsp. I moved the personList.jsp to an excluded
>> folder
>> > but Sitemesh still decorated my personList.jsp.
>>
>> The exclusion is based on the requested URL, not where the file is in
>> your
>> project.
>>
>> This is what I did. I have two action definitions,
>>
>>
>> <action name=createPO" class="CreatePOAction" />
>> <action name="createPOAjax" class="CreatePOAction" />
>>
>>
>> Requests to createPO.action should be decorated, calls to
>> createPOAjax.action shouldn't.
>>
>>
>> <excludes>
>>     <pattern>*Ajax.action*</pattern>
>> </excludes>
>>
>> I'm not sure if the second * is necessary, but it works. I also use one
>> class with two action definitions. I have methods that handle the Ajax
>> stuff
>> in the same class file so everything is nicely contained and I use the
>> method argument to the request to call the specific method I want.
>>
>> Take care,
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--AJAX-with-Sitemesh-tf4168148.html#a11912793
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to