Spring Mvc vue avec plusieur boutons comment organiser le bean xml
Bonjour a tous,
J'utilise Spring 2.5 et spring security 2.0.4
Je parviens bien a utilisé un formulaire pour encoder des données en database.
Mais a présent je souhaite afficher les données dans un tableau avec deux bouton un delete et update.
Question : je me demande comment organiser cela au niveau de la déclaration du bean dans le fichier de configuration Xml de spring.
Deux commandName Si vous pouvez m'aider ou me donner une piste je suis interessé
Donc ma question est comment je peux mettre deux action différente pour 1 bouton
mettre deux commandName pour le bean ... ?
Code:
1 2 3 4 5 6 7 8 9 10
|
<bean id="persdao" class="com.a8sys.web.usermanager.userFormController">
<property name="personnejdbcdaosupport"><ref bean="formDAO"/></property>
<property name="sessionForm"><value>false</value></property>
<property name="commandName"><value>Personne</value></property>
<property name="commandClass"><value>com.a8sys.domaine.Personne</value></property>
<property name="validator"><ref bean="persValidator"/></property>
<property name="formView"><value>admin/addUser</value></property>
<property name="successView"><value>admin/listusers</value></property>
</bean> |
pour ma Jsp j'ai ceci
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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IList of user here</title>
<style type="text/css">
@import "../css/a8.css";
@import "../css/css.css";
</style>
</head>
<body>
<div id="header">
<center>
<br>Header Page - V1 -25-03-2011 ${welcomeMessage}</br>
</br></br>
</center>
</div>
</br></br></br>
<center>
<table border="1">
</tr>
<th>id</th>
<th>nom</th>
<th>prenom</th>
<th>email</th>
<th>country</th>
<th>login</th>
<th>enable</th>
<th>password</th>
<th>Delete</th>
<th>Update</th>
</tr>
<c:forEach var="bean" items="${listpers}">
<tr>
<td><c:out value="${bean.id}"/></td>
<td><c:out value="${bean.nom}"/></td>
<td><c:out value="${bean.prenom}"/></td>
<td><c:out value="${bean.email}"/></td>
<td><c:out value="${bean.country}"/></td>
<td><c:out value="${bean.login}"/></td>
<td><c:out value="${bean.enabled}"/></td>
<td><c:out value="${bean.password}"/></td>
<td>
<form:form method="POST" commandName="deletePersonneid">
<form:input type="hidden" path="id" value="${bean.id}" />
<input type="submit" value="Delete"/>
</form:form>
</td>
<td><form:form method="POST" commandName="UpdatePersonneid">
<form:input type="hidden" path="id" value="${bean.id}" />
<form:input type="hidden" path="nom" value="${bean.nom}" />
<form:input type="hidden" path="Prenom" value="${bean.prenom}" />
<form:input type="hidden" path="email" value="${bean.email}" />
<form:input type="hidden" path="Country" value="${bean.country}" />
<form:input type="hidden" path="login" value="${bean.login}" />
<form:input type="hidden" path="enabled" value="${bean.enabled}" />
<form:input type="hidden" path="Password" value="${bean.password}" />
<input type="submit" value="Update"/>
</form:form></td>
<td><c:out value="${bean.password}"/></td>
</tr>
</c:forEach>
</table>
<a href="/index.htm">Root Page</a>
</center>
<div id="footer">
<center>
<br>footer Page - V1 -25-03-2011 </br>
</center>
</div>
</body>
</html> |
Je vous remercie d'avance pour avoir lu ma question.
je vous souhaite une bon weekend de Pâques d'avance.