Now the JSP referered to by getX_1_page_error can have the Javascript. You will not need to check for error because you go to that page only when you have error.
getX_1_page and getX_1_page_error are same except for the fact that getX_1_page_error has Javascript to deal with the errors.