What is the functionality of struts 2 anchor tag?

View: New views
4 Messages — Rating Filter:   Alert me  

What is the functionality of struts 2 anchor tag?

by akshi gupta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

If we use anchor tag like this :

(ListSuccess.jsp) :        
   ========>     <%@ taglib prefix="s" uri="/struts-tags"%>
.............................
.............................
   ========>     <s:url id="edit" action="edit" method="input"
namespace="/" />
   ========>      <s:a href="%{edit}" >Edit</s:a>


Now , how href value get parse and get the complete url ?
 Exactly through which method of the AnchorTag.java?

Can anyone please help me out ?


Thanks,

Akshi


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


Re: What is the functionality of struts 2 anchor tag?

by Musachy Barroso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am not really sure why you want to know but here is the short explanation:

 <s:url id="edit" action="edit" method="input" namespace="/">

This will construct a url like: "/edit.action", and push it into the
stack, associated with the key "edit" (from the "id" attribute). Later
on

<s:a href="%{edit}" >Edit</s:a>

"%{edit}" will be evaluated against the stack and "/edit.action" will
be found, so that is the value that the anchor tag will use on its
href.

musachy


On Fri, May 9, 2008 at 8:59 AM, akshi gupta <akshi@...> wrote:

> Hello,
>
> If we use anchor tag like this :
>
> (ListSuccess.jsp) :          ========>     <%@ taglib prefix="s"
> uri="/struts-tags"%>
> .............................
> .............................
>  ========>     <s:url id="edit" action="edit" method="input" namespace="/"
> />
>  ========>      <s:a href="%{edit}" >Edit</s:a>
>
>
> Now , how href value get parse and get the complete url ?
> Exactly through which method of the AnchorTag.java?
>
> Can anyone please help me out ?
>
>
> Thanks,
>
> Akshi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>



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

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


Re: What is the functionality of struts 2 anchor tag?

by akshi gupta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Actually I am writing my own custom tag by extending AnchorTag class
because I want "href" value for some business rules thats why I wanthref
evaluated value.

Now can you tell me from which method href evaluated value is coming?

Thanks,
Akshi


Musachy Barroso wrote:

> I am not really sure why you want to know but here is the short explanation:
>
>  <s:url id="edit" action="edit" method="input" namespace="/">
>
> This will construct a url like: "/edit.action", and push it into the
> stack, associated with the key "edit" (from the "id" attribute). Later
> on
>
> <s:a href="%{edit}" >Edit</s:a>
>
> "%{edit}" will be evaluated against the stack and "/edit.action" will
> be found, so that is the value that the anchor tag will use on its
> href.
>
> musachy
>
>
> On Fri, May 9, 2008 at 8:59 AM, akshi gupta <akshi@...> wrote:
>  
>> Hello,
>>
>> If we use anchor tag like this :
>>
>> (ListSuccess.jsp) :          ========>     <%@ taglib prefix="s"
>> uri="/struts-tags"%>
>> .............................
>> .............................
>>  ========>     <s:url id="edit" action="edit" method="input" namespace="/"
>> />
>>  ========>      <s:a href="%{edit}" >Edit</s:a>
>>
>>
>> Now , how href value get parse and get the complete url ?
>> Exactly through which method of the AnchorTag.java?
>>
>> Can anyone please help me out ?
>>
>>
>> Thanks,
>>
>> Akshi
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@...
>> For additional commands, e-mail: user-help@...
>>
>>
>>    
>
>
>
>  


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


Re: What is the functionality of struts 2 anchor tag?

by Musachy Barroso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In org.apache.struts2.components.Achor

public void evaluateExtraParams() {
        super.evaluateExtraParams();

        if (href != null)
            addParameter("href",
ensureAttributeSafelyNotEscaped(findString(href)));
}


On Fri, May 9, 2008 at 9:59 AM, akshi gupta <akshi@...> wrote:

> Actually I am writing my own custom tag by extending AnchorTag class because
> I want "href" value for some business rules thats why I wanthref evaluated
> value.
>
> Now can you tell me from which method href evaluated value is coming?
>
> Thanks,
> Akshi
>
>
> Musachy Barroso wrote:
>>
>> I am not really sure why you want to know but here is the short
>> explanation:
>>
>>  <s:url id="edit" action="edit" method="input" namespace="/">
>>
>> This will construct a url like: "/edit.action", and push it into the
>> stack, associated with the key "edit" (from the "id" attribute). Later
>> on
>>
>> <s:a href="%{edit}" >Edit</s:a>
>>
>> "%{edit}" will be evaluated against the stack and "/edit.action" will
>> be found, so that is the value that the anchor tag will use on its
>> href.
>>
>> musachy
>>
>>
>> On Fri, May 9, 2008 at 8:59 AM, akshi gupta <akshi@...> wrote:
>>
>>>
>>> Hello,
>>>
>>> If we use anchor tag like this :
>>>
>>> (ListSuccess.jsp) :          ========>     <%@ taglib prefix="s"
>>> uri="/struts-tags"%>
>>> .............................
>>> .............................
>>>  ========>     <s:url id="edit" action="edit" method="input"
>>> namespace="/"
>>> />
>>>  ========>      <s:a href="%{edit}" >Edit</s:a>
>>>
>>>
>>> Now , how href value get parse and get the complete url ?
>>> Exactly through which method of the AnchorTag.java?
>>>
>>> Can anyone please help me out ?
>>>
>>>
>>> Thanks,
>>>
>>> Akshi
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@...
>>> For additional commands, e-mail: user-help@...
>>>
>>>
>>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>



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

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