You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Al Sutton <al...@alsutton.com> on 2008/01/30 18:50:36 UTC

[S2.1] Dojo plugin tree problem

I think I've found a problem in the dojo plugin but I'd like someone to 
double check I'm not doing anything whacky before raising a JIRA ticket.

I've got a webapp with the latest snapshots of core and dojo plugin. I also 
have a jsp with;

<%@taglib prefix="sd" uri="/struts-dojo-tags"%>
....

  <sd:tree id="objectTree"
     rootNode="%{#session.objectTree}"
     nodeIdProperty="id"
     nodeTitleProperty="name"
     childCollectionProperty="children"/>

When I try to load the page I get an NPE on line 257 of Tree.java which is;

        boolean generateId = 
!(Boolean)stack.getContext().get(Head.PARSE_CONTENT);


from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a 
null instead of a default value, and thus the !..... with autoboxing of the 
boolean causes the NPE.

Is there suppose to be a default set or have I missed a step which would set 
this up? 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Al Sutton <al...@alsutton.com>.
I'm hugely in favour of that, but it still won't fix our autoboxing problem 
(if it is one) :).

Al.

----- Original Message ----- 
From: "Martin Cooper" <ma...@apache.org>
To: "Struts Developers List" <de...@struts.apache.org>
Sent: Wednesday, January 30, 2008 5:54 PM
Subject: Re: [S2.1] Dojo plugin tree problem


> On Jan 30, 2008 9:50 AM, Al Sutton <al...@alsutton.com> wrote:
>
>> I think I've found a problem in the dojo plugin but I'd like someone to
>> double check I'm not doing anything whacky before raising a JIRA ticket.
>
>
> One of the Dojo devs pinged me the other day to "remind" me that we're 
> still
> using Dojo 0.4, which is pretty much ancient history for Dojo. Perhaps we
> should consider updating to Dojo 1.0.2, which is the latest release?
>
> --
> Martin Cooper
>
>
>> I've got a webapp with the latest snapshots of core and dojo plugin. I
>> also
>> have a jsp with;
>>
>> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
>> ....
>>
>>  <sd:tree id="objectTree"
>>     rootNode="%{#session.objectTree}"
>>     nodeIdProperty="id"
>>     nodeTitleProperty="name"
>>     childCollectionProperty="children"/>
>>
>> When I try to load the page I get an NPE on line 257 of Tree.java which
>> is;
>>
>>        boolean generateId =
>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>>
>>
>> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a
>> null instead of a default value, and thus the !..... with autoboxing of
>> the
>> boolean causes the NPE.
>>
>> Is there suppose to be a default set or have I missed a step which would
>> set
>> this up?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Martin Cooper <ma...@apache.org>.
On Jan 30, 2008 9:50 AM, Al Sutton <al...@alsutton.com> wrote:

> I think I've found a problem in the dojo plugin but I'd like someone to
> double check I'm not doing anything whacky before raising a JIRA ticket.


One of the Dojo devs pinged me the other day to "remind" me that we're still
using Dojo 0.4, which is pretty much ancient history for Dojo. Perhaps we
should consider updating to Dojo 1.0.2, which is the latest release?

--
Martin Cooper


> I've got a webapp with the latest snapshots of core and dojo plugin. I
> also
> have a jsp with;
>
> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
> ....
>
>  <sd:tree id="objectTree"
>     rootNode="%{#session.objectTree}"
>     nodeIdProperty="id"
>     nodeTitleProperty="name"
>     childCollectionProperty="children"/>
>
> When I try to load the page I get an NPE on line 257 of Tree.java which
> is;
>
>        boolean generateId =
> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>
>
> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a
> null instead of a default value, and thus the !..... with autoboxing of
> the
> boolean causes the NPE.
>
> Is there suppose to be a default set or have I missed a step which would
> set
> this up?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: [struts-dev] [S2.1] One Step On.... the Dojo plugin tree problem

Posted by Al Sutton <al...@alsutton.com>.
Dale,

Thanks for the tips. I've updated the ftl file with a default that works 
with a null returned by the child property, so I'll be putting a patch into 
JIRA.

Al.

----- Original Message ----- 
From: "Dale Newfield" <Da...@Newfield.org>
To: "Struts Developers List" <de...@struts.apache.org>
Sent: Wednesday, January 30, 2008 8:07 PM
Subject: Re: [struts-dev] [S2.1] One Step On.... the Dojo plugin tree 
problem


