In Struts1, How to access ActionMapping parameter in JSP

主宰稳场 提交于 2019-12-13 04:47:45

问题


Proceeding from the question

In Struts1, how to use set-property tag inside action tag?

When set-property tag is used, its value is mapped to property in extended ActionMapping class. Is there any way to access this property in JSP ?


回答1:


You can make use of the bean:struts tag:

<bean:struts id="myActionMapping" mapping="/myAction" />

Once defined, you can access the properties straight on the myActionMapping JSP bean:

<bean:write name="myActionMapping" property="task" />

Or, using EL:

${myActionMapping.task}

Reference: struts-bean.tld



来源:https://stackoverflow.com/questions/13265710/in-struts1-how-to-access-actionmapping-parameter-in-jsp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!