I have a variable in the I need to access, depending on some conditions it is bad to variable with the action class and Modelladrian Bean Now I need to use the Action class variable. I tried to reach the variable with the action class in the follwing manner: But this blank value is returning. I also have the code below: Please tell what is going wrong. struts.xml Tiles xml . When both your model (at the top of the stack) and your action (usually the items under the model ), You can disambiguate using the
Public Class PaymentGateWayAction ActionSupport Implementation Model Driven & lt; PaymentResponseDTO & gt; {Finds Private String; Private Payment Response DTO Payment Reports DTO = New Payment Response DTO (); // ...}
search is also a variable in
PaymentResponseDTO .
search with the same name but one of the above has already been developed. If I make any amendments to the Java file, then I need many modifications which are difficult.
this.setSearchKey ("somevarible");
& lt; Action Name = "Atom Response" Category = "Com Payment Gate Y Action" method = "Atom Payment Response" & gt; & Lt; Result name = "success" type = "tiles" & gt; Payment Gateways & lt; / Results & gt; & Lt; Name of the result = "failure" type = "tiles" & gt; Payment gateway suspension error & lt; / Results & gt; & Lt; / Action & gt;
& lt; Definition name = "payment gatewaypage" expanded = "b2cHome" & gt; & Lt; Put-attribute name = "body" value = "agent_b2c / b2c_paymentGateWayResponse.jsp" /> & Lt; / Definition & gt;
b2c_paymentGatewayResponse.jsp is hidden area code in
#action from the value stack reference variable, or directly access to the stack (bad idea).
& lt ;! - Direct Action Action Property: - & gt; & Lt; S: property value = "% {searchKey}" /> & Lt ;! - Model; Top of the heap - & gt; & Lt; S: property value = "% {# action.searchKey}" /> & Lt ;! - Action; Straight away - & gt; & Lt ;! - Hopefully the stack never changes: - & gt; & Lt; S: Attribute value = "% {[0] .searchKey}" /> & Lt ;! - Model; Top of the heap - & gt; & Lt; S: Property value = "% {[1] .searchKey}" /> & Lt ;! - Action; Next Stack Status - & gt;
Comments
Post a Comment