> Dale Newfield wrote:
>> A previous example has a three character solution: 
>> https://issues.apache.org/struts/browse/WW-2383 , for this one it appears 
>> that a single "!" may be sufficient.
>>
>> Excerpted from 
>> <http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_missing_default>: 
>> If the default value is omitted, then it will be empty string and empty 
>> sequence and empty hash at the same time.
>
> Now that I read it again, the single character addition would probably 
> have been sufficient for the previous bug, too.  If we want to be 
> explicit, I think "![]" will use an empty sequence as the default value 
> here, but it seems unnecessary (and from the docs I'm still unclear 
> whether that syntax is valid).
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [struts-dev] [S2.1] One Step On.... the Dojo plugin tree problem

Posted by Dale Newfield <Da...@Newfield.org>.
Dale Newfield wrote:
> A previous example has a three 
> character solution:  https://issues.apache.org/struts/browse/WW-2383 , 
> for this one it appears that a single "!" may be sufficient.
> 
> Excerpted from 
> <http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_missing_default>: 
>  If the default value is omitted, then it will be empty string and empty 
> sequence and empty hash at the same time.

Now that I read it again, the single character addition would probably 
have been sufficient for the previous bug, too.  If we want to be 
explicit, I think "![]" will use an empty sequence as the default value 
here, but it seems unnecessary (and from the docs I'm still unclear 
whether that syntax is valid).

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [struts-dev] [S2.1] One Step On.... the Dojo plugin tree problem

Posted by Dale Newfield <Da...@Newfield.org>.
Al Sutton wrote:
> OK, it would appear that if any node in the tree has a null for the 
> value of the child property the following error is reported by FreeMarker;

This is really another example of a broader problem with many of the 
.ftl templates in the struts2 codebase.  A previous example has a three 
character solution:  https://issues.apache.org/struts/browse/WW-2383 , 
for this one it appears that a single "!" may be sufficient.

Excerpted from 
<http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_missing_default>: 
  If the default value is omitted, then it will be empty string and 
empty sequence and empty hash at the same time.

> Expression 
> stack.findValue(parameters.childCollectionProperty.toString()) is 
> undefined on line 24, column 8 in template/ajax/treenode-include.ftl.
> The problematic instruction:

I'm not sure how to describe this well, but I'd suggest a broad jira 
ticket to look through and provide defaults in the .ftl templates for 
pretty much anywhere there's a "stack.findValue()" call...

> Now here's the question; Are we going to allow users to represent leaf 
> nodes in the tree by having a null for the child property, or are we 
> going to say that all nodes must return a valid instance of a 
> java.util.Collection when the child property is fetched?

This basically means all those db objects with collections as attributes 
need to replace the simple "return FOO" in their getters with "if 
(FOO==null) return new mumble(); else return FOO".  While this isn't a 
bad idea, I would hate to have the presentation layer break if it's not 
done..

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


[S2.1] One Step On.... the Dojo plugin tree problem

Posted by Al Sutton <al...@alsutton.com>.
OK, it would appear that if any node in the tree has a null for the value of 
the child property the following error is reported by FreeMarker;

Expression stack.findValue(parameters.childCollectionProperty.toString()) is 
undefined on line 24, column 8 in template/ajax/treenode-include.ftl.
The problematic instruction:
----------
==> list stack.findValue(parameters.childCollectionProperty.toString()) as 
child [on line 24, column 1 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on line 
26, column 5 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on line 
26, column 5 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on line 
124, column 5 in template/ajax/tree.ftl]
----------

which in turn was causing the problem with Sitemesh I was seeing.

Now here's the question; Are we going to allow users to represent leaf nodes 
in the tree by having a null for the child property, or are we going to say 
that all nodes must return a valid instance of a java.util.Collection when 
the child property is fetched?

Al.


----- Original Message ----- 
From: "Al Sutton" <al...@alsutton.com>
To: "Struts Developers List" <de...@struts.apache.org>
Sent: Wednesday, January 30, 2008 7:07 PM
Subject: Re: [S2.1] Dojo plugin tree problem


