[LookupDispatchAction] missing resource in key method map
je suis sur ma page recherche qui affiche les résultats d'une recherche à partir de cette page je souhaite editer une page client via une fonction edit qui pour l'instant m'envoit sur le détail d'un client définit par défaut, pour le besoin du test
voici le code de ma classe action
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| public class ClientAction extends LookupDispatchAction {
public ClientBean client;
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("button.edit", "edit");
return map;
}
...
public ActionForward edit(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws java.lang.Exception, HibernateException{
client = HibernateSQL.Select();
request.getSession().setAttribute(mapping.getAttribute(),client);
return mapping.findForward("client");
} |
le fichier de config
Code:
1 2 3 4 5 6 7 8
| <action
input="/client.jsp"
name="ClientForm"
path="/client"
parameter="action"
scope="session"
type="com.myapp.exploreoffre.struts.actions.ClientAction"/>
</action-mappings> |
le code de la jsp
Code:
1 2 3 4 5 6 7
| <div class="link">
<html:link action="client?action=edit">
<bean:write name="item" property="nom"/>
<bean:write name="item" property="prenom"/>
<bean:write name="item" property="telephone"/><br>
</html:link>
</div> |
et le code erreur : Action[/client] missing resource 'edit' in key method map
et pourtant la fonction edit fonctionne très à partir de la page client!