You're close. Use getParameter instead of getAttribute. Since getParameter always returns a
string, you will have to convert it to an int.
int
test = Integer.parseInt(request.getParameter("test"));
Also, in
Struts, if you've defined "test" as one of the properties of the ActionForm that goes with this action, you can get the value by using the ActionForm's getter:
test = myActionForm.getTest();