Thanks for quick reply Brian.!

I tried adding new timestamp as parameters which generates new number
everytime I visit the page.

Even added those headers setting for no cache...
<meta http-equiv="Cache-Control" content="no-store"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

Still it is not getting updated.


Brian Thompson-5 wrote:
> 
> What extra parameters have you added to the request?  AFAIK the
> standard solution to this type of "improper caching" problem is to
> simply append a random number or a timestamp to the request URL.  It's
> an ugly hack, but it does work even when the headers don't seem to do
> the trick.
> 
> Of course, the "Right Way" is to rely on the no-cache headers, so you
> might want to do a bit more troubleshooting on that front.
> 
> Hope this helps,
> 
> -Brian
> 
> 
> 
> On Mon, May 24, 2010 at 9:44 AM, XML User <patelsame...@yahoo.com> wrote:
>>
>> Hi,
>>
>> I am running into an issue of caching.
>>
>> I have a jsp which generates the tree view from an XML file. This XML
>> file
>> are loaded when the jsp is loaded. So whenever I add new child to the
>> tree
>> view the xml file is updated by action class and the request reloads the
>> jsp
>> page which in turns reload that updated XML file.
>>
>> The issue is everytime it reloads the XML file, it gets from the
>> temporary
>> internet file which is not getting updated until I kill the browser and
>> reload it.
>>
>> For example.
>>
>> For the first time, I have the xml file with content
>> .Parent 1
>> ...Child 1
>> ...Child 12
>> ...Child 13
>> .Parent 2
>> ...Child 2
>> ...Child 21
>>
>> When I call the action,to show tree then it calls the jsp file which
>> loads
>> the XML file and shows the jsp tree which works perfectly. Shows complete
>> tree view based on XML file.
>>
>> Then I will add new child "Child 22" into ".Parent 2" then the action
>> will
>> be called and that action will update the XML file which is located into
>> "../WEBINF/pages" and returns to the same jsp and reloads jsp which also
>> needs to reloads the updated XML file.
>>
>> Now issue is , its not reloading that updated XML file and still showing
>> the
>> tree without newly added child. When I checked internet temporary files,
>> it
>> was still old XML file but at "../WEBINF/pages" location, the XML has
>> been
>> updated. So I figured out that it is an issue of caching.
>>
>> I tried to remove caching with http headers setting
>> <%
>> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
>> response.setHeader("Pragma","no-cache"); //HTTP 1.0
>> response.setDateHeader ("Expires", 0); //prevents caching at the proxy
>> server
>> %>
>>
>> Also tried with adding extra parameters to change the URL request.
>>
>> But still doen't work.
>>
>> Anyone has any suggestions, what to do next.
>>
>> Thanks for your help.
>>
>> Sorry.., If any typos or explained in too much detail.
>> --
>> View this message in context:
>> http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28657737p28657737.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28657737p28658007.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to