Functions to be completed
- Use Ajax requests to send requests to the backend
- Converts webpage data into request processing streams
- Convert XSL and mule transformers to a format that is understandable by Google APIs
- Create a Google API spelling check to process webpage Input
- Return XML data to the page
- Implement a jetty server in the process
Create a project
Create an ajaxflow project and add the following components to ajaxflow. mflow:
Figure: Ajax request process
Add and configure Ajax Interfaces
In ajaxflow. mflow, selectGlobal Elements:
Figure: Selecting global elements
ClickCreate, AppearsChoose Global TypeWindow.
OpenConnectorsAnd then selectAjax
Figure: Select Ajax in the interface
InServer URLAndResource baseInput:
Http: // 127.0.0.1: 8090/ajax
And src/main/APP/docroot
Figure: Ajax settings
Click OK to view the Ajax interface in the list.
Figure: Ajax Interface
Double-click the Ajax element in flow, configure the Ajax endpoint, and set the channel:
Figure: Channel settings
Then set reference:
Select the global Ajax interface we set above.
Configure XSLT Conversion
Download the XSL file:
Transform. XSL File
Save to yourMulestudio>Examples>Ajaxspellchecker>TransformfileDirectory
Right-click the project and selectImport, SelectFile SystemImport the saved transform. XSL file toSRC \ main \ appDirectory.
After completing the preceding steps, double-click XSLT transformer to seePattern PropertiesWindow, configure the following parameters:
Figure: conversion property Configuration
Configure HTTP requests
Double-clickHTTP endpointAppearsEndpoint PropertiesWindow.
The settings are as follows: