I have searchKey as a variable in an action class and a model-driven bean.
public class PaymentGateWayAction extends ActionSupport implements ModelDriven<PaymentResponseDTO> { private String searchKey; private PaymentResponseDTO paymentResponseDTO = new PaymentResponseDTO();
searchKey also a variable in PaymentResponseDTO .
I need to access searchKey from class action and modeldriven bean based on some conditions. Misuse of the same name. But the above has already been developed. If I make any changes to the Java file, I need to make many changes that are complex.
Now I need to access the action class variable. I tried to access the variable from the action class as follows:
<s:hidden id="searchKey" name="searchKey" value="%{searchKey}"/>
But it returns null values.
I have the code below:
this.setSearchKey("somevarible");
Please indicate where the wrong thing is happening.
struts.xml
<action name="atomResponse" class="com.PaymentGateWayAction" method="atomPaymentResponse"> <result name="success" type="tiles">paymentGateWayResponse</result> <result name="failure" type="tiles">paymentGateWayResponseError</result> </action>
xml tiles
<definition name="paymentGateWayResponse" extends="b2cHome"> <put-attribute name="body" value="agent_b2c/b2c_paymentGateWayResponse.jsp" /> </definition>
In b2c_paymentGatewayResponse.jsp there is a hidden field code.
source share