Extend the base Struts Action Class. Add a getter/setter method for the
property named as an XML subelelement of the action mapping in the
struts-config.xml.

E.g.
struts-config.xml
<action     path="/xyz"
             type="test.Xyz"
             className="MyActionMapping">
             <set-property property="myproperty" value="test value"/>
</action>



iIn your: MyActionMapping which extends ActionMapping

private  String myproperty = null;

public void setMyproperty(String value) {
        this.myproperty = value;
}

public String getMyproperty() {
        return this.myproperty;
}


Have fun



[EMAIL PROTECTED]
08.03.2004 17:07

Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>


To
[EMAIL PROTECTED]
cc

Subject
[RMX:##] Own Action-Subclass: How to configure using "set-property"-elemen
ts?






Hey everbody!

I derived my own Action-subclass for doing multiple stuff in my webapp on
every request. Part of the "multiple-stuff" is a method that checks if the
session got lost, but only if needed at that certain point in the
application (like when a formbean is used over multiple request for
creating
an order or stuff).
Now, my current pratice is to call that method manually in every custom
action I write, which is somehow unsatisfying. I'd rather like to be able
to
configure this session-safety directly through the struts-config.xml. I
saw
that there are <set-property> elements, which seem like they could give me
such an ability based on every action-mapping. That'd be nice.
But HOW can I access those properties in my action?! I can't seem to find
any methods for that.

Thx for any help!!
_______________________________________
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED]


ForwardSourceID:NT0001A5CA


_________________________________________________________________
Please be advised that the information contained herein is confidential and intended 
only for use by the individual stated above. If you are not the named recipient, you 
are hereby notified that any disclosure, distribution, dissemination, or copying is 
prohibited. If this information has been directed to you in error, please contact the 
sender immediately at the telephone number listed above.

Reply via email to