You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adrian Mitev <ad...@googlemail.com> on 2007/02/17 16:29:25 UTC

DefaultAddResource logs warning

Hi all! I'm doing ajax request and partial response but in the log i get the
following:

WARN  [DefaultAddResource] Response has no <head> or <body> tag:
.....

Idea where's the problem?

Re: DefaultAddResource logs warning

Posted by Jeff Bischoff <jb...@klkurz.com>.
If you are using ajax4jsf, you can use a4j:page tag to ensure all ajax 
requests contain a head and body tag. Then you will not see this error.

Paul Iov wrote:
> IMHO, turning off the log4j WARN level is quick'n'dirty approach. The 
> second choice after configuring servlet container would be probably to 
> provide <head>/<body> tags in every response and rely on some framework, 
> which strips out that duplicated tags automaticly, i.e. Ajax4jsf. It 
> works fine for me (and such warnings are then really important and usefull)
> 
> regards,
> paul
> 
> Simon Kitching schrieb:
>> Yes, it's related to the ExtensionsFilter.
>>
>> Tomahawk provides the ability for components to register text that 
>> they want to be inserted elsewhere in the page. After the page is 
>> completely processed, tomahawk's ExtensionsFilter goes back and 
>> post-processes the page to insert the registered items.
>>
>> Examples of things that can be registered by components are javascript 
>> and css in the head block of the page, javascript in the body tag's 
>> onload attribute etc. The jsCookMenu component uses this for example.
>>
>> If tomahawk goes to post-process the page but there is no <head> or 
>> <body> tag in the page then obviously it is difficult to insert any 
>> registered text :-)
>>
>> It's not normally a problem as pages do have a head and body. However 
>> in the case of Ajax fragments it's not true.
>>
>> The really correct solution is probably to somehow configure your 
>> web.xml so that AJAX requests don't pass through the ExtensionsFilter. 
>> However turning off the log4j messages is pretty safe; the only 
>> penalty is that if you have malformed non-ajax responses then Tomahawk 
>> will fail to insert any registered text but won't warn you.
>>
>> Regards,
>>
>> Simon
>>
>> Jay Balunas wrote:
>>> Are you using the Tomahawk ext filter?
>>>
>>> I get this as well, and it is the filter posting a warning that the 
>>> page being returned is not well formatted.  From my own research, and 
>>> looking I have found that simply turning off the warning using log4j 
>>> is the best way.
>>>
>>> I was also thinking of a Tomahawk improvement that would allow a 
>>> context param that would turn off format checking.
>>>
>>> Hope this helps.
>>> -Jay
>>>
>>> On 2/17/07, * Adrian Mitev* <adrian.mitev@googlemail.com 
>>> <ma...@googlemail.com>> wrote:
>>>
>>>     Hi all! I'm doing ajax request and partial response but in the log i
>>>     get the following:
>>>
>>>     WARN  [DefaultAddResource] Response has no <head> or <body> tag:
>>>     .....
>>>
>>>     Idea where's the problem?
>>>
>>>
>>
>>
> 
> 
> 
> 



Re: DefaultAddResource logs warning

Posted by Paul Iov <pa...@voller-ernst.de>.
IMHO, turning off the log4j WARN level is quick'n'dirty approach. The 
second choice after configuring servlet container would be probably to 
provide <head>/<body> tags in every response and rely on some framework, 
which strips out that duplicated tags automaticly, i.e. Ajax4jsf. It 
works fine for me (and such warnings are then really important and usefull)

regards,
paul

Simon Kitching schrieb:
> Yes, it's related to the ExtensionsFilter.
>
> Tomahawk provides the ability for components to register text that 
> they want to be inserted elsewhere in the page. After the page is 
> completely processed, tomahawk's ExtensionsFilter goes back and 
> post-processes the page to insert the registered items.
>
> Examples of things that can be registered by components are javascript 
> and css in the head block of the page, javascript in the body tag's 
> onload attribute etc. The jsCookMenu component uses this for example.
>
> If tomahawk goes to post-process the page but there is no <head> or 
> <body> tag in the page then obviously it is difficult to insert any 
> registered text :-)
>
> It's not normally a problem as pages do have a head and body. However 
> in the case of Ajax fragments it's not true.
>
> The really correct solution is probably to somehow configure your 
> web.xml so that AJAX requests don't pass through the ExtensionsFilter. 
> However turning off the log4j messages is pretty safe; the only 
> penalty is that if you have malformed non-ajax responses then Tomahawk 
> will fail to insert any registered text but won't warn you.
>
> Regards,
>
> Simon
>
> Jay Balunas wrote:
>> Are you using the Tomahawk ext filter?
>>
>> I get this as well, and it is the filter posting a warning that the 
>> page being returned is not well formatted.  From my own research, and 
>> looking I have found that simply turning off the warning using log4j 
>> is the best way.
>>
>> I was also thinking of a Tomahawk improvement that would allow a 
>> context param that would turn off format checking.
>>
>> Hope this helps.
>> -Jay
>>
>> On 2/17/07, * Adrian Mitev* <adrian.mitev@googlemail.com 
>> <ma...@googlemail.com>> wrote:
>>
>>     Hi all! I'm doing ajax request and partial response but in the log i
>>     get the following:
>>
>>     WARN  [DefaultAddResource] Response has no <head> or <body> tag:
>>     .....
>>
>>     Idea where's the problem?
>>
>>
>
>


Re: DefaultAddResource logs warning

Posted by Simon Kitching <si...@rhe.co.nz>.
Yes, it's related to the ExtensionsFilter.

Tomahawk provides the ability for components to register text that they 
want to be inserted elsewhere in the page. After the page is completely 
processed, tomahawk's ExtensionsFilter goes back and post-processes the 
page to insert the registered items.

Examples of things that can be registered by components are javascript 
and css in the head block of the page, javascript in the body tag's 
onload attribute etc. The jsCookMenu component uses this for example.

If tomahawk goes to post-process the page but there is no <head> or 
<body> tag in the page then obviously it is difficult to insert any 
registered text :-)

It's not normally a problem as pages do have a head and body. However in 
the case of Ajax fragments it's not true.

The really correct solution is probably to somehow configure your 
web.xml so that AJAX requests don't pass through the ExtensionsFilter. 
However turning off the log4j messages is pretty safe; the only penalty 
is that if you have malformed non-ajax responses then Tomahawk will fail 
to insert any registered text but won't warn you.

Regards,

Simon

Jay Balunas wrote:
> Are you using the Tomahawk ext filter?
> 
> I get this as well, and it is the filter posting a warning that the page 
> being returned is not well formatted.  From my own research, and looking 
> I have found that simply turning off the warning using log4j is the best 
> way.
> 
> I was also thinking of a Tomahawk improvement that would allow a context 
> param that would turn off format checking.
> 
> Hope this helps.
> -Jay
> 
> On 2/17/07, * Adrian Mitev* <adrian.mitev@googlemail.com 
> <ma...@googlemail.com>> wrote:
> 
>     Hi all! I'm doing ajax request and partial response but in the log i
>     get the following:
> 
>     WARN  [DefaultAddResource] Response has no <head> or <body> tag:
>     .....
> 
>     Idea where's the problem?
> 
> 


Re: DefaultAddResource logs warning

Posted by Jay Balunas <ba...@gmail.com>.
Are you using the Tomahawk ext filter?

I get this as well, and it is the filter posting a warning that the page
being returned is not well formatted.  From my own research, and looking I
have found that simply turning off the warning using log4j is the best way.

I was also thinking of a Tomahawk improvement that would allow a context
param that would turn off format checking.

Hope this helps.
-Jay

On 2/17/07, Adrian Mitev <ad...@googlemail.com> wrote:
>
> Hi all! I'm doing ajax request and partial response but in the log i get
> the following:
>
> WARN  [DefaultAddResource] Response has no <head> or <body> tag:
> .....
>
> Idea where's the problem?
>