top of page

The best way to pass parameters inside the action of struts2 configuration file xml.txt

In Action, we typically jump from this Action to an additional Action, if it is just a very simple jump, then it is actually very

Effortless, just add a lead to the struts configuration file, like: resultname='index'/manager

/managerInfo/account.jsp/result.result

There's a variety attribute, the sort right here is the dispatcher by default, but within this case, the request can not be sent between actions, then we are going to use it

redirect, redirect-action, chain, any time you wish to request an action, it is possible to set the worth of sort to certainly one of the above three, which include: resultname='reload'

type='redirectAction'/manager/managerInfo/account.action/result.

If you would like to add parameters during the request, you'll be able to use 'xx?xx=xx' in the end like a hyperlink.

Parameters inside the form of. For how to recover unreadable flash drive : resultname='reload'

type='redirectAction'/manager/

managerInfo/account.action?parameter name=parameter value/result, if the parameter worth here is not a fixed worth, you could use '$ref

In the form of 'value', it should be noted that the 'parameter value' ought to present a get/set process in the corresponding Action, otherwise the parameter worth won't be obtained, obviously, a single also can take one here

An attribute worth on the object is: $object name. attribute name, if I choose to get an account account quantity: result

name='reload'type='redirectAction'

/manager/managerInfo/account.action?account.accountNO=$account.accountNO/result.

If you want to pass many parameters to connect with '' symbol? NO, for the reason that

Use '' will report an error within the XML grammar verify, so replace '' with '' around the line! Which include: unreadable usb ='reload'type='redirectAction'

/manager/managerInfo/account.action?account.accountNO=$account.accountNOaccount.balance=$account.balance/result.

Note: When using type='redirectAction', the .action (the spot marked in red above) in the outcome is optional, but after you choose to pass the parameter, along with the parameter includes Chinese characters, you need to not add .action, otherwise Your parameter value can not be passed. This was found by myself later.Should you be interested, you'll be able to try it...

Recent Posts

See All

Comments


bottom of page