Alireza Fattahi
Alireza Fattahi

Reputation: 45583

Setting dispatcher:FORWARD makes struts.actionMapping to noActionMapping in Struts 2

To get the struts.actionMapping in JSP or tags we use struts.actionMapping of request as an example this:

 <s:property value="#request['struts.actionMapping']"/>

Shows some thing like:

ActionMapping{name='own-to-other-form', namespace='/transaction/fundtransfer',
              method='form', extension='ib', params={}, result=null}

Actually we use

<s:property value="#request['struts.actionMapping'].name"/>

to get action name.

When I change the StrutsPrepareAndExecuteFilter to use

<dispatcher>REQUEST</dispatcher> 
<dispatcher>FORWARD</dispatcher>

The above tag shows noActionMapping.

Is there any way I can fix it?

Upvotes: 0

Views: 71

Answers (1)

Roman C
Roman C

Reputation: 1

The value for struts.actionMapping can be found in the context.

You can print the value in JSP using

<s:property value="#context['struts.actionMapping']"/>

Upvotes: 1

Related Questions