我需要在JSTL / OGNL中准备正文。像这样:
First Name: <customer.fn>
Last Name: <customer.ln>
...
并在mailto链接中使用它。客户来自ActionContext
。
我尝试了以下方法:
<s:set var="bodyText" value="First Name: ${customer.fn}\n Last Name: ${customer.ln}....">
我尝试像这样打印它,以查看它是否有效。
<s:property value="#bodyText" />
但这似乎不起作用。
一旦获得该值,就需要在Mailto链接中使用它,例如:
"mailto:[email protected]?body=<s:property value="#bodyText">"
您不能在struts标签属性中使用JSP EL,但是可以在标签正文中使用它
<s:set var="bodyText">First Name: ${customer.fn}<br/> Last Name: ${customer.ln}</s:set>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句