cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <>
Subject Re: how to generate random numbers or strings?
Date Fri, 07 Mar 2003 13:09:53 GMT

I meet this problem some months ago. I made a solution using XSP. I think
you can easily enhance this piece of code:

	String key = <xsp-request:get-parameter name="table_id" default=""/>;
	while (key.equals("")) {
		Random aleatorio = new Random();
		int new_key = aleatorio.nextInt(Integer.MAX_VALUE) + 1;
		llave = String.valueOf(new_key);
		/* Check into database if the key exist into the table */
				SELECT table_id FROM table WHERE table_id=<esql:parameter
					key = "";
<parameter name="table_id"><xsp:attribute

best regards,

Antonio Gallardo

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message