check your web.xml to see if your filtering thru SiteMesh e.g. <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
where com.opensymphony.module.sitemesh.filter.PageFilter contains parsePage method protected com.opensymphony.module.sitemesh.Page parsePage(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { try { PageResponseWrapper pageResponse = new PageResponseWrapper(response, factory); chain.doFilter(request, pageResponse); // check if another servlet or filter put a page object to the request Page result = (Page)request.getAttribute(PAGE); //MG: THIS IS the page you want if (result == null) { // parse the page result = pageResponse.getPage(); } request.setAttribute(USING_STREAM, new Boolean(pageResponse.isUsingStream())); return result; } //once you have the Page you can do page.getTitle() and then //map Title to Page Number //the other way is to modify protected com.opensymphony.module.sitemesh.Page //for accessor and mutator for pageNumber did you ask wes? Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Thu, 9 Jul 2009 07:36:58 -0700 > From: mailtolouis2020-str...@yahoo.com > Subject: Re: dynamic return when validation failed > To: user@struts.apache.org > > > <result name="input">/xxx/MyWizardPage${page}.jsp</result> > > oh yes, this does the trick! Thanks! > > I just found another problem when using xml based validation. In struts1, > there is a page attribute, which can tell the validator to validate certain > fields which belong to that page, but this useful feature is not in struts2, > is there any replacement for that? > > > > > > ________________________________ > From: Greg Lindholm <greg.lindh...@gmail.com> > To: Struts Users Mailing List <user@struts.apache.org> > Sent: Thursday, July 9, 2009 2:32:17 PM > Subject: Re: dynamic return when validation failed > > > > > > > > > > > Well, if I remove my validation code in the validate() method and put it > > > into execute() method, then I can easily control which logical name to be > > > return, but I thought that is not a good way to do that right? > > > > > > > While this might not be a "good way to do that," it's what I would do and > > in > > fact have done. > > -- > > Jim Kiley > > Senior Technical Consultant | Summa > > [p] 412.258.3346 > > http://www.summa-tech.com > > > > I occasionally have to do validation in the execute() method but always > prefer to do declarative validation with annotations wherever possible since > it is so much simpler and cleaner. This means all my actions have to be able > to handle an 'input' result. Since 'input' result is the standard for > validation errors you should be prepared for it as the next programmer who > works on your code may add a validation() method or add validation > annotations. > > @OP: If you know which page# in a wizard sequence to return to and use that > page# in the jsp name then you can make that page# available with a > getPage() method and do this: > > <result name="input">/xxx/MyWizardPage${page}.jsp</result> > > It does mean you would need to have a jsp page naming convention that > includes the page#. _________________________________________________________________ Windows Live™ SkyDrive™: Get 25 GB of free online storage. http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009