Jan 6th, 2009, 04:19 AM
Change title of pages using AbstractWizard FormController
Hi, im using AbstractWizardFormController for little flow of portlet pages. I have defined MessageSourceResourceBundle in my application context for localization purposes.
I want to set each page's title according to message in message source. When i was using simple Controller i just had to put something like response.setTitle( messageSource.getMessage ("label.mainTitle", null, renderRequest.getLocale())) in handleRenderRequest(..) of my controller.
But how can I set each page title with AbstractWizardFormController? I didn't find suitable method for this.
Thnx for any help.
Jan 6th, 2009, 04:39 PM
Do it in showPage for each of the form pages, and then potentially in renderFinish and renderCancel.
Jan 7th, 2009, 05:45 AM
thnx for reply.
But showPage(HttpServletRequest request,
don't have any kind of Response, so i cannot use response.setTitle(...)
Jan 7th, 2009, 04:50 PM
Ugh. Good point. I don't see any clear way to do it for page displays. So, I think that leaves you with two options: 1) Use an interceptor. 2) Write an annotation-based controller instead so you have much more flexibility. I can point you at some sample code for an "AbstractWizardFormController"-style annotation-based controller if you need it.
Tags for this Thread