Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2416 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  Struts balise select

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Struts balise select

n°705730
bird80
Posté le 22-04-2004 à 10:42:01  profilanswer
 

J'ai un tableau d'objet clients en session
 
je voudrais faire une jsp :
avec un select (<html:select ...><html:options .../></html:select> ) choisir l'id client, recharger la page et afficher en plus de la liste les infos sur le client.
 
le problème c'est que je ne dois pas mettre les bon attribut name et property dans mon select :
 
<html:select name="clients" property="selectid">
  <html:options name="clients" property="clientid">
</html:select>
 
ou
 
<html:select name="clients" property="selectid" size="5">
  <logic:iterate id="cli" name="clients">
      <bean:define id="cliid" name="cli" property="clientId"    type="java.lang.String" />
     <html:option value="<%=cliid%>"><%=cliid%></html:option>
  </logic:iterate>
</html:select>
 
et ca ne marche pas.
 
Je sens bien que je fais quelquechose de pas correct.  
quel moyen dois-je adopter
 
action.java -> result.jsp (choix de l'id) -> action.java -> result.jsp
 
 
 

mood
Publicité
Posté le 22-04-2004 à 10:42:01  profilanswer
 

n°705801
krosso
j'suis à la bourre
Posté le 22-04-2004 à 11:49:43  profilanswer
 

cherche un peu c'est pas compliqué.
(même si les noms des attributs des taglibs struts sont mal choisis...)

n°705803
bird80
Posté le 22-04-2004 à 11:52:13  profilanswer
 

Donc c'est faisable avec un tableau d'objet?

n°706007
bird80
Posté le 22-04-2004 à 14:55:13  profilanswer
 

javax.servlet.ServletException: No getter method available for property selectid for bean under name clients
 at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
 
Mon clients provient d'un tableau de clients et selectid provient de result.jsp et ca ne lui plait pas trop.
Je pige pas très bien ces histoires de name dans le select et sinon options et option c'est quoi la grosse différence?
C'est quoi le mieux dans mon cas


Message édité par bird80 le 22-04-2004 à 14:56:03
n°736159
bird80
Posté le 24-05-2004 à 14:45:04  profilanswer
 

Je me suis remis dessus mais j'ai toujours une erreur :
 

Code :
  1. ApplicationDispatcher[/AppStruts11]: Servlet.service() for servlet debugjsp threw exception
  2. javax.servlet.ServletException: No getter method available for property selectId for bean under name jspokActionForm
  3. at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)


 
Voici mon struts-config :

Code :
  1. <form-bean name="jspokActionForm" type="exemple.jspokActionForm" />


 
La jsp qui pose le problème :

Code :
  1. <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table2">
  2.   <tr>
  3.     <td>
  4.       <html:select name="jspokActionForm" property="selectId" size="5">
  5.         <html:options name="cli" property="clientId"/>
  6.       </html:select>
  7.     </td>
  8.     <td>
  9.     </td>
  10.   </tr>
  11. </table>


 
et enfin la classe (bean):
 

Code :
  1. public class jspokActionForm extends ActionForm {
  2.   private String selectId;
  3.   public void setSelectId(String selectId) {
  4.     this.selectId = selectId;
  5.   }
  6.   public String getSelectId() {
  7.     return selectId;
  8.   }


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  Struts balise select

 

Sujets relatifs
[JS]Cmt faire apparaitre un menu select a partir d'un select ?[STRUTS] Creation de menu avec struts-menu
Recherche cours et didacticiels: JSP/Servlet/JavaBeans - Struts - MVC2selection du select
[JAXB] Enlever la balise d'en-tête d'un marshallingtaille de balise select ?
Java Struts[C] Sockets et appel système "select()"
Plus de sujets relatifs à : Struts balise select


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR