jsp - Redirecting a page with a Servlet -


i have application mix of plain old servlets , struts2. there search page used throughout application, made generic page. several search pages include generic page using jsp:include.

problem: have 1 page being refereed 100 other pages so:

<a href="/reports/reporta/selectionpagea.jsp">report selection </a> 

this simple jsp page not use struts2 want page include generic search page (which uses struts2). made mapping in struts.xml because generic search page requires several things built, using genericreportselection, prior displaying page:

<package name="reporta" extends="struts-default" namespace="/reporta">     <action name="selectreporta" class="genericreportselection">         <result>/reports/reporta/selectionpagea.jsp</result>     </action> </package> 

since don't want change other 100 pages added following servlet filter:

if (httpreq.getservletpath().endswith("selectionpagea.jsp"))     ((httpservletresponse) resp).sendredirect("/myapp/reporta/selectreporta.action"); 

question: right approach solve problem? seems work ok when visit particular page, getting struts errors suggesting "list" methods aren't found. though on front end looks alright...


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -