How do I force clients to cache files obtained from my servlets

I have a servlet that creates files.
I want to save my servlet from generating a file that a client already has, (ie get him to use caching).
I only want it to create a new file if any data has changed since last making it.
(I can easily generate a last modified date for the data within the file)
I know I have to use
myServletResponse.setContentType(java.lang.String type) but am unsure as to what exactly to put in the 'type' field.
I have read
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
but am none the wiser as to the specific String needed

So I don't need to fill in any HTTP Responce headers,
I can just override the getLastModified() method?Don't take my word for it (because I haven't done it). Read the API documentation to see what it says, or try it.
How will the client beable to compare dates without a
date for the original?If this means "What happens the first time a client asks for a document?" then the answer is that it doesn't attempt to compare any dates. If it means something else, then try asking it in different words because I don't understand it.

Similar Messages

  • Is it safe to delete the cache file folder from library

    is it safe to delete the cache file folder from library ?

    As I understand it Robo doesn't really 'do' third-party
    source control. We use SourceGear Vault, but really only as a
    repository for the files. We can't really work concurrently because
    Robo needs exclusive access to the top level project files. But it
    kind of works for us, because we're on opposite sides of the globe.
    I see what you're saying on the 'local' versions of (say) the
    cpd files conflicting. If anyone else has an informed view, I'm all
    ears. We've set it up this way ourselves - I don't know of anyone
    doing the same. If someone tells me this is a bad idea, I'm happy
    to think again.
    Cheers!

  • Developing a 2 page form, username on the 1st page, password on 2nd how can i force FF to use the username from previous page when it asks to remember acct info?

    I am developing a 2 page signup form, where the person enters their username on the 1st page and password on the 2nd.
    When I test the form, FF asks to remember my password for the site - however it thinks the zipcode (field above the password) is the username on the account.
    I have tried to put their username/email in a hidden field on the 2nd page, just above the password field - and that did not work.
    How can i force FF to use the username from previous page when it asks to remember acct info?

    This website is using autocomplete=off to prevent Firefox from saving and filling the name and password.
    You can remove autocomplete=off with a bookmarklet to make Firefox save names and passwords and other form data.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered

  • How do I force iTunes to put my contacts from the computer onto the phone?

    How do I force iTunes to put my contacts from the computer onto the phone? Multiple synchs and a restore did not work and neither does clicking the advanced setting "replace this information for this iPhone." Earlier this year I tried syncing via the cloud but only ended up with 3 different calendars, bookmarks and contacts on my devices so now I only sync via iTunes and USB.

    i followed the instructions to manually manage songs and playlists.
    Drag playlists from iTunes in the Source to the iPod.
    If you want to delete a playlists from the iPod, in the Source in iTunes, click th eDisclosure triangle in front of the iPod name to display the playlists on the iPod.
    You should edit the playlists in iTunes and then drag them to the iPod.
    If you edit them only on the iPod in iTunes, and have to reload your iPod, the playlists will disappear.
    what do i need to do to save the music from my nano to my hard drive
    The songs should be in iTunes already.

  • How can I get rid of cache files?

    Premiere Pro, can't find cache files on Mac, not in the common folder, clean doesn't work, I know there are Gigs of them on my drive.  How can I get rid of them?
    I started a premiere project I had worked on before using an external drive but forgot to hook up the external drive.  In a few minutes, Premiere loaded 5 gigs of cache files onto my macbook pro drive OSX 10.8.6.  I tried the following to free up the space:
    Tried to "clean" the cache folder before switch it to the external drive - this only removed a small amount of the 5 gigs created
    Tried to find files in the Application Support/Adobe/common folder - no cache files found
    Tried searching the web for answers - no new info
    Tried searching my drive for the files - can't find them
    Tried restarting the MacBook and Premiere with and without the external drive - no luck
    Now what?
    Message was edited by: Kevin Monahan
    Reason: please make a shorter and more concise title next time. Thanks.

    First off, exactly which version of Premiere are you running? Not simply PPro CC or CC2014 but the version number shown in the About box.
    I'm not clear whether you're saying that Premiere can't find the cache files or that you can't find them.
    I gather that you're referring to the Clean button on the Media tab of the Preferences dialog, which is also where you set the path for the cache files.
    Are you sure you're looking in the correct Library--not the one that's readily accessible under Macintosh HD but the one that Apple, in it's infinite wisdom, hides from users. To access it, open the Go menu and press Option.

  • How can I force the Disk Cache on with Apple Raid Card?

    I have an apple raid card in my mac pro that has now had it's battery fail twice. I don't really want to keep putting money into this and would rather just force the disk cache on and hope my UPS works, I don't use this box for real work anymore anyway and it's all backed up.
    There used to be a force on button next to the Write Cahce Status section, but that seems to have gone away. Does anyone know how to force the cache on? Permanently if possible.

    OK, Command Line fun, use at your own risk:
    sudo raidutil modify controller -E

  • How can a user scroll the resultset obtained from a servlet in a jsp page?

    Actually i am having a page where user has to select company name and for tht i am providing him with a button, and on clicking tht button a
    new search page is provided , and on mentioning the search criteria ,a servlet is fired which returns a list of companies(tbasically i am creating a session object of resultset type which stores the companies name), now the servlets again goes back to search page, and here i want 2 display the company names, i am able to display company names in my search page , but now i want my user to select one of the companies from tht servlet.
    for tht i need to tap the onMouseOver function of java SCript, C
    Can any one tell me how to write code for tht
    Thanking in Advance

    see https://addons.mozilla.org/en-US/thunderbird/addon/send-later-3/

  • How can i load Client side XML file to Table

    Hi,
    How can i load the all the XML files (near 10,000 files) available in client machine to the XML table .
    I did try with directrory list in the Webutility demo form, but when the number of file is near to 1,500 its giving error.
    Please suggest the best method to implement my requirements.
    1. XML fies are in a folder in end users machine(Windows OS)
    2. I need to load all the XML files to table (Oracle Database is in Unix)
    I am using forms 10g
    Thanks in advance.
    Rizly

    Hi,
    What is the error you are getting when you reach 1,500 records? Can you post it? You mentioned you are using the webutil to load them. How you are loading? From the client machine you are loading to the database directly? Can you post the code you are using for that?
    -Arun

  • How to locate and delete temp cache files in pp cs5

    where can i find and delete unneeded files

    lol thanks. i was wondering how to find them. i used the explorer search but the pp cace files didnt show up

  • How to let windows clients open my file share on

    How do I on windows XP and 7 open a smb file share anywhere. I have it setup for my macs but Idk how to do it for PCs. This service is hosted on a Mac OS Lion server.

    Backspace is the "remove last character" key...I assume you mean a space?
    You need to surround it with quotes.

  • How to highlight searched words in pdf file opens from web??

    Hello fellows
    I need to create a web page that holds couple controls include "search" button .When client clicks on the button the programm will search pdf file, open it in client reader with highlight on searched words ..
    Is that any posibility to do it using javascript on a client or c# ,vb.net on the server ??
    I'm very novice in PDF developing so any ideas or conclusions would be very usefull!

    Thank you for answer
    But maybe you have any idea how I can do it??
    This is very important feature for our project.
    Some additional information : our project will hosted in SharePoint 2007
    When I use adobe Ifilter for moss and set in querystring #search="searchword"  I get highlights, but only in a browser.
    But if a reader was configured to open client application this feature wasn't work.
    Any suggestion ???

  • How can I prevent illustrator to override files downloaded from dropbox to double extension? .ai.ps

    This only happens with dropbox. When I download a file in .ai from the dropbox it assumes it as .ai.ps. However, if I use the synched files, such problem does not occur. I've contacted dropbox to see what they now about it and they responded did: "The Dropbox desktop client syncs files exactly as they exist in the Dropbox folder on your computer. It is possible that Illustrator saves multiple files when you save a document - the extra file may be a hidden file not visible in Finder, but if it is on the Dropbox website it exists in your Dropbox folder. I'd suggest asking Adobe for more information."
    Does someone know how to solve this?
    Thank you kindly

    Hi,
    False alarm. I discovered that there was a demo Version of Suitcase that wasn't visible in ControlPanel-> Programs and Features, but was still partially installed. I Manually cleaned out all the Suitcase remnants I could find and Photoshop now prints! Sorry.

  • How can I load the selected XML File (Selected from a Listview) into the correct Textboxes?

    Right, so I have a windowsform with lots of Textboxes, where the user can type in Information, and then hit "Save", once its saved it goes into a sortof XML Format 
    <?xml version="1.0" encoding="utf-8"?>
    <!--Database-->
    <Case>
      <Person>l<Driver></Driver><License-Holder></License-Holder><Address></Address><Phone></Phone><Date-of-Birth></Date-of-Birth><Registration></Registration>
    Like that.
    Now, on my Startup Form (The main form) there is a Listview that I gave the name Objectlist1. This list displays ANY file located in a specific folder on my computer. This is also where the Saved files appear.
    The list also updates every 5th second so after you save it appears quickly.
    Now, the Files are saved using the content or Value of the first Textbox:
    Dim XmlWrt As XmlWriter = XmlWriter.Create("C:\Users\USER\Desktop\TESTFOLDER\" + Firsttextbox.Text, settings)
    So it appears in the folder and on the list with the value inserted in the first Textbox.
    My problem comes when I want to load this back (Or reverse the function if you will)
    Where I can go to the Objectlist1/Listview, either doubleclick a file or Mark a file, and hit my button "Retrieve"
    I want the Form where you could input all the values to show - which it does
    And the information from the XML/File saved to appear where it once was typed or inserted.
    Here is an example of the code used to save the values from the Textboxes;
    Private Sub Savebutton_Click(sender As Object, e As EventArgs) Handles Savebutton.Click
            If IO.File.Exists(Pholderbox.Text) = False Then
                Dim settings As New XmlWriterSettings()
                settings.Indent = True
                Dim XmlWrt As XmlWriter = XmlWriter.Create("C:\Users\USER\Desktop\TESTFOLDER\" + Pholderbox.Text, settings)
                With XmlWrt
                    ' Write the Xml declaration.
                    .WriteStartDocument()
                    ' CLIENT
                    ' Write a comment.
                    .WriteComment("Database")
                    ' Write the root element.
                    .WriteStartElement("Case")
                    ' Start our first person.
                    .WriteStartElement("Person")
                    .WriteString(Textbox1.Text)
                    ' The person nodes.
                    .WriteStartElement("Driver")
                    .WriteString(Textbox2.Text)
                    .WriteEndElement()
    I've tried multiple codesamples but they all give either "XML Not found" or such Overloads.
    This is the current code I used when trying to make it work
    Private Function ReadSettingsXML(ByVal path As String) As MySettings # On Debug It marks here and tells me it wasn't found.
            Dim thisSettingsInfo As New MySettings
            If My.Computer.FileSystem.FileExists(Objectlist1.SelectedItems.ToString) Then
                Dim settingsInfo = XElement.Load(Objectlist1.SelectedItems.ToString)
                If settingsInfo IsNot Nothing Then
                    For Each mainGroup As XElement In settingsInfo.Elements
                        If mainGroup.Name = "<Database>" AndAlso mainGroup.HasElements Then
                            For Each subGroup As XElement In mainGroup.Elements
                                If subGroup.Name = "<Person>" Then
                                    thisSettingsInfo.Textbox1 = subGroup.Value
                                ElseIf subGroup.Name = "<Driver>" Then
                                    thisSettingsInfo.Textbox2 = subGroup.Value
                                ElseIf subGroup.Name = "<Address>" Then
                                    thisSettingsInfo.Textbox3 = subGroup.Value
                                End If
                            Next
                        End If
                    Next
                Else
                    thisSettingsInfo = Nothing
                    Throw New Exception("The settings XML file is corrupt and cannot be read.")
                End If
            Else
                thisSettingsInfo = Nothing
                Throw New Exception("The settings XML file could not be located.")
            End If
            Return thisSettingsInfo
        End Function
        Private Sub LoadXML_Click(sender As Object, e As EventArgs) Handles LoadXML.Click
            Dim settings As New MySettings
            settings = ReadSettingsXML(Objectlist1.SelectedItems.ToString)
            If settings IsNot Nothing Then
                Dim sb As New System.Text.StringBuilder
                With settings
                    Caseworker.Textbox1.Text = .Person
                    Caseworker.Textbox2.Text = .Driver
                    Caseworker.Textbox3.Text = .Address
                End With
            End If
        End Sub
    Also, the "Caseworker" is the form where all the textboxes are located.
    Been stuck on this for two working days, so any help is highly appreciated 
    Codesamples are also highly welcome so I can see what the heck you did and find and answer to my problems.

    I found a code that might be close to what I'm looking, but as of this code used here, it looks for a static document that already exist and is located in the code.
    See this one here, checks for the XML file, and since I can't link one program to 1 file, when its gonna have and use 100's of files.
            If (IO.File.Exists("MyXML.xml")) Then
                Same here with the static document.
                Dim document As XmlReader = New XmlTextReader("MyXML.xml")
                While (document.Read())
                    Dim type = document.NodeType
                    'if node type was element
                    If (type = XmlNodeType.Element) Then
                        If (document.Name = "FirstName") Then
                            TextBox1.Text = document.ReadInnerXml.ToString()
                        End If
                        If (document.Name = "LastName") Then
                            TextBox2.Text = document.ReadInnerXml.ToString()
                        End If
                    End If
                End While
    Am I at least close here, people? 
    Can anyone help with the now critical issue I got?
    I basically need to change these two;
     If (IO.File.Exists("MyXML.xml")) Then
                Same here with the static document.
                Dim document As XmlReader = New XmlTextReader("MyXML.xml")
    To whatever value, so they read from the file SELECTED in my Listview
    Cos the program saves files according to the info inserted in textboxes, so it can have whatever name you can think of, I need the program to "find and load" that file, once its selected, and then once I hit Retrieve or LOAD or whatever button, it
    injects the info from the File to the correct Textboxes.
    And I think this will work to get the info in the right boxes;
     If (document.Name = "FirstName") Then
                            TextBox1.Text = document.ReadInnerXml.ToString()
                        End If
                        If (document.Name = "LastName") Then
                            TextBox2.Text = document.ReadInnerXml.ToString()
    Any good advise? I'm stranded here.

  • How to extract a .eml (e-mail file) "attachment" from an e-mail

    Hi,
    I have a slight problem with e-mail attachments. It's quite an explanation, so stick with me please.
    I have to extend, debug and adapt an e-mail archive for my company.
    I already worked on this project for 2 months, to make an extra batch and change some functionality of the existing e-mail archive.
    I've been outsourced for a montsh, and now back on the e-mail archive.
    There were some problems with e-mail attachments. (.gif, .doc, ...)
    Some of them weren't shown in the web application.
    The code that already has been written has a custom Email object. This e-mail object contains custom EmailBodyPart objects. Every EmailBodyPart has a disposition (Part.INLINE or Part.ATTACHMENT).
    In every JavaMail Message object, every BodyPart is read, the disposition is extracted, and an EmailBodyPart is created with the disposition and some other data. Then, this EmailBodyPart is added to the Email object.
    But sometimes, an attachment (.gif, .doc, ...) doesn't have the correct disposition in a Message, and isn't added as attachment, but as INLINE.
    This way, in the web application, there aren't any attachments visible for the e-mail, but when you send the mail back to your inbox through the web interface, you can see the attachments again.
    I had to solve this, and make the attachments visible in the web interface, and i did. I just checked if a filename was present, and if it wasn't an image (images still can be inline), then the disposition of the EmailBodyPart is set to Part.ATTACHMENT. It is visible now.
    But now on to the problem...Sometimes, an e-mail (.eml file) is added to an other e-mail as an attachment. But, this e-mail isn't included as disposition attachment, but just as an other message within the message. It doesn't even have a file name. It seems like this is just a forward or something.
    This e-mail should be visible as an attachment of the surrounding e-mail within the web interface. Does anyone have an idea how i can accomplish this and extract this body part as an attachment? Are there any headers i can check? (I printed the headers of the body part and there were only three, content-type, encoding en such ... but nothing like disposition. I tried to set the disposition to attachment to make it visible as an attachment, but that didn't work.
    Thanks already in advance.

    Hi there,
    Thanks for your reply.
    Well, it was kind of a mistake in the webapplication itself. The object passed to the related method was an instance of MimeMessage (the previous programmer only checked MimeMultiParts), and those weren't added to the vector of attachments. Now they are.
    But now i still have problems. I have to give those attachments a file name. I tried extracting the subject from the message, but in the related method the message is casted to a multipart (is needed for further processing), and i can't fetch the sub-message's subject (if i get the part, i can't get the subject header anymore).
    If i don't give the file a .eml extension, it opens a MHTML file or something, and it is unreadable by windows. If i get an InputStream of the part's content, and return that, and give the attachment a .eml extension, i get the outlook window , but all the text is pure HTML code. Not like it should be, and the mail in Outlook doesn't have any headers (no from, no to, no subject, ...)
    Any idea here ? I could suply you with some code, but i don't understand all the steps myself, i got on this project which was build by someone else. It's quite a lot of code.
    Thanks in advance.

  • How do I restore time machine alias files cloned from broken hard drive

    My external hard drive broke (a tiny transistor broke off after the drive fell two feet to the floor) so I purchased a new one and had the Geek Squad clone what was on my old hard drive onto my new one. I was using Time Machine to backup my files. My external hard drive had a much larger capacity than my macbook pro, so I deleted a number of the files saved on my Macbook Pro, knowing that I could access my files whenever I plugged my ext. hard drive in.
    After plugging my new external hard drive into my computer, however, I am finding only alias files and I do not know how to restore my data so I can access all of the files again.
    Does anyone know how to restore my time machine data from the cloned data I had transferred from my broken external hard drive to my new external hard drive?
    Thanks!

    morrisck wrote:
    An update - I finally took both of my HDs in to an Apple store and they confirmed my fear: only alias files had been transferred from my old drive, meaning Geek Squad charged me $100 for 850 MB of unusable files.
    That has been clear since early in this thread.
    Geek Squad has agreed to retry the process
    Why pay them to do what you don't need done??? Get a refund and buy an enclosure, which you should have anyway for backups.
    but I'm now wishing that I had received more sound advice when I brought the drives into them in the first place.
    Don't know who gave you that advice, but I sure wouldn't trust them with my data!
    The Apple rep. informed me that my HD works perfectly fine and that it just needs a new enclosure (which I can buy for $20 online, as opposed to paying $100 for a data transfer).
    Ummm, the action to take seems very clear to me . . . .

Maybe you are looking for

  • Documents for SRM installation

    hi guys i need to instal srm with ep. .can anyone give the material.. regards kamal

  • Earlywatch report setup - step by step

    Hello All, I was hoping to get some documentation, best practice or something, on the set up of earlywatch reports within solution manager.  I'm new enough to SAP and everything with it that I will spend an hour on service marketplace but not find an

  • Pre purchase compatibility query

    Hi - I'm a newbie to this forum as I am thinking about joining the throng leaving the Windows based community to avoid "vista" and moving to iMac Intel. Trouble is I am old enough to remember using DOS [acually machine coding a Zenith before that] an

  • What does 'DDIC' stands for??

    Hi, When i checked the Technical spec. .I found there showed 'DDIC layout template'. What does 'DDIC' stands for?? Thanks!

  • DIP profile error

    I'm trying to register a new profile using manageSynchProfiles and getting the following error: orclodipagentname=ad1,cn=subscriber profile,cn=changelog subscriber,cn=oracle internet directory profile is not associated to a group Can anyone suggest t