Struts Actions AjaxComponentServiceAction

Pages

  • Home
  • WCS configuration !
  • Websphere Commerce Client's list B2B B2C
  • SQL - WCS

Friday, February 28, 2014

Struts actions AjaxComponentServiceAction !!

This is not your usual forward mapping to a JSP or an action mapping to a command This is an example of calling a component service from an ajax style request and this must be define a struts action in struts-config-ext.xml. Plese find below a snippet. <action parameter="member.updateAddressForPerson" path="/AjaxPersonChangeServiceAddressUpdate" type="com.ibm.commerce.struts.AjaxComponentServiceAction"> <set-property property="authenticate" value="0:0"/> <set-property property="https" value="0:0"/> <set-property property="csrfProtected" value="0:0"/> </action> e.g. Service actions above can be used in refresh areas example below. After completion of the command, the struts action forwards the JSP file that generates a JSON , with response property containing success or failure details. wc.service.declare({ id: "AjaxUpdateAddressForPerson", actionId: "AjaxUpdateAddressForPerson", url: getAbsoluteURL() + "AjaxPersonChangeServiceAddressUpdate", formId: "" /** * hides all the messages and the progress bar * @param (object) serviceResponse The service response object, which is the * JSON object returned by the service invocation */ ,successHandler: function(serviceResponse) { AddressHelper.updateOrderAfterAddressUpdate(); MessageHelper.hideAndClearMessage(); cursor_clear(); } /** * display an error message * @param (object) serviceResponse The service response object, which is the * JSON object returned by the service invocation */ ,failureHandler: function(serviceResponse) { if (serviceResponse.errorMessage) { MessageHelper.displayErrorMessage(serviceResponse.errorMessage); } else { if (serviceResponse.errorMessageKey) { MessageHelper.displayErrorMessage(serviceResponse.errorMessageKey); } } cursor_clear(); } }), Reference: For more information on checkout controls, please review IBM infocenter.

2 comments:

  1. Termochimeneas de leñaNovember 10, 2020 at 12:35 AM

    Me encanta todo lo que cuentas en el post, es muy interesante y me encantaría que explicaras más sobre el tema.

    ReplyDeleteReplies
      Reply
  2. ABOGADOS ACCIDENTE TRAFICO ALBACETENovember 10, 2020 at 1:08 AM

    Muy chulo el artículo, contiene información muy interesante, gracias por tu interés

    ReplyDeleteReplies
      Reply
Add commentLoad more... Newer Post Older Post Home Subscribe to: Post Comments (Atom)

Total Pageviews

Search My Blog

Blog Archive

  • ▼  2014 (28)
    • ▼  February (3)
      • Struts actions AjaxComponentServiceAction !!
      • IP address change | could cause staleConnectionExc...
      • EJB adding a resource reference in toolkit | JDE I...

Developers LifeLine

  • Top App Development Company, San Diego
  • Cross Reference bean tables commands
  • Test Java Code Online
  • Eclipse Platform Tips
  • Regex Tester
  • Funny 404 errors
  • Excel to SQL online tool
  • URL Encoding
  • JSON Validator
  • Online XML Validation
  • Generate HTML escape CHARS

Subscribe To

Posts Atom Posts Comments Atom Comments

Top Comments

Loading...

Tag » Com.ibm.commerce.struts.ajax Action