There are a number of methods:
protected int getInitialPage(HttpServletRequest request)
protected String getViewName(HttpServletRequest request, Object command, int page)
protected int getPageCount(HttpServletRequest request, Object command)
which the JavaDoc says you can override in order to implement, for example, dynamic lists of pages (which is what I need: the pages in the wizard should change based on choices made on the first page).
The problem is that the showPage method simply calls getPages() and decides for itself which page to show next!
OK, I thought, so I'll override getPages() to return my dynamic list: but you can't because getPages(), a method on an abstract class, has been declared final!
So that only leaves me with one option: to inappropriately override another method (I'm thinking of onBindAndValidate to setPages()) to set my dynamic list of views. I'd always wondered why there were no real examples of a wizard beyond the simple fixed set of pages ones in the pet store sample.


Reply With Quote
