Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26468 > unrolled thread
| Started by | chokri abdessamad <chokri052@gmail.com> |
|---|---|
| First post | 2013-11-01 11:28 -0700 |
| Last post | 2013-11-01 11:28 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
HtmlFormGenerator chokri abdessamad <chokri052@gmail.com> - 2013-11-01 11:28 -0700
| From | chokri abdessamad <chokri052@gmail.com> |
|---|---|
| Date | 2013-11-01 11:28 -0700 |
| Subject | HtmlFormGenerator |
| Message-ID | <8e2a98e6-f11e-4173-ba99-91efdc0cfcf2@googlegroups.com> |
bonjour,
s'il vous plaît je souhaite générer une page HTML a des label (Identificateur, nom, NumTel, email) et des champ de saisir à côté de chaque label dans le même ligne avec des taille différents (je les définir à l'aide des annotations )
voici mon classe contact
public class Contact {
@Column(label="Identificateur", size=10)
private int id;
@Column(label="Nom",size=30)
private String name;
@Column(label="N de téléphone")
private String tel;
@Column(label="Adresse Email",size=30)
private String email;
public Contact() {
super();
}
public Contact(int id, String name, String tel, String email) {
super();
this.id = id;
this.name = name;
this.tel = tel;
this.email = email;
}
et voici aussi l’annotation @culumn pour les champs
@Retention(RetentionPolicy.RUNTIME) // RetentionPolicy.SOURCE ==> par default
@Target(ElementType.FIELD)
public @interface Column {
String label();
int size() default 20;
//String sqlType() default "VARCHAR";
}
et voila mon code JAVA qui sera faire ceci que je entrain de expliquer
public class HtmlFormGenerator {
private Object source;
private String target; //chemin des fichiers cibles
public HtmlFormGenerator(){
}
public static boolean generate(){
//... formulaire de saisie des informations sur l objet, l //introspection et l annotation
return true;
}}
s'il vous plaît si quelqu’un a un solution ou un suggestion
et merci d'avance
Back to top | Article view | comp.lang.java.programmer
csiph-web