• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 | Last modified date of an uploaded file

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my application I have a requirement that I have to upload a file to the server (Tomcat 6). On the server I have find out the file's last modified date (the one which we usually find in File->Properties). I am using Struts2.

I am using the "s:file" tag in my multipart form in my jsp to allow the user to select the file.
This is the code snippet of the jsp:


Action class:


Now, these variables are mapped to my jsp element. Using the File object (upload) in the java code if i try to do something like this:

I get back the current date on the server and not the actual last modified date of the file.

Is there any way by which I can find the last modified date of the uploaded file in Struts 2. Please help.
Thanks in advance.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The last modified date is stored in the client filesystem. There's no way I know of to upload that information without making a client-side application.
 
Praveen Sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way I can read the last modified date in the client side before sending the request to server ?
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:There's no way I know of to upload that information without making a client-side application.

 
reply
    Bookmark Topic Watch Topic
  • New Topic