In the Create Application window specify an
Application Name, YahooAjax for example, and click on OK. In the
Create Project window specify a Project Name, YahooAjax for
example, and click on OK. Create a JSP file, input.jsp, in the project.
Select File>New and in the New Gallery window select Web Tier>JSP
in Categories and JSP in Items and click on OK. In the Create JSP
window specify a file name and click on OK. A JSP gets added to the
Application Navigator as shown in Fig. 10.10.
Fig. 10.10 Yahoo Ajax Web Search Application
The example JDeveloper application web application URL is
http://127.0.0.1:8988/YahooAjax-YahooAjax-contextroot/,
which is to be specified in the Web Application URL field when
registering with the Yahoo Search Web Services. To obtain the web
application URL right-click on input.jsp and select Run.
In the web application we shall use the Contextual Web Search
service to submit a context-base web search query. The request URL for
206 10 Web Search with Ajax
the contextual web search Web Service is
http://search.yahooapis.com/WebSearchService/V1/contextSearch. The
required request parameters to a contextual web search query are appid
and context. The value of the appid parameter is the application Id
provided by Yahoo Search Web Services and the context parameter
specifies the context string in which the web search query is sent. Some of
the commonly used request parameters are discussed in Table 10.
Pages:
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184