Recherche la definition d'un mot a partir de google
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| package com.search.FirstWeb.controller;
import javax.servlet.http.HttpServletRequest ;
import javax.servlet.http.HttpServletResponse;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
public class AjoutController extends SimpleFormController {
protected Object formBackingObject(HttpServletRequest request) {
return new CommandAjout();
}
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
String mot, BindException errors) throws Exception {
//j'ai besoin le code ecrit ici pour trouve la definition de "Mot" el le sauvgarder ou l'afficher dans un formulaire
}
} |
et voici le code de la Jsp qui fait le rechreche
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html><head><title>Meta search</title> </head >
<body><h3>Meta Search </h3>
<form:form commandName ="commandAjout">
<table>
<tr>
<td> <p>Type of Search<br></p></td>
<td> <INPUT TYPE="RADIO" NAME="integer" VALUE="1">Web
<INPUT TYPE="RADIO" NAME="integer" VALUE="2">Image
<INPUT TYPE="RADIO" NAME="integer" VALUE="3">News
<INPUT TYPE="RADIO" NAME="integer" VALUE="4">Job </td>
</tr>
<tr>
<td><form:input path ="Mot" /></td>
<%-- Show errors for name field --%>
</tr>
<tr>
<td colspan="3"><input type="submit" value="Search" /></td>
</tr>
</table>
</form:form>
</body ></html> |
:cry: