You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jan Froehlich <Ja...@infomotion.de> on 2008/06/26 15:58:17 UTC
Something like getCurrentAction(...)
Hi all,
As I am not sure if I can explain the whole context of my problem just a
short description of what I got and what I want:
I got an Action extending ActionSupport where I added a
getCurrentAction() method.
public String getCurrentAction() {
String sRequestURL =
getRequest().getRequestURL().toString();
return
sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
sRequestURL.length() - 1);
}
The problem (with tiles I guess) is that I always get the url from my
tiles master template and not from the action that was called.
After I debugged the request object I found an array called
"specialAttributes" where I found the action name.
Is it possible to access those specialAttributes, or is there any other
way?
Regards
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
AW: Something like getCurrentAction(...)
Posted by Jan Froehlich <Ja...@infomotion.de>.
I'm sorry - found it......
Just ignore my last message!
That will return an object of this type:
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts
2/dispatcher/mapper/ActionMapping.html
musachy
On Thu, Jun 26, 2008 at 11:21 AM, Jan Froehlich
<Ja...@infomotion.de> wrote:
> Can you give me a quick hint, how I can access what I need? Not sure
> what I should search for....
>
> Try this:
>
>
http://struts.apache.org/2.x/docs/how-do-we-access-the-action-invocation
> -action-name-or-namespace-from-a-view.html
>
> On Thu, Jun 26, 2008 at 10:15 AM, Jan Froehlich
> <Ja...@infomotion.de> wrote:
>> Something I forgot to tell....
>>
>> I already tried the way using the <s:property value="#action" /> but
> as
>> I use a default action for most of my calls its not a possibility...
>>
>>
>>
>> Hi all,
>>
>> As I am not sure if I can explain the whole context of my problem
just
> a
>> short description of what I got and what I want:
>> I got an Action extending ActionSupport where I added a
>> getCurrentAction() method.
>>
>> public String getCurrentAction() {
>> String sRequestURL =
>> getRequest().getRequestURL().toString();
>> return
>> sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
>> sRequestURL.length() - 1);
>> }
>>
>> The problem (with tiles I guess) is that I always get the url from my
>> tiles master template and not from the action that was called.
>> After I debugged the request object I found an array called
>> "specialAttributes" where I found the action name.
>>
>> Is it possible to access those specialAttributes, or is there any
> other
>> way?
>>
>> Regards
>> Jan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
AW: Something like getCurrentAction(...)
Posted by Jan Froehlich <Ja...@infomotion.de>.
Well, ok - found that already - but I got no Idea what method returns my
desired action.
That will return an object of this type:
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts
2/dispatcher/mapper/ActionMapping.html
musachy
On Thu, Jun 26, 2008 at 11:21 AM, Jan Froehlich
<Ja...@infomotion.de> wrote:
> Can you give me a quick hint, how I can access what I need? Not sure
> what I should search for....
>
> Try this:
>
>
http://struts.apache.org/2.x/docs/how-do-we-access-the-action-invocation
> -action-name-or-namespace-from-a-view.html
>
> On Thu, Jun 26, 2008 at 10:15 AM, Jan Froehlich
> <Ja...@infomotion.de> wrote:
>> Something I forgot to tell....
>>
>> I already tried the way using the <s:property value="#action" /> but
> as
>> I use a default action for most of my calls its not a possibility...
>>
>>
>>
>> Hi all,
>>
>> As I am not sure if I can explain the whole context of my problem
just
> a
>> short description of what I got and what I want:
>> I got an Action extending ActionSupport where I added a
>> getCurrentAction() method.
>>
>> public String getCurrentAction() {
>> String sRequestURL =
>> getRequest().getRequestURL().toString();
>> return
>> sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
>> sRequestURL.length() - 1);
>> }
>>
>> The problem (with tiles I guess) is that I always get the url from my
>> tiles master template and not from the action that was called.
>> After I debugged the request object I found an array called
>> "specialAttributes" where I found the action name.
>>
>> Is it possible to access those specialAttributes, or is there any
> other
>> way?
>>
>> Regards
>> Jan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Something like getCurrentAction(...)
Posted by Musachy Barroso <mu...@gmail.com>.
That will return an object of this type:
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/dispatcher/mapper/ActionMapping.html
musachy
On Thu, Jun 26, 2008 at 11:21 AM, Jan Froehlich
<Ja...@infomotion.de> wrote:
> Can you give me a quick hint, how I can access what I need? Not sure
> what I should search for....
>
> Try this:
>
> http://struts.apache.org/2.x/docs/how-do-we-access-the-action-invocation
> -action-name-or-namespace-from-a-view.html
>
> On Thu, Jun 26, 2008 at 10:15 AM, Jan Froehlich
> <Ja...@infomotion.de> wrote:
>> Something I forgot to tell....
>>
>> I already tried the way using the <s:property value="#action" /> but
> as
>> I use a default action for most of my calls its not a possibility...
>>
>>
>>
>> Hi all,
>>
>> As I am not sure if I can explain the whole context of my problem just
> a
>> short description of what I got and what I want:
>> I got an Action extending ActionSupport where I added a
>> getCurrentAction() method.
>>
>> public String getCurrentAction() {
>> String sRequestURL =
>> getRequest().getRequestURL().toString();
>> return
>> sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
>> sRequestURL.length() - 1);
>> }
>>
>> The problem (with tiles I guess) is that I always get the url from my
>> tiles master template and not from the action that was called.
>> After I debugged the request object I found an array called
>> "specialAttributes" where I found the action name.
>>
>> Is it possible to access those specialAttributes, or is there any
> other
>> way?
>>
>> Regards
>> Jan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
> ---------------------------------------------------------------------
> 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
AW: Something like getCurrentAction(...)
Posted by Jan Froehlich <Ja...@infomotion.de>.
Can you give me a quick hint, how I can access what I need? Not sure
what I should search for....
Try this:
http://struts.apache.org/2.x/docs/how-do-we-access-the-action-invocation
-action-name-or-namespace-from-a-view.html
On Thu, Jun 26, 2008 at 10:15 AM, Jan Froehlich
<Ja...@infomotion.de> wrote:
> Something I forgot to tell....
>
> I already tried the way using the <s:property value="#action" /> but
as
> I use a default action for most of my calls its not a possibility...
>
>
>
> Hi all,
>
> As I am not sure if I can explain the whole context of my problem just
a
> short description of what I got and what I want:
> I got an Action extending ActionSupport where I added a
> getCurrentAction() method.
>
> public String getCurrentAction() {
> String sRequestURL =
> getRequest().getRequestURL().toString();
> return
> sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
> sRequestURL.length() - 1);
> }
>
> The problem (with tiles I guess) is that I always get the url from my
> tiles master template and not from the action that was called.
> After I debugged the request object I found an array called
> "specialAttributes" where I found the action name.
>
> Is it possible to access those specialAttributes, or is there any
other
> way?
>
> Regards
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Something like getCurrentAction(...)
Posted by Musachy Barroso <mu...@gmail.com>.
Try this:
http://struts.apache.org/2.x/docs/how-do-we-access-the-action-invocation-action-name-or-namespace-from-a-view.html
On Thu, Jun 26, 2008 at 10:15 AM, Jan Froehlich
<Ja...@infomotion.de> wrote:
> Something I forgot to tell....
>
> I already tried the way using the <s:property value="#action" /> but as
> I use a default action for most of my calls its not a possibility...
>
>
>
> Hi all,
>
> As I am not sure if I can explain the whole context of my problem just a
> short description of what I got and what I want:
> I got an Action extending ActionSupport where I added a
> getCurrentAction() method.
>
> public String getCurrentAction() {
> String sRequestURL =
> getRequest().getRequestURL().toString();
> return
> sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
> sRequestURL.length() - 1);
> }
>
> The problem (with tiles I guess) is that I always get the url from my
> tiles master template and not from the action that was called.
> After I debugged the request object I found an array called
> "specialAttributes" where I found the action name.
>
> Is it possible to access those specialAttributes, or is there any other
> way?
>
> Regards
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> 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
AW: Something like getCurrentAction(...)
Posted by Jan Froehlich <Ja...@infomotion.de>.
Something I forgot to tell....
I already tried the way using the <s:property value="#action" /> but as
I use a default action for most of my calls its not a possibility...
Hi all,
As I am not sure if I can explain the whole context of my problem just a
short description of what I got and what I want:
I got an Action extending ActionSupport where I added a
getCurrentAction() method.
public String getCurrentAction() {
String sRequestURL =
getRequest().getRequestURL().toString();
return
sRequestURL.substring(sRequestURL.lastIndexOf('/') + 1,
sRequestURL.length() - 1);
}
The problem (with tiles I guess) is that I always get the url from my
tiles master template and not from the action that was called.
After I debugged the request object I found an array called
"specialAttributes" where I found the action name.
Is it possible to access those specialAttributes, or is there any other
way?
Regards
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org