String red;

red = this.getParameter("red");
int rosso = integer.ParseInt(red);

....

Così va?