struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jake Vang <>
Subject struts 2, writing a custom tag that is able to access objects in ActionContext using OGNL
Date Mon, 01 Feb 2010 12:34:29 GMT
i was wondering if it was possible to write a custom tag that is able
to access objects in the ActionContext using OGNL? i'm not sure if
this is a "correct" question.

my problem is that i have a form. the form is posted to an action. the
action has getters/setters for the form fields. i then forward to
form-success.jsp. on this page, i can use the struts taglibs to access
the information posted. for example, <s:property value="email"/>.
however, if i have a custom tag, how do i access "email" from the
ActionContext? for example, <customTabLib:showEmail value="email"/>,
doesn't work. the tag displays the value, "email". i also tried a
couple of things too that didn't work.

<customTagLib:showEmail value="#email"/>
<customTagLib:showEmail value="%{#email}"/>

is there a class/interface that i can extend/implement in struts 2
that would easily help me get the value of email from the
ActionContext in my custom tag?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message