HtmlFormGenerator

  • Thread starter chokri abdessamad
  • Start date
C

chokri abdessamad

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 chaquelabel 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top