|
|
| ValidationException |
Expert:kram
im throwing different validationException on my command class and i'm trying to catch this exceptions on my action class to redirect it to another page once a specific exception is catched. code: on my command class try { if (condition) { throw new ValidationException(exception.exception1); } else { throw new ValidationException(this.message); } } catch (ValidationException e){ throw e; }
on my action class catch (ValidationException e) { if (e.getKey().equals(exception.exception1) { createError(e, request, mapping); return findAndTrackForward(mapping, "page1", request.getSession()); } else { createError(e, request, mapping); return findAndTrackForward(mapping, "page2", request.getSession()); }
the problem is: page1 = is the same page where the validation is done...and it works page2 = is not the same page..it is another jsp page...
once else is satisfied on my catch block (action class) it redirects to page2 but the pop-up/alert message that contains the message (this.message) does not appear, but once i change this part of my code -- else { createError(e, request, mapping); return findAndTrackForward(mapping, "page2", request.getSession()); } to -- else { createError(e, request, mapping); return findAndTrackForward(mapping, "page1", request.getSession()); } page2 to page1.....the pop-up/alert message containing the message (this.messsage) appears..and of course it will only be redirected to the same page...
How can i make my pop-up/alert message containing the message (this.messsage) appear and after clicking OK from that pop-up it will redirect to another page(page2)? |
| Answers |
Hi friend,
Read for more information at
http://www.roseindia.net/struts/struts_validator_framework.shtml
Thanks
|
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|