Discussions

Web tier: servlets, JSP, Web frameworks: Struts : Using "multipart/form-data" for upload & back button

  1. Hi All I have a struts application where I have upload functionality. The jsp for upload page has two select boxes and one text box in addition to file input. On selecting value from first select box, page is submitted to get value for the second select box. On selection of second select box page is again submitted to display a value in text box. Once i upload a file and move on to next menu, I cannot come back to the file upload screen. It says "Warning : Page expired". I want to avoid page expiration. I am using IE 6.0. I have tried setting response.setHeader and response.addHeader at the start of upload.jsp with "Cache-Control", "max-age=3600" but no avail. Please let me know if its possible to avoid page expiration and how. Thank you in advance Jay

    Threaded Messages (2)

  2. hi, the options: 1: set in struts-config.xml file 2: Us ethe code snipet: response.setDateHeader ( "Expires ", 0); response.setHeader( "Pragma ", "no-cache "); response.setHeader( "Cache-Control ", "no-store "); response.setDateHeader( "max-age ", 0); response.setDateHeader( "Expires ", 0); cheers, http://www.javaicillusion.blogspot.com/
  3. Re:[ Go to top ]

    Hi Arijit First option is not feasible since it will affect entire application. With second option I have a doubt, if I set Pragma to no-cache and max-age to 0 it will never cache my page. My requirement is to cache one particular page. Please let me know if there is any other alternative. I have tried following option response.setHeader( "Pragma ", "max-age=3600"); response.setHeader( "Cache-Control ", "1500"); response.setDateHeader( "max-age ", 3600); response.setDateHeader( "Expires ", 3600); Regards Jay