> Bingo :).
>
> Now I've got to work out why I'm getting the following error in sitemesh;
>
> java.lang.ArrayIndexOutOfBoundsException: -1
> com.opensymphony.module.sitemesh.html.HTMLProcessor$1.currentBuffer(HTMLProcessor.java:74) 
> com.opensymphony.module.sitemesh.html.State.handleText(State.java:64) 
> com.opensymphony.module.sitemesh.html.HTMLProcessor$2.text(HTMLProcessor.java:103) 
> com.opensymphony.module.sitemesh.html.tokenizer.Parser.parsedText(Parser.java:295) 
> com.opensymphony.module.sitemesh.html.tokenizer.Parser.parseTag(Parser.java:160) 
> com.opensymphony.module.sitemesh.html.tokenizer.Parser.start(Parser.java:112) 
> com.opensymphony.module.sitemesh.html.tokenizer.TagTokenizer.start(TagTokenizer.java:33) 
> com.opensymphony.module.sitemesh.html.HTMLProcessor.process(HTMLProcessor.java:90) 
> com.opensymphony.module.sitemesh.parser.HTMLPageParser.parse(HTMLPageParser.java:52) 
> com.opensymphony.module.sitemesh.filter.Buffer.parse(Buffer.java:49) 
> com.opensymphony.module.sitemesh.filter.PageResponseWrapper.getPage(PageResponseWrapper.java:165) 
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:12
> 4) 
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55) 
> org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:96)----- 
> Original Message -----From: "Musachy Barroso" <mu...@gmail.com>To: 
> "Struts Developers List" <de...@struts.apache.org>Sent: Wednesday, January 
> 30, 2008 6:48 PMSubject: Re: [S2.1] Dojo plugin tree problem> you are 
> missing sd:head on the page.>> musachy>> On Jan 30, 2008 12:50 PM, Al 
> Sutton <al...@alsutton.com> wrote:>> I think I've found a problem in 
> the dojo plugin but I'd like someone to>> double check I'm not doing 
> anything whacky before raising a JIRA ticket.>>>> I've got a webapp with 
> the latest snapshots of core and dojo plugin. Ialso>> have a jsp with;>>>> 
> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>>> ....>>>>   <sd:tree 
> id="objectTree">>      rootNode="%{#session.objectTree}">> 
> nodeIdProperty="id">>      nodeTitleProperty="name">> 
> childCollectionProperty="children"/>>>>> When I try to load the page I get 
> an NPE on line 257 of Tree.java whichis;>>>>         boolean generateId 
> =>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);>>>>>> from what 
> I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a>> null 
> instead of a default value, and thus the !..... with autoboxing ofthe>> 
> boolean causes the NPE.>>>> Is there suppose to be a default set or have I 
> missed a step which wouldset>> this 
> up?>>>>>> --------------------------------------------------------------------->> 
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org>> For additional 
> commands, e-mail: dev-help@struts.apache.org>>>>>>>> --> "Hey you! Would 
> you help me to carry the stone?" Pink 
> Floyd>> ---------------------------------------------------------------------> 
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org> For additional 
> commands, e-mail: dev-help@struts.apache.org>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [struts-dev] [S2.1] Dojo plugin tree problem

Posted by Dale Newfield <Da...@Newfield.org>.
Al Sutton wrote:
> Now I've got to work out why I'm getting the following error in sitemesh;

I think I saw similar exceptions from sitemesh when an earlier component 
dumped an exception into the stream in a non-valid xml manner.  My first 
suggestion would be to turn off sitemesh and see if a different error 
becomes evident.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Al Sutton <al...@alsutton.com>.
Bingo :).

Now I've got to work out why I'm getting the following error in sitemesh;

java.lang.ArrayIndexOutOfBoundsException: -1
 com.opensymphony.module.sitemesh.html.HTMLProcessor$1.currentBuffer(HTMLProcessor.java:74) com.opensymphony.module.sitemesh.html.State.handleText(State.java:64) com.opensymphony.module.sitemesh.html.HTMLProcessor$2.text(HTMLProcessor.java:103) com.opensymphony.module.sitemesh.html.tokenizer.Parser.parsedText(Parser.java:295) com.opensymphony.module.sitemesh.html.tokenizer.Parser.parseTag(Parser.java:160) com.opensymphony.module.sitemesh.html.tokenizer.Parser.start(Parser.java:112) com.opensymphony.module.sitemesh.html.tokenizer.TagTokenizer.start(TagTokenizer.java:33) com.opensymphony.module.sitemesh.html.HTMLProcessor.process(HTMLProcessor.java:90) com.opensymphony.module.sitemesh.parser.HTMLPageParser.parse(HTMLPageParser.java:52) com.opensymphony.module.sitemesh.filter.Buffer.parse(Buffer.java:49) com.opensymphony.module.sitemesh.filter.PageResponseWrapper.getPage(PageResponseWrapper.java:165) com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:12
 4) com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:96)----- Original Message -----From: "Musachy Barroso" <mu...@gmail.com>To: "Struts Developers List" <de...@struts.apache.org>Sent: Wednesday, January 30, 2008 6:48 PMSubject: Re: [S2.1] Dojo plugin tree problem> you are missing sd:head on the page.>> musachy>> On Jan 30, 2008 12:50 PM, Al Sutton <al...@alsutton.com> wrote:>> I think I've found a problem in the dojo plugin but I'd like someone to>> double check I'm not doing anything whacky before raising a JIRA ticket.>>>> I've got a webapp with the latest snapshots of core and dojo plugin. Ialso>> have a jsp with;>>>> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>>> ....>>>>   <sd:tree id="objectTree">>      rootNode="%{#session.objectTree}">>      nodeIdProperty="id">>      nodeTitleProperty="name">>      childCollectionProperty="children"/>>>>> When 
 I try to load the page I get an NPE on line 257 of Tree.java whichis;>>>>         boolean generateId =>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);>>>>>> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a>> null instead of a default value, and thus the !..... with autoboxing ofthe>> boolean causes the NPE.>>>> Is there suppose to be a default set or have I missed a step which wouldset>> this up?>>>>>> --------------------------------------------------------------------->> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org>> For additional commands, e-mail: dev-help@struts.apache.org>>>>>>>> --> "Hey you! Would you help me to carry the stone?" Pink Floyd>> ---------------------------------------------------------------------> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org> For additional commands, e-mail: dev-help@struts.apache.org>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Al Sutton <al...@alsutton.com>.
Ouch. I can now see why your patch seems the only sensible solution.

Al.

----- Original Message ----- 
From: "Jeromy Evans" <je...@blueskyminds.com.au>
To: "Struts Developers List" <de...@struts.apache.org>
Sent: Thursday, January 31, 2008 10:03 AM
Subject: Re: [S2.1] Dojo plugin tree problem


> Hi Al,
>
> Yes, I agree.  For instance, the patch only applies to AbstractRemoteBean 
> whereas the issue encroaches on Tree.java and probably others.
>
> The issue is slightly bigger than just forgetting the head tag.  It is 
> specifically that:
> - the dojo tags now depends on a head tag writing to the page context; but
> - in certain cases the head tag cannot be included within the context 
> available to the current tag
>
> eg. If the tag is in a JSP loaded via XHR, the JSP fragment can't 
> contain -another- head tag so an NPE will occur when that fragment is 
> rendered
>
> Al Sutton wrote:
>> Jeromy,
>>
>> I like your solution, but I think a call needs to be made by the 
>> developers who have been here longer (and therefore have a better view of 
>> the big picture).
>>
>> Either your patch should be applied, or a more friendly way of 
>> automatically saying "You've forgotten the <:head> tag" needs to be 
>> developed, because I believe the current situation creates an error which 
>> is too obscure for the average developer to easily discover what the 
>> problem is.
>>
>> Anyone have any other thoughts?
>>
>> Al.
>>
>> ----- Original Message ----- From: "Jeromy Evans" 
>> <je...@blueskyminds.com.au>
>> To: "Struts Developers List" <de...@struts.apache.org>
>> Sent: Thursday, January 31, 2008 12:08 AM
>> Subject: Re: [S2.1] Dojo plugin tree problem
>>
>>
>>> Al,
>>>
>>> There is indeed a related bug, but the issue is only realized when the 
>>> head tag CANNOT be processed within the current page context.
>>> (eg. within a fragment loaded via XHR)
>>>
>>> https://issues.apache.org/struts/browse/WW-2398
>>>
>>> regards,
>>> Jeromy Evans
>>>
>>>
>>> Musachy Barroso wrote:
>>>> you are missing sd:head on the page.
>>>>
>>>> musachy
>>>>
>>>> On Jan 30, 2008 12:50 PM, Al Sutton <al...@alsutton.com> wrote:
>>>>
>>>>> I think I've found a problem in the dojo plugin but I'd like someone 
>>>>> to
>>>>> double check I'm not doing anything whacky before raising a JIRA 
>>>>> ticket.
>>>>>
>>>>> I've got a webapp with the latest snapshots of core and dojo plugin. I 
>>>>> also
>>>>> have a jsp with;
>>>>>
>>>>> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
>>>>> ....
>>>>>
>>>>>   <sd:tree id="objectTree"
>>>>>      rootNode="%{#session.objectTree}"
>>>>>      nodeIdProperty="id"
>>>>>      nodeTitleProperty="name"
>>>>>      childCollectionProperty="children"/>
>>>>>
>>>>> When I try to load the page I get an NPE on line 257 of Tree.java 
>>>>> which is;
>>>>>
>>>>>         boolean generateId =
>>>>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>>>>>
>>>>>
>>>>> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) 
>>>>> returns a
>>>>> null instead of a default value, and thus the !..... with autoboxing 
>>>>> of the
>>>>> boolean causes the NPE.
>>>>>
>>>>> Is there suppose to be a default set or have I missed a step which 
>>>>> would set
>>>>> this up?
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Hi Al,

