[ 
https://issues.apache.org/struts/browse/WW-1517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39802
 ] 

Joe Germuska commented on WW-1517:
----------------------------------

Earlier, I asked:
     Are there any extant tags which hold on to an additional Component 
instance besides their "primary one"? 

I'm still getting familiar with the architecture of the component tags, but it 
kind of seems to me that it will be pretty hacky to use two components.  If I 
want to extend AnchorTag but also have a URL component then I kind of need to 
construct the URL object in getBean(stack,req,res).  I can do this, but it 
seems like a "side effect" to requesting the bean.  And if I'm not returning 
the URL object, then I also need to replicate the dependency injection behavior 
for the URL which is done for the "primary" component bean in doStartTag() 
after getBean is called.

I am not saying I think it would be horrible to do this, but it's not that 
elegant either, so especially because i'm new to the tag architecture, I didn't 
want to act without input.

Also, since I can only extend one tag, I would have to duplicate the 
"populateParameters()" behavior from URLTag to initialize my URL component.  
Would it be crazy to have component beans have a populateParameters(Object 
source) method?  I am not sure I love that, but it crossed my mind as one 
possible solution.

> Streamlined link tag for single-parameter links
> -----------------------------------------------
>
>                 Key: WW-1517
>                 URL: https://issues.apache.org/struts/browse/WW-1517
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Views
>    Affects Versions: 2.0.1
>            Reporter: Ted Husted
>         Assigned To: Joe Germuska
>             Fix For: 2.0.x
>
>
> The url and param tags are very flexibile, but the most common case of a 
> single parameter link. 
>         <s:url id="url" action="HelloWorld" includeContext="false">
>             <s:param name="request_locale">en</s:param>
>         </s:url>
>         <s:a href="%{url}">English</s:a>
> is verbose (to the point of being silly).
> It is worthwhile to have a streamlined link tag, a al Struts 1, to cover the 
> single-parameter case.
>         <s:link action="HelloWorld" param="request_locale" 
> paramValue="en">English</s:link>
> In the interest of brevity, I would suggest that includeContext default to 
> "false" for the single-parameter case. 
> Or, with a message resource key, from
> <a href="<s:url action="Login_input"/>">%{getText('"sign_on"')}</a>
> to 
>  <s:link action="login_input" key="sign_on" />

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to