You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by stanlick <st...@gmail.com> on 2008/07/29 14:43:57 UTC

Is this a wart on the framework?

I have been away from Struts 2 for many months and was prompted with this
question yesterday:

Why does this code throw a null pointer exception?

<s:url action="employeeAction_subsetByDepartment">
    <s:param id="department" value="%{#attr.currRow.department}"/>
</s:url>

After jacking around with it for nearly an hour I realized that id should be
name!  It seems the adjoining tags were using the id attribute and this
developer had applied common sense and used id here as well.  Now I realize
the JSTL/OGNL debate has caused much consternation among developers and I
have sort of gotten over that whole mess.  But this tipped my scale!  What
gives with the Struts 2 tag library?  Seriously, step outside yourself and
think about it before you answer.  Is this a wart on the framework? 

Peace,
Scott
-- 
View this message in context: http://www.nabble.com/Is-this-a-wart-on-the-framework--tp18711301p18711301.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Is this a wart on the framework?

Posted by stanlick <st...@gmail.com>.
That is good news!  When presented with a new framework to consider, easily
being able to present a dynamic web page is sort of a big deal.:rules:  If
you look across the attributes/docs on the struts tags you find the primary
attributes key, name and id are sprinkled around placing the developer at
the mercy of trial and error.  I seriously wonder if the best bet would be
to delete any struts custom tag that overlaps with JSTL and keep only those
integral to the framework itself.  The StrutsRequestWrapper is already
making OGNL "JSTL friendly" and most of the time consuming riffraff has to
do with the bloody web page!

Look at how Struts Classic custom tags overlapped JSTL and all the confusion
that caused!

Peace,
Scott 



Musachy Barroso wrote:
> 
> We have been trying to remove unused params from the tags, and make
> them consistent (like adding a 'var' attribute to 'url' tag, and
> deprecating 'id'), in this case, the 'id' attribute should be removed.
> All it takes is to add an annotation to the tag class.
> 
> musachy
> 
> On Tue, Jul 29, 2008 at 8:43 AM, stanlick <st...@gmail.com> wrote:
>>
>> I have been away from Struts 2 for many months and was prompted with this
>> question yesterday:
>>
>> Why does this code throw a null pointer exception?
>>
>> <s:url action="employeeAction_subsetByDepartment">
>>    <s:param id="department" value="%{#attr.currRow.department}"/>
>> </s:url>
>>
>> After jacking around with it for nearly an hour I realized that id should
>> be
>> name!  It seems the adjoining tags were using the id attribute and this
>> developer had applied common sense and used id here as well.  Now I
>> realize
>> the JSTL/OGNL debate has caused much consternation among developers and I
>> have sort of gotten over that whole mess.  But this tipped my scale! 
>> What
>> gives with the Struts 2 tag library?  Seriously, step outside yourself
>> and
>> think about it before you answer.  Is this a wart on the framework?
>>
>> Peace,
>> Scott
>> --
>> View this message in context:
>> http://www.nabble.com/Is-this-a-wart-on-the-framework--tp18711301p18711301.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-this-a-wart-on-the-framework--tp18711301p18714543.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Is this a wart on the framework?

Posted by Musachy Barroso <mu...@gmail.com>.
We have been trying to remove unused params from the tags, and make
them consistent (like adding a 'var' attribute to 'url' tag, and
deprecating 'id'), in this case, the 'id' attribute should be removed.
All it takes is to add an annotation to the tag class.

musachy

On Tue, Jul 29, 2008 at 8:43 AM, stanlick <st...@gmail.com> wrote:
>
> I have been away from Struts 2 for many months and was prompted with this
> question yesterday:
>
> Why does this code throw a null pointer exception?
>
> <s:url action="employeeAction_subsetByDepartment">
>    <s:param id="department" value="%{#attr.currRow.department}"/>
> </s:url>
>
> After jacking around with it for nearly an hour I realized that id should be
> name!  It seems the adjoining tags were using the id attribute and this
> developer had applied common sense and used id here as well.  Now I realize
> the JSTL/OGNL debate has caused much consternation among developers and I
> have sort of gotten over that whole mess.  But this tipped my scale!  What
> gives with the Struts 2 tag library?  Seriously, step outside yourself and
> think about it before you answer.  Is this a wart on the framework?
>
> Peace,
> Scott
> --
> View this message in context: http://www.nabble.com/Is-this-a-wart-on-the-framework--tp18711301p18711301.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



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

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