Displaying last modification date

Hi, I am trying to show at the bottom of my JSP page the last time it was modified.
I am using old code, and it is now deprecated I think but I don't know how to work around it.
This is the JSP page:
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.util.*, java.io.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Last Modified</title>
</head>
<body>
<div class="modified">
<%
File thisPage = new File(request.getPathTranslated());
Date pageDate = new Date(thisPage.lastModified());
Calendar pageCalendar = Calendar.getInstance();
pageCalendar.setTime(pageDate);
int lastmodYear = pageCalendar.get(java.util.Calendar.YEAR);
int lastmodMonth = pageCalendar.get(java.util.Calendar.MONTH)+1;
int lastmodDay = pageCalendar.get(java.util.Calendar.DAY_OF_MONTH);
String monthPad = "";
String dayPad = "";
if (lastmodMonth < 10) { monthPad = "0"; }
if (lastmodDay < 10) { dayPad = "0"; }
out.println("Last Modified : "+lastmodYear+"-" monthPadlastmodMonth+"-"+dayPad+lastmodDay);
%>
<h2>
The current time is:
</h2>
<p>
<%= new java.util.Date() %></p>
</body>
</html>

Very interesting.
Instead of request.getPathTranslated() you need to use:
request.getSession().getServletContext().getRealPath(request.getServletPath())

