Discussions
Web tier: servlets, JSP, Web frameworks: Struts : Using "multipart/form-data" for upload & back button
-
Struts : Using "multipart/form-data" for upload & back button (2 messages)
- Posted by: Jay Gaba
- Posted on: November 23 2006 13:05 EST
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 JayThreaded Messages (2)
- Re: Struts : Using "multipart/form-data" for upload & back butto by arijit dey on November 24 2006 01:26 EST
-
Re: Struts : Using "multipart/form-data" for upload & back butto[ Go to top ]
- Posted by: arijit dey
- Posted on: November 24 2006 01:26 EST
- in response to Jay Gaba
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/ -
Re:[ Go to top ]
- Posted by: Jay Gaba
- Posted on: November 27 2006 05:49 EST
- in response to arijit dey
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