Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java URL inputstream caching

Have Programming Question? Ask it here!
 
 
 


Madhavi
Java URL inputstream caching
0 Answer(s)      11 months ago
Posted in : Java Beginners


I have a web application in which the header is displayed by hitting a URL. Since the header content doesnt change always i wanted to cache the results of the URL inputstream and refresh it for every 60 mins. The code of my header.jsp is

<%    
    URL url = new URL(strHeaderURL);
    isProxyEnabled = UCMUtility.getProperty("globalheaderproxyenabled");
     System.out.println("isProxyEnabled "+isProxyEnabled);

     System.out.println("condition "+isProxyEnabled.equals("Y"));
     if(isProxyEnabled.equals("Y")){
         System.out.println("inside proxy Yes");

         proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(UCMUtility.getProperty("globalheaderproxy"), Integer
                    .parseInt(UCMUtility.getProperty("globalheaderport"))));
         connection = url.openConnection(proxy);
     }
     else{
         System.out.println("inside proxy No");

         connection = url.openConnection();
     }
     connection.setDoInput(true);
     //connection.setReadTimeout(1000);
     //connection.setConnectTimeout(1000);
     InputStream inStream = connection.getInputStream();  
     input = new BufferedReader(new InputStreamReader(inStream));
     strContent = new StringWriter();  
     while ((strLine = input.readLine()) != null) {     
         strContent.write( strLine+"\n" );   
     }
              out.println(strContent.toString());
         %>

