Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26468

HtmlFormGenerator

Newsgroups comp.lang.java.programmer
Date 2013-11-01 11:28 -0700
Message-ID <8e2a98e6-f11e-4173-ba99-91efdc0cfcf2@googlegroups.com> (permalink)
Subject HtmlFormGenerator
From chokri abdessamad <chokri052@gmail.com>

Show all headers | View raw


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 comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

HtmlFormGenerator chokri abdessamad <chokri052@gmail.com> - 2013-11-01 11:28 -0700

csiph-web