Similar Messages

  • How to display Last modifed and Last modifed user in Apex?

    Hi All,
    Every time i need to display the "Latest Modifed" and "Last Modifed" data fetching from database and display the resultant in the right corner, similarly how we will display user name when we log into Apex application.
    Hints:
    1. I have created a two level tab and under Body i have am using like this
    <td valign="top">{div id="userId" class="t16NavigationBar"><span id="spanUserId" class="t16NavigationBar"> (&APP_USER.)</span>|{a href="&LINK." class="t16NavigationBar">&TEXT.</a>|&F105_ENV_NAME. #REGION_POSITION_08#</td>
    2. From the above syntax we are using the three attributes to display the data.
         &APP_USER.
         &TEXT.
         &F105_EVN_NAME.
    3. The Query which i am using to display the &F105_ENV_NAME. is
        SELECT DECODE(INSTR(global_name,'.'),0,
    global_name,
    SUBSTR(global_name,1,INSTR(global_name,'.')-1)) into :F105_ENV_NAME
    FROM global_name
    4. Similar instead of displaying the Enviornmen name i have to dsiplay these coulums from X table.
        Latest Modifed By
        Last Updated By
    How i can display such kind of these data, since every time it will differ. Can any one hep me on this.
    Thanks,
    Anoo..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi,
    e
    This is some what equal instaed of displaying separted, in your screen you have three tabs, for a example you have ar showing for tabs rite..They only i want to dsiplay the person name.
    For example if you consider your screen you have shown "update anony policy"
    Now i want to display the name directly like this "update anony policy:Anoo" insated of dsiplaying in a separte screen.
    Hope you have got my point.
    Thanks,
    Anoo..

  • How can I get the File Creation Date OR Last modification date of the incoming file in my message?

    I need the Last Modification Date and the File creation date of the consumed file in my message, is it possible to do that using a custom pipeline component in decode stage or any other way? The FILE namespace have File creation time that actually gives
    the time the file was dropped in receive location, not the actual creation time. Also this namespace doesn't have the Last Modification Date.

    Yes,
    As per MSDN, "File.FileCreationTime" - "Defines the time that the file was written to the folder that is monitored by the File receive
    adapter."
    So for File Modified DateTime, only option I can think of is create a custom file adapter (updating the File Adapter code from SDK ..\SDK\Samples\AdaptersDevelopment\File Adapter) and access the received file with the code something like the following, which
    you give you the Last Modified date
    string sLastModifiedDate = File.GetLastWriteTime(path).ToString();
    If there are any business requirements which drives you this, then this the only way I can think of. Because you can access the file properties only in adapter, when it passes through adapter file is handled as stream and you will only have context properties
    to access the file related properties.
    If you're looking for implement this for any audit purpose or for your any technical purpose, then you can suggest some alternate than using File updated datetime.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Displaying Last Modified Date

    I would like to add the Last Modified Date (of the GUI, not db) within my application, how can this be done?

    Hi,
    Can you elaborate a little? What exactly do you want the last modified date of? (the page? the application itself? something else?)
    If it's just the last time the application was updated, the following query should work -
    select
      last_updated_on
    from
      apex_applications
    where
      application_id = :APP_IDYou could obviously use that to set the value of a page item or application item etc to display in your page template.
    Really need more information from you to give a more specific answer.

  • Display "Last Updated" date & time in footer?

    I share Numbers '09 worksheets over a network with my colleague.
    Is there a way to display the date & time of the most recent update (i.e. saved update) in the footer of a worksheet?
    I realize this info is available via the Inspector, but it would be very handy to have it printed out along with the data to ensure we are working off the same document revision.

    Insert > Date & Time into your Header, Footer, Shape, etc.
    Right-Click the Date & Time and select Edit Date & Time. In the dialog window that opens, check the box for Automatically Update on Open.
    Regards,
    Jerry

  • How to display document last modfied date time in core result web part?

    Hi,
    We have a requirment in the sharepoint application where we need to display last modified date&time of document in core result web part.
    To support this we have specify the property <Column Name="Write"/> in custom XSL.
    But it displays only the modified date.Is there is way to display modified date and time as well?
    D.Ganesh

    If you want to modify the
    XML can do i tin the
    template "DisplayTemplate":
    An example:
    Replace
    <xsl:value-of select="write" />
    by
    <xsl:value-of select="ddwrt:FormatDate($write, 1033, 2)"/>
    But I think the managed property"Write"
    is returned only as
    Date without
    Time. By
    this time will
    always 00:00.
    To see the resulting XML
    can replace
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xmp><xsl:copy-of select="*"/></xmp>
    </xsl:template>
    </xsl:stylesheet>
    Where you see the format
    of "write"
    http://msdn.microsoft.com/en-us/library/ms546985(v=office.14).aspx
    Miguel de Hortaleza

  • Modification dates, please help

    I'd like to be able to show the last modification dates of the links on my web page using a JSP, and I'm stumped. Any ideas?
    Thanks

    Sorry let me try and be more clear. I have a static
    HTML page that contains a couple of links. I want to
    be able to display the "last modified" dates of the
    pages which the links refer to when those pages are
    updated next to or under the link on my page. I
    figured I could write a JSP to accomplish this, but in
    researching how I might to it I hit a wall and now I'm
    stumped as to how to accomplish this.You would get a java.io.File reference to the location of the href. Then you would construct a java.util.Date object from the reference.lastModified().

  • How to print the report file name and path and the last mod date

    Good morning,
    I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
    Anyone would know how I can do that? I have checked the doc but found nothing.
    Thks. Philippe.

    Did you ever determine how to print report name and report last mod date?
    Thanks

  • File modification date (lastModified())

    Hi, would like to get the last modification date of a file.
    I'm using lastModified() from class File, but it always gives
    me back the actual date.....I don't understand where's the problem.
    the code is:
    file = new File(excelPath);
    Date fecha = new Date(file.lastModified());
    Thanks.

    file = new File(excelPath);
    Date fecha = new Date(file.lastModified());Are you sure that the file exists? Otherwise, you'd probably see the creation time, which is, guess what, now.

  • Files last modified date using.

    Is there a way to get the last modifed date of a file residing on a remote machine ?
    I tried the URL class. But could get to the file's contents and not the last modifed date of the file.
    Thank you..

    It depends on how you access the file.
    if the files are in a shared folder you can create a file object for it and get the last modified date.
    If it in a HTTP/FTP server then you should be able to ge the last updated date as a header.

  • Checking the modification date of an acquired file

    In my own Keynote files I can either "Get Info" or Revert to > Browse All Versions... to see the modifications and the creation date. I have a Keynote file that was sent to me. Is it possible to see the last modification date? Terminal maybe?
    This is a Keynote 2013 file.

    Is it possible to see the last modification date?
    Creation and modification dates are shown correctly; when first entered on to your system.
    If you need the data from someone else's system ask them for the information.

  • Last Refreshed Date with Timezone

    Post Author: kongusiva
    CA Forum: WebIntelligence Reporting
    Hi,
    We have one requirements like below, we need to display Last Refreshed date which helps to see when the report got refreshed before.
    Present:            Last Refreshed Date: 01-JAN-2008 1:29 PM
    Requirement:     Last Refreshed Date: 01-JAN-2008 1:29 PM EST
                Users like to see the Time Zones also in the Last refreshed Date
    Please suggest me how to resolve the issue.
    Thanks
    Siva..

    Post Author: kcheeb
    CA Forum: WebIntelligence Reporting
    You could use the format editor, select Date and Time tab, Customize, Time tab then use the Format Formula Editor for the AM & PM symbols to add the time zone to the end of the AM or PM string.

  • Modification date instead of Capture date in Grid mode

    I've noticed that in Grid mode (expanded cell information) Lightroom show Modification date instead of Capture date. How can I correct this?

    John, you rock!!!!
    Your explanation is very clear (It shows you have an extended developer background, if you allow me this guessing).
    So...
    Here is the link to the image: https://dl.dropboxusercontent.com/u/45396740/IMG_8491.JPG
    You are certainly right. One thing that is interesting is that when LR (when the import was made, few years from now, I don't know which version I was running, probably 4, but it might have been 5 already. Now I use 5.6) imported the IMG_8491.JPG picture, it seems to me that it created a folder 20051107, using the EXIF:DateTime (which is there 2005:11:07 10:36:30) or the XMP:ModifyDate (which holds the same value)
    But when it shows in the cell what I ask (Capture date), LR seems to show file system's last-modification date
    To correct this, as you suggest, I just have to add a Capture Date. I don't know if pyexiftoolgui allows me to do that
    In any case, thanks A LOT for your tremendous help, again I'm impressed by your knowledge
    Pierre
    PS
    Have you a Web site?

  • Project Server 2010 - Modification date and name of the person who made the last change in the project

    Hello everybody
    I'm with a doubt.
    I got in the business
    environment Project Server 2010 and
    would like to get the publication date,modification
    date and name
    of the person who made
    the last change in
    the project. It is possible
    to doby the native
    resources or is
    there any query in
    SQL Server to perform a
    query of this information.
    Thank you.
    Obrigado por contactar o fórum Microsoft Technet!

    Hi Hezequias,
    You can get the ProjectModifiedDate column in MSP_EPMProject_userView in the Reporting DB where you can
    get the data based on the projectUID. 
    The "last saved" date in the draft DB (be aware that querying in the draft DB is not supported by MS).
    For the "last modified by", I think it is not stored in any place.
    But you can develop custom code upon publishing the project (Event BeforePublish), writing the current
    date and username automatically into a custom enterprise field.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Display last 12 months data in column chart

    Hi All,
    I have one  dashbord  requirement in list box i have (example:):  "oct-11" i need to display previous 12 mnth data in column chart anybody help in excel formula how to display last 12 mnths based on list box selection.
    example:  if i select oct-11 from list box i need to display in chart like
    nov-10 dec-10 nov-10...................................oct-11
    please provide how to write in logic in excel

    Hi Shankar,
    Try this formula in excel : DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))
    A1 will be your cell which is the destination of your List box. & then drag it till 12 months.
    If you are not having day from your list box then manually enter 1 in any cell and map that cell in place of A1 for day.
    HTH.
    Neeraj..

Maybe you are looking for

  • Flash is up-to-date, but Plugin won't work

    Hi! I'm using Firefox 29.0.1 on Windows 8, (also up-to-date), and Flash plug-in won't work. I re-downloaded & installed Adobe Flash 13.0.0.214...I verified it on their website, but I can't get the plugin to work. I had no problem with it earlier toda

  • Dual display problem (again)

    Ok. The short version: A few weeks ago my old graphics card on my Mac pro 2007, 8 core stopped working. I got a new Geoforce GT120 with one DVI and one MDP port. My displays are two Samsung 20, with only VGA and HDMI inputs. It all worked on my recen

  • AE(Airport Express Won't Work)`

    i trying everything it says im connected though i cant get any internet access expect for Skype what do i do Any ideas please ???????????????

  • HTTP Service XML to ArrayCollection

    Hi, How do I convert the results from a remote XML List file called using the HTTPService method into an arrayCollection for sorting filtering etc. ??? (I assume it is the arrayCollection please feel free to suggest a better method) I have this worki

  • Traverse Records in a Report or Tree.

    Hi Everyone, I've not yet seen any answer to this question but, Has anybody created or worked with any functions to traverse through records of a tree or report using a Next and Previous button. Creating an effect similar to pagination. Our issue is