I include this header.jsp in all other jsp's.... Now I wanted to cahce the result of this jsp and refresh it for every 60 minutes. How can I do this? Can anyone guide me please. I searched a lot in net but could not find anything which I can understand :( Someone pls help me ..


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Java URL inputstream caching
Java URL inputstream caching  I have a web application in which the header is displayed by hitting a URL. Since the header content doesnt change always i wanted to cache the results of the URL inputstream and refresh it for every
Java IO InputStream Example
Java IO InputStream Example In this section we will discuss about the InputStream in Java. An abstract class InputStream is a base class of all the byte... in the java.io package. There are various of subclasses which extends InputStream
Advertisements
Java Write To InputStream
Java Write To InputStream In this tutorial you will learn how to write to InputStream in java. Write to file from InputStream in java you may use the InputStream class of java.io package. This class reads the streams of bytes
How to write file from inputstream in java
How to write file from inputstream in java  Hi, how to write file from inputstream in java program. Plz suggest an example or suggested link... link to your query "How to Write to inputStream in Java". This is good
Java convert string to InputStream
Java convert string to InputStream In this section, you will learn how to convert string to Inputstream. In one of the previous sections, we have discussed the conversion of InputStream to string. Here we are going to do just reverse
java referer url
java referer url  How to get the referer url in Java? Thanks
Caching UIWebView
Caching UIWebView  Is it possible to save the downloaded file in caching? Actually, in my iPhone application i am trying to load a pdf file... to load. Is it possible to caching the loaded file in UIWebView. And if yes
Caching UIWebView
Caching UIWebView  Is it possible to save the downloaded file in caching? Actually, in my iPhone application i am trying to load a pdf file... to load. Is it possible to caching the loaded file in UIWebView. And if yes
Creating URL in java
Creating URL in java  Hii to all I m trying to create a url using java. Address is http://www.merchant.com/pg/index.html When i m going to run... Url { /** * @param args */ public static void main(String
URL Block - Java Beginners
URL Block  Hello sir, How to block one website using java.for example if we want block "www.orkut.com" site,how to block this site using java... to block a URL like this?please help me.. Thanking you
HTTP URL Address Encoding in Java
HTTP URL Address Encoding in Java  HTTP URL Address Encoding in Java
Hibernate Caching
This tutorial contains description about Hibernate Caching
hibernate caching - Hibernate
hibernate caching  what is caching ?how to work with caching in hibernate ?can u give brief explanitation
Hibernate: Session Caching
In this section we will discuss first type of caching in Hibernate that is Session caching
php page caching
php page caching  Page caching in PHP script required
Application Level Caching
Application Level Caching  How to create application level caching using mbean, without using any orm like hibernate
URL Rewriting in Java
URL Rewriting in Java URL rewriting a session management technique and in this tutorial, you will be informed about URL Rewriting in Java. URL writing is a way, which is used to hide the original URL. It is commonly handle by filter, You
Hibernate: Query Caching
In this part you will learn about Hibernate query caching
Caching HttpServletResponse's content.
Caching HttpServletResponse's content.  I am trying to cache the response using Filter. I have extended HttpResponseWrapper. It has issues with flushing the streams. If you hit the service for the first time, it fetches the data
Example caching - MobileApplications
Example caching  Hi everyone!! I am a student in Viet Nam, I am coding a project J2ME. Before, I had some question in RoseIndia and received your userfull anwsers. Now, I code to caching in j2me, I would like to save results
How to Overcome proxy in Java URL connection
How to Overcome proxy in Java URL connection  Hi, I'm just trying to make java url connection. But it shows some errors due to proxy ..... I would like to read a URL (http://google.com) using java url, i made the url
Saving URL in local disk - Java Beginners
Saving URL in local disk  Hi Friend, How can i Save URL like "www.jagran.com " on local disk throgh java Statement. Thanks ,in advance
java how to get domain name from url
java how to get domain name from url  How to get the domain name from a url string? Example program in java for "how to get domain name from url" Thanks   Hi, You can use the following example code: URL linkURL
Working With File,Java Input,Java Input Output,Java Inputstream,Java io Tutorial,Java io package,Java io example
:\nisha>java CreateFile1 New file "myfile.txt" has been created... CreateFile1.java C:\nisha>java CreateFile1 The specified file
Convert Inputstream to ByteArrayInputStream
Convert Inputstream to ByteArrayInputStream  ... InputStream to ByteArrayInputStream.  To do so first...;{   InputStream inputStream= new FileInputStream ("
Convert InputStream to File
Convert InputStream to File       Here we are showing how to convert an InputStream... InputStream is written into the desired file.  
Convert InputStream to BufferedReader
Convert InputStream to BufferedReader   ... Inputstream to Bufferedreader. The class ...; into InputStreamReader  and finally we convert the InputStream into BufferedReader
Java file from url
Java file from url In this section, you will learn how to convert url to file. Description of code: We have already told you the conversion of file to url... urlstring = "file:///C:/java/examples/data.txt"; URL u = new URL(urlstring
Overview of Networking through JAVA,Convert URI to URL
Convert URI to URL      ... Identifier (URI) reference to uniform resource locator (URL). Here we are give... in the example we make a  URI object and a URL object. After that we pass a URI "
URL in term of Java Network Programming
URL in term of Java Network Programming.... In this section we will provide the complete information about the way of using URL in java... are provide a simple name structure of a URL which addresses the Java Web site
Java file to url
Java file to url In this section, you will learn how to convert file to url... void main(String[] args) throws Exception { File file = new File("C:/Java... easily convert file to url whether there is a simple path or contains special
Java Servlet : URL Rewriting
Java Servlet : URL Rewriting In this tutorial, we will discuss about URL Rewriting. It is one of session tracking technique. URL Rewriting : You can use another way of session tracking that is URL rewriting where your browser does
Overview of Networking through JAVA,How to retrieve URL information
How to retrieve URL information   ... the network information for a given URL. In the given below example we use the URL class and make a object. After creating a object we assign a new URL
URL Encoding and URL Decoding
URL Encoding and URL Decoding  What is URL Encoding and URL Decoding ?   URL encoding is the method of replacing all the spaces and other extra characters into their corresponding Hex Characters and Decoding
URL in term of Java Network Programming
URL in term of Java Network Programming.... In this section we will provide the complete information about the way of using URL in java... are provide a simple name structure of a URL which addresses the Java Web site
Java Servlet : Get URL Example
Java Servlet : Get URL Example In this tutorial, You will learn how to get url... the requested client URL. It returns the current URL which containing protocol... parameters. It returns URL in StringBuffer in place of String so if required you
Java - Opening a URL from an Applet
Java - Opening a URL from an Applet       This is the example of opening a url in same window from an applet. This program shows that how a url is opened in same
Decreasing process time by caching through the Hash Table in Java
Decreasing process time by caching through the Hash Table in Java... by your java program. You can easily improve the process completion time... operation in plain way and completing operation by caching and show the whole
Friendly URl
Friendly URl  creating a SEO friendly URL
Java I/O Examples
an InputStream and OutputStream. Java InputStream is defined for reading... we will discuss all the aspect of Path class of Java. Java IO InputStream Example In this section we will discuss about the InputStream in Java. Java
Java - Opening a url in new window from an applet
Java - Opening a url in new window from an applet       This is the example of opening a url from an applet. This program shows that how a url is opened in a new document or browser
Converting a Filename to a URL
Converting a Filename to a URL     ... if the file exists, first of all we need to convert the file object in URL, for this we use a method toURL(). It returns a URL object and throws
Convert a file name path to url and vice versa in java
String representation of the URL:  This program also converts the Filename Path into URL. It reads a file name and converted into the URL. toURL... path into the URL. This is done by creating the instance of the URL class
URL problem
URL problem  Hi. I have created a webpage for my project website. in that i have used frameset to split the page. Now if i click any link in the page its navigating to the another page. but the problem is here in the url its
hide url
hide url  how i can hide url i have lot of jsp pages when i call one jsp in address another jsp page name also displayed in the address bar? url not visible to endusers please tell me any answer what i should do
Assigning URL
url to my attendancetemplate.jsp file, please help me if anyone knows, am
Java - Opening a url in new window from an applet
Java - Opening a url in new window from an applet  ... in this program to open any url by replacing the value of url. In this example our applet... on the applet, new browser window will open displaying the specified url, in our
How to download a file from URL in Java?
How to download a file from URL? If you are looking for example code in Java... is for you. You will learn how to write code in Java for downloading a file from URL... to write a code in Java which takes file URL, local file name and destination
Need to expand tree by passing Id thr URL. (not by clicking manually) - Java Server Faces Questions
Need to expand tree by passing Id thr URL. (not by clicking manually)  Sub: Need to expand tree by passing Id thr URL. Hi, Here i have... at d url : "http://localhost:8080/richfaces-demo-3.2.1.GA/richfaces/tree.jsf?c
After changing url params d req checkboxes are not showing as clicked in jsf programming - Java Server Faces Questions
After changing url params d req checkboxes are not showing as clicked in jsf... a treenode. just look at d url : "http://localhost:8080/richfaces-demo-3.2.1.GA... passing album Ids and clientId in url browser and receiving in d Library.java.
Advertisements
 

 

 

DMCA.com