When I do return order generation, because it is convenient to control the Java class method to invoke service service can give prompt message, so we have created a new Java class, and then go to request request again, the following is the Java class code
1 Public StaticString Confirmreturnorder (httpservletrequest request,2 httpservletresponse Response) {3String responsestring = "Error";4 Try {5responsestring = eventfactory.runrequestevent (Request, Response, "Makequickreturn");6}Catch(eventhandlerexception e) {7Debug.logerror (E, "Error creating return Order", module);8 }9 return"Success";Ten}
View Code
It then calls the Makequickreturn request, which calls the service directly.
1 <request-map uri= "Makequickreturn" >2 <security https= "true" auth= "true"/>3 <event type= "Service-multi" invoke= "Createreturnanditemoradjustment"/>4 < Response name= "Success" type= "Request-redirect-noparam" value= "Findreturnorder" ></response>5 <response name= "error" type= "View-last"/>6 </request-map>
View Code
Control requests the wording inside,
1<request-map uri= "Confirmreturnorder" >2<security https= "false" auth= "true"/>3<event type= "java" invoke= "Confirmreturnorder" path= "com.brains.order.ReturnOrderEvents" ></event>4<response name= "Success" type= "Request-redirect-noparam" value= "Findreturnorder" ></response>5<response name= "error" type= "View-last"/>6</request-map>7<request-map uri= "Makequickreturn" >8<security https= "true" auth= "true"/>9<event type= "Service-multi" invoke= "Createreturnanditemoradjustment"/>Ten<response name= "Success" type= "Request-redirect-noparam" value= "Findreturnorder" ></response> One<response name= "error" type= "View-last"/> A</request-map>
View Code
The first analysis, is in the Confirmreturnorder control inside the call Makequickreturn this request, so the final return of the view is sure to go confirmreturnorder return the request.
But even if I response inside the two request, the redirect will be returned in the redirected list, with the returned parameters (invoking the service-generated Returnid).
Finally, under the guidance of the project manager, it is known that the response returned with the Java class will encapsulate the parameters returned by the called Service service in attributes, so inside the page, the parameters Change to Requestparameters (because the parameters contains attributes and parameters two parameters)
OFBiz attack on personal experience of the wonderful problem summary.