[seam-dev] Suppressing parameter inclusion for s:link

Dan Allen dan.j.allen at gmail.com
Fri Oct 24 13:06:19 EDT 2008


On Thu, Oct 23, 2008 at 11:12 AM, Shane Bryzak <shane.bryzak at jboss.com> wrote:
>  To summarise the problem, when a user has a page with a menu containing a
> lot of links (each using s:link), each of the page parameters defined in
> pages.xml for the views referenced in the links cause instantiation of
> whatever Seam component is configured in the parameter value. The main
> problem with this is the performance hit from having to create so many
> components just to render the links.

I completely agree that this is a problem...one that is significantly
prominent in seam-gen projects because we put all those s:link tags in
the menu bar. The s:link tag has other uses besides page parameters,
yet currently there is no way to have one without the other. We need
to give the user a way to severe the coupling.

> We identified two possible solutions - either introduce an attributes in
> pages.xml which when set to true suppresses the parameter values from being
> rendered, or introduce an additional attribute in s:link and s:button which
> does a similar thing for that link only.

Putting a flag in the page descriptor makes no sense. The whole idea
of the page parameter is that you don't have to worry about
propagating the value. How does the page descriptor know when you need
it and when you don't? This is a view/navigation concern.

I have long said that we need a switch on the Seam command components
(s:link and s:button) that turn off the appending of page parameters
to the URL. When choosing an attribute name, let's try to keep the
amount of typing to a minimum. Since it is likely to be used often, I
would rather not have to type out a sentence. Here are some
suggestions:

<s:link ... pageParams="false"/> or <s:link ... pageParams="ignore"/>
<s:link ... pageParameters="false"/> or <s:link ... pageParameters="ignore"/>
<s:link ... encodePageParams="false"/>

I don't like the idea of a negated switch (e.g., suppressPageParams).
Then, in a conditional, you end up with suppressPageParams="false",
which is a double negative.

A value of "override" seems odd to me since overriding should always
be possible. I guess if this is the default value, then you would only
ever see it written out in a EL conditional. But it is misleading. I
would prefer the switch to be true/false or true/ignore.

In general, I see this as an issue of significance. For one, page
parameters are causing components to be created when the developer may
not want them to, so it's a performance thing. Second, it's makes
developers annoyed with the Seam command components because they make
it difficult to shake off a particular parameter when it isn't wanted.
If we do add this attribute to the Seam command components, we need to
also add it to the redirect directive in the page descriptor.

-Dan

-- 
Dan Allen
Software consultant | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.



More information about the seam-dev mailing list