wood burning stoves 2.0*
The moose likes Struts and the fly likes Redirect servlet from struts result tag - Cache issue in Proxy server. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Redirect servlet from struts result tag - Cache issue in Proxy server." Watch "Redirect servlet from struts result tag - Cache issue in Proxy server." New topic
Author

Redirect servlet from struts result tag - Cache issue in Proxy server.

shankhaKasba Kasba
Greenhorn

Joined: May 25, 2011
Posts: 1


I am using struts2.

In my jsp page I have a link to render PDF report. I use following entries in the struts.xml file.

<!-- PDF Report -->
<action name="openPDFReport"
class="com.cognizant.gto.jcoe.cap.web.action.PDFConvertionAction">
<result>/PDFDashBoardReportServlet</result>
</action>

When I am deploying in the local tomcat server the PDFDashBoardReportServlet will open a PDF report properly in the web page.

But when i put a proxy server infront of the actual Tomcat server, PDFDashBoardReportServlet will give me back the report from the proxy cache.

It does not give me back the report for interest.

Logic of fetching a specific report based on the some parameter is written inside the servlet.

How to resolve this cache issue .. Please provide some pointer.

My understanding is that, if I am able to append some system date as a parameter to the requesting servlet url, then probably the proxy server will identify each the as a new request and fectch the report from the original backend server.
Eg.


http://10.227.88.62:8089/JCAPWeb/PDFDashBoardReportServlet?date=..........

If this is the correct approach, then how can I incorporate this.

Entries in the web.xml file is


<filter>
<filter-name>struts-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>

<filter>
<filter-name>struts-execute</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts-prepare</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>struts-execute</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<servlet>
<description>
</description>
<display-name>PDFDashBoardReportServlet</display-name>
<servlet-name>PDFDashBoardReportServlet</servlet-name>
<servlet-class> com.tango.gto.jcoe.cap.web.processor.PDFDashBoardReportServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>PDFDashBoardReportServlet</servlet-name>
<url-pattern>/PDFDashBoardReportServlet</url-pattern>
</servlet-mapping>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Redirect servlet from struts result tag - Cache issue in Proxy server.
 
Similar Threads
How to configure tiles with JSF+Struts2 Integration ?
Struts2 Start up error : org.apache.struts2.dispatcher.FilterDispatcher java.lang.NullPointerExcept
Http status 404 error
<jsp:include TO_ACTION/> do not work on WAS 6.1
struts2 out of the box problem