Yes, I agree.  For instance, the patch only applies to 
AbstractRemoteBean whereas the issue encroaches on Tree.java and 
probably others.

The issue is slightly bigger than just forgetting the head tag.  It is 
specifically that:
 - the dojo tags now depends on a head tag writing to the page context; but
 - in certain cases the head tag cannot be included within the context 
available to the current tag

eg. If the tag is in a JSP loaded via XHR, the JSP fragment can't 
contain -another- head tag so an NPE will occur when that fragment is 
rendered

Al Sutton wrote:
> Jeromy,
>
> I like your solution, but I think a call needs to be made by the 
> developers who have been here longer (and therefore have a better view 
> of the big picture).
>
> Either your patch should be applied, or a more friendly way of 
> automatically saying "You've forgotten the <:head> tag" needs to be 
> developed, because I believe the current situation creates an error 
> which is too obscure for the average developer to easily discover what 
> the problem is.
>
> Anyone have any other thoughts?
>
> Al.
>
> ----- Original Message ----- From: "Jeromy Evans" 
> <je...@blueskyminds.com.au>
> To: "Struts Developers List" <de...@struts.apache.org>
> Sent: Thursday, January 31, 2008 12:08 AM
> Subject: Re: [S2.1] Dojo plugin tree problem
>
>
>> Al,
>>
>> There is indeed a related bug, but the issue is only realized when 
>> the head tag CANNOT be processed within the current page context.
>> (eg. within a fragment loaded via XHR)
>>
>> https://issues.apache.org/struts/browse/WW-2398
>>
>> regards,
>> Jeromy Evans
>>
>>
>> Musachy Barroso wrote:
>>> you are missing sd:head on the page.
>>>
>>> musachy
>>>
>>> On Jan 30, 2008 12:50 PM, Al Sutton <al...@alsutton.com> wrote:
>>>
>>>> I think I've found a problem in the dojo plugin but I'd like 
>>>> someone to
>>>> double check I'm not doing anything whacky before raising a JIRA 
>>>> ticket.
>>>>
>>>> I've got a webapp with the latest snapshots of core and dojo 
>>>> plugin. I also
>>>> have a jsp with;
>>>>
>>>> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
>>>> ....
>>>>
>>>>   <sd:tree id="objectTree"
>>>>      rootNode="%{#session.objectTree}"
>>>>      nodeIdProperty="id"
>>>>      nodeTitleProperty="name"
>>>>      childCollectionProperty="children"/>
>>>>
>>>> When I try to load the page I get an NPE on line 257 of Tree.java 
>>>> which is;
>>>>
>>>>         boolean generateId =
>>>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>>>>
>>>>
>>>> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) 
>>>> returns a
>>>> null instead of a default value, and thus the !..... with 
>>>> autoboxing of the
>>>> boolean causes the NPE.
>>>>
>>>> Is there suppose to be a default set or have I missed a step which 
>>>> would set
>>>> this up?
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Al Sutton <al...@alsutton.com>.
Jeromy,

I like your solution, but I think a call needs to be made by the developers 
who have been here longer (and therefore have a better view of the big 
picture).

Either your patch should be applied, or a more friendly way of automatically 
saying "You've forgotten the <:head> tag" needs to be developed, because I 
believe the current situation creates an error which is too obscure for the 
average developer to easily discover what the problem is.

Anyone have any other thoughts?

Al.

----- Original Message ----- 
From: "Jeromy Evans" <je...@blueskyminds.com.au>
To: "Struts Developers List" <de...@struts.apache.org>
Sent: Thursday, January 31, 2008 12:08 AM
Subject: Re: [S2.1] Dojo plugin tree problem


> Al,
>
> There is indeed a related bug, but the issue is only realized when the 
> head tag CANNOT be processed within the current page context.
> (eg. within a fragment loaded via XHR)
>
> https://issues.apache.org/struts/browse/WW-2398
>
> regards,
> Jeromy Evans
>
>
> Musachy Barroso wrote:
>> you are missing sd:head on the page.
>>
>> musachy
>>
>> On Jan 30, 2008 12:50 PM, Al Sutton <al...@alsutton.com> wrote:
>>
>>> I think I've found a problem in the dojo plugin but I'd like someone to
>>> double check I'm not doing anything whacky before raising a JIRA ticket.
>>>
>>> I've got a webapp with the latest snapshots of core and dojo plugin. I 
>>> also
>>> have a jsp with;
>>>
>>> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
>>> ....
>>>
>>>   <sd:tree id="objectTree"
>>>      rootNode="%{#session.objectTree}"
>>>      nodeIdProperty="id"
>>>      nodeTitleProperty="name"
>>>      childCollectionProperty="children"/>
>>>
>>> When I try to load the page I get an NPE on line 257 of Tree.java which 
>>> is;
>>>
>>>         boolean generateId =
>>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>>>
>>>
>>> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns 
>>> a
>>> null instead of a default value, and thus the !..... with autoboxing of 
>>> the
>>> boolean causes the NPE.
>>>
>>> Is there suppose to be a default set or have I missed a step which would 
>>> set
>>> this up?
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Al,

There is indeed a related bug, but the issue is only realized when the 
head tag CANNOT be processed within the current page context.
(eg. within a fragment loaded via XHR)

https://issues.apache.org/struts/browse/WW-2398

regards,
 Jeromy Evans


Musachy Barroso wrote:
> you are missing sd:head on the page.
>
> musachy
>
> On Jan 30, 2008 12:50 PM, Al Sutton <al...@alsutton.com> wrote:
>   
>> I think I've found a problem in the dojo plugin but I'd like someone to
>> double check I'm not doing anything whacky before raising a JIRA ticket.
>>
>> I've got a webapp with the latest snapshots of core and dojo plugin. I also
>> have a jsp with;
>>
>> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
>> ....
>>
>>   <sd:tree id="objectTree"
>>      rootNode="%{#session.objectTree}"
>>      nodeIdProperty="id"
>>      nodeTitleProperty="name"
>>      childCollectionProperty="children"/>
>>
>> When I try to load the page I get an NPE on line 257 of Tree.java which is;
>>
>>         boolean generateId =
>> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>>
>>
>> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a
>> null instead of a default value, and thus the !..... with autoboxing of the
>> boolean causes the NPE.
>>
>> Is there suppose to be a default set or have I missed a step which would set
>> this up?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>>     
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [S2.1] Dojo plugin tree problem

Posted by Musachy Barroso <mu...@gmail.com>.
you are missing sd:head on the page.

musachy

On Jan 30, 2008 12:50 PM, Al Sutton <al...@alsutton.com> wrote:
> I think I've found a problem in the dojo plugin but I'd like someone to
> double check I'm not doing anything whacky before raising a JIRA ticket.
>
> I've got a webapp with the latest snapshots of core and dojo plugin. I also
> have a jsp with;
>
> <%@taglib prefix="sd" uri="/struts-dojo-tags"%>
> ....
>
>   <sd:tree id="objectTree"
>      rootNode="%{#session.objectTree}"
>      nodeIdProperty="id"
>      nodeTitleProperty="name"
>      childCollectionProperty="children"/>
>
> When I try to load the page I get an NPE on line 257 of Tree.java which is;
>
>         boolean generateId =
> !(Boolean)stack.getContext().get(Head.PARSE_CONTENT);
>
>
> from what I can tell stack.getContext().get(Head.PARSE_CONTENT) returns a
> null instead of a default value, and thus the !..... with autoboxing of the
> boolean causes the NPE.
>
> Is there suppose to be a default set or have I missed a step which would set
> this up?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org