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 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 ..

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
Read/Convert an inputStream to a String
Read/Convert an inputStream to a String  Hi, I have an input stream in Java and convert it to a String. what is the best code for for this? How to Read/Convert an inputStream to a String? My object is of java.io.InputStream
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 4.0.0 is released. Learn to use caching version 4.0.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 4.0.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 4.0.0 java library... 4.0.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 4.1.0 is released. Learn to use caching version 4.1.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 4.1.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 4.1.0 java library... 4.1.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.66.0 is released. Learn to use caching version 3.66.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.66.0 ) in their Java project if it is based... - caching version 3.66.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.66.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 4.2.0 is released. Learn to use caching version 4.2.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 4.2.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 4.2.0 java library... 4.2.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.77.0 is released. Learn to use caching version 3.77.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.77.0 ) in their Java project if it is based... - caching version 3.77.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.77.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.76.0 is released. Learn to use caching version 3.76.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.76.0 ) in their Java project if it is based... - caching version 3.76.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.76.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 4.3.0 is released. Learn to use caching version 4.3.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 4.3.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 4.3.0 java library... 4.3.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 4.3.0 is released. Learn to use caching version 4.3.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 4.3.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 4.3.0 java library... 4.3.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.67.0 is released. Learn to use caching version 3.67.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.67.0 ) in their Java project if it is based... - caching version 3.67.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.67.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.2.0 is released. Learn to use caching version 3.2.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.2.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.2.0 java library... 3.2.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.65.0 is released. Learn to use caching version 3.65.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.65.0 ) in their Java project if it is based... - caching version 3.65.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.65.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.64.0 is released. Learn to use caching version 3.64.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.64.0 ) in their Java project if it is based... - caching version 3.64.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.64.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.63.0 is released. Learn to use caching version 3.63.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.63.0 ) in their Java project if it is based... - caching version 3.63.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.63.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 4.4.0 is released. Learn to use caching version 4.4.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 4.4.0 ) in their Java project if it is based on Maven... and includes  com.sap.cloud.sdk.cloudplatform - caching version 4.4.0 java library... 4.4.0 of caching released The developers of  
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.78.0 is released. Learn to use caching version 3.78.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.78.0 ) in their Java project if it is based... - caching version 3.78.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.78.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.62.0 is released. Learn to use caching version 3.62.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.62.0 ) in their Java project if it is based... - caching version 3.62.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.62.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.61.0 is released. Learn to use caching version 3.61.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.61.0 ) in their Java project if it is based... - caching version 3.61.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.61.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.60.0 is released. Learn to use caching version 3.60.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.60.0 ) in their Java project if it is based... - caching version 3.60.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.60.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.59.0 is released. Learn to use caching version 3.59.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.59.0 ) in their Java project if it is based... - caching version 3.59.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.59.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.58.0 is released. Learn to use caching version 3.58.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.58.0 ) in their Java project if it is based... - caching version 3.58.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.58.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.57.0 is released. Learn to use caching version 3.57.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.57.0 ) in their Java project if it is based... - caching version 3.57.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.57.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.56.0 is released. Learn to use caching version 3.56.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.56.0 ) in their Java project if it is based... - caching version 3.56.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.56.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.55.1 is released. Learn to use caching version 3.55.1 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.55.1 ) in their Java project if it is based... - caching version 3.55.1 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.55.1 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.54.0 is released. Learn to use caching version 3.54.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.54.0 ) in their Java project if it is based... - caching version 3.54.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.54.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.53.0 is released. Learn to use caching version 3.53.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.53.0 ) in their Java project if it is based... - caching version 3.53.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.53.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.52.0 is released. Learn to use caching version 3.52.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.52.0 ) in their Java project if it is based... - caching version 3.52.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.52.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.51.0 is released. Learn to use caching version 3.51.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.51.0 ) in their Java project if it is based... - caching version 3.51.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.51.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.50.0 is released. Learn to use caching version 3.50.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.50.0 ) in their Java project if it is based... - caching version 3.50.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.50.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.49.0 is released. Learn to use caching version 3.49.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.49.0 ) in their Java project if it is based... - caching version 3.49.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.49.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.48.0 is released. Learn to use caching version 3.48.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.48.0 ) in their Java project if it is based... - caching version 3.48.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.48.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.47.0 is released. Learn to use caching version 3.47.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.47.0 ) in their Java project if it is based... - caching version 3.47.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.47.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.46.0 is released. Learn to use caching version 3.46.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.46.0 ) in their Java project if it is based... - caching version 3.46.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.46.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.45.0 is released. Learn to use caching version 3.45.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.45.0 ) in their Java project if it is based... - caching version 3.45.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.45.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.44.1 is released. Learn to use caching version 3.44.1 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.44.1 ) in their Java project if it is based... - caching version 3.44.1 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.44.1 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.43.0 is released. Learn to use caching version 3.43.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.43.0 ) in their Java project if it is based... - caching version 3.43.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.43.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.42.0 is released. Learn to use caching version 3.42.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.42.0 ) in their Java project if it is based... - caching version 3.42.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.42.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.41.0 is released. Learn to use caching version 3.41.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.41.0 ) in their Java project if it is based... - caching version 3.41.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.41.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.40.0 is released. Learn to use caching version 3.40.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.40.0 ) in their Java project if it is based... - caching version 3.40.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.40.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.39.0 is released. Learn to use caching version 3.39.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.39.0 ) in their Java project if it is based... - caching version 3.39.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.39.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.38.0 is released. Learn to use caching version 3.38.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.38.0 ) in their Java project if it is based... - caching version 3.38.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.38.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.37.0 is released. Learn to use caching version 3.37.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.37.0 ) in their Java project if it is based... - caching version 3.37.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.37.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.36.0 is released. Learn to use caching version 3.36.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.36.0 ) in their Java project if it is based... - caching version 3.36.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.36.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.74.0 is released. Learn to use caching version 3.74.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.74.0 ) in their Java project if it is based... - caching version 3.74.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.74.0 java
Maven dependency for com.sap.cloud.sdk.cloudplatform - caching version 3.75.0 is released. Learn to use caching version 3.75.0 in Maven based Java projects
( com.sap.cloud.sdk.cloudplatform - caching version 3.75.0 ) in their Java project if it is based... - caching version 3.75.0 in Java projects. Follow the step by step tutorial for using... and includes  com.sap.cloud.sdk.cloudplatform - caching version 3.75.0 java

Ads