Caching web application responses using Coherence in a servlet filter?

I'm working on a RESTful Java web application that is stateless, and provides results via JSON.   What I would like to do is have Coherence create a cache based on the request URL as the key, where it caches the JSON response.
A competing product, EHCache (http://ehcache.org/documentation/recipes/pagecaching ) has such a feature.  Basically, you just add this filter in the web.xml, specify a URL pattern, and no other code changes are required.
Has anyone tried to develop something similar?    OnJava.com has an article on how to implement this where it writes the response out to disk for caching ( http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=3 ) but I was wondering if someone has tried this with Coherence? 
Thanks!

I'm working on a RESTful Java web application that is stateless, and provides results via JSON.   What I would like to do is have Coherence create a cache based on the request URL as the key, where it caches the JSON response.
A competing product, EHCache (http://ehcache.org/documentation/recipes/pagecaching ) has such a feature.  Basically, you just add this filter in the web.xml, specify a URL pattern, and no other code changes are required.
Has anyone tried to develop something similar?    OnJava.com has an article on how to implement this where it writes the response out to disk for caching ( http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=3 ) but I was wondering if someone has tried this with Coherence? 
Thanks!

Similar Messages

  • How to get web application to use Tuscany without conflicting with SAP SDO

    Hi,
    We are attempting to run a web application on SAP NetWeaver CE 7.1 SP1 which uses Tuscany SDO.  As it now stands We must use Tuscany because the web application will not run with the SAP SDO implementation provided by Netweaver. To ensure that Tuscany is loaded with priority, we have packaged the Tuscany JAR files and their dependencies as a heavy resource, as described here:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60642a88-95fe-2b10-d387-a245d48fc257?overridelayout=true
    The final check showed that Tuscany was correctly deployed as a heavy resource and included the following JAR files:
    common-2.2.3.jar
    ecore-2.2.3.jar
    ecore-change-2.2.3.jar
    ecore-xmi-2.2.3.jar
    tuscany-sdo-impl-1.1.1.jar
    tuscany-sdo-lib-1.1.1.jar
    tuscany-sdo-tools-1.1.1.jar
    xsd-2.2.3.jar
    We also verified that the web application using Tuscany has a hard reference to the Tuscany heavy resource.
    However, when we try to run the web application, the following error is logged:  java.lang.LinkageError: Class commonj/sdo/DataGraph violates loader constraints
    The issue is definitely due to some kind of classloading conflict with the SAP SDO library, as the application runs normally when SAP SDO is manually removed from the classpath. Doing this on a production system is unfortunately not an option, though.
    So the question is: how to get web application to use Tuscany without conflicting with SAP SDO?

    I took a look at the "printerReady" example.  Looks like I may be able to use the InetPing (...) function to ping through a range of IP addresses looking for a response.
    Any ideas on how to find the MAC address associated with the IP addresses that respond?
    We may have multiple units responding and the MAC address will allow the operator to determing which unit to connect to.
    I'll try the InetPing to see how it works,
    Kirk

  • Exception when trying to run an Web Application that uses a Web service

    Hello All,
    I get an exception when trying to run an Web Application that uses a Web service. The web application is a WebDynpro Application.(an application similar to the one "Using an Email Web Service in Web Dynpro" in the tutorial section of Web Dynpro but using a different web service)
    The exception is
    <b>Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (404) Not Found.</b>
    Could anyone give me an idea on what might be the problem ?
    Regards,
    Loveline.

    Hello,
    Like you said it was the problem with url.
    The webservice I used is actually running on the local machine (where the NetWeaver developer studio is installed); so in the url I had specified localhost. But I deployed the application on another server(SAP J2EE Engine). That is why it didn't work. On changing the url as required, the application is working fine.
    Thanks !
    Regards,
    Loveline.

  • How i can make web application by using oracle form6i

    how i can make web application by using oracle form 6i , indetail .
    A.R

    indetail .As Andy Millman might observe, you're having a laugh. This is a big topic, far exceeding what it is reasonable to expect people to help out with in a Forum. Do you not have the 6i documentation?
    OTN has a site for upgarding to web forms. Although it is mainly focussed on moving to 9i/10g a lot of the issues and solutions apply to moving a 6i client/server app to web deployment. For further help there is a Forms.
    Cheers, APC

  • List of .jar file need to add in web application by using eclipse europa?

    hi
    what are the list of .jar file need to be added in web application which use the ide of Eclipse Europa?

    Depends on the application requirements. For a basic JSP/Servlet application just integrate Tomcat in Eclipse and assign it as application server to your web project, then you don't need to add anything. If you for example need JSF, then you should add its JAR's to the classpath of the web project, which is by default /WEB-INF/lib.

  • Memory Leak in web application created using j2ee

    Hi,
    Our company has one web application, provided by "X" vendor. this application has many JSPs and many TLDs used. The basic behaviour of the apoplication is to connect to the database (Oracle) get the information and show it to the user.
    We deployed this web application in Tomcat 5.0.25 in the windows environment. One thing we observed here is, when we login to the application the tomcat5.exe process increses its memory. and when we logout, it does not come down to the original position. similar things happen when we search for some of the data using there provided searches.
    We have some code developed which uses httpclient to login to this web application (created for performace testing). This code initially logs in 50 users which goes fine, then logs in 100 users which also goes fine but after this 100 users we ran the code for 50 users agian but this time it threw OutOfmemory exception:Java heap space error.
    we are observing the memory in the Task Manager in windows.
    Can anyone tell me what could be the cause of this? is it the web application causing problem or is tomcat caching some pages into the memory and is not releasing them?

    Hi,
    Few questions!
    1> Have you tweaked your jvm?
    2> What are the values given for Xms and Xmx?
    3> What is the size of XX:MaxPermGen?
    4> How much RAM is available on the system where you have deployed your app?
    5> Are you using pre-complied JSPs for faster response?
    6> Which JDK are you using?
    7> Have you tried using latest version of Tomcat?
    8> If these doesnt help, use any profiler to find the leak. <JProfiler, JVMTI, YourKit profiler etc>
    I hope answering these questions would help you :)
    njoy!

  • What is the correct way to set a web application to use HTTP or HTTPS?

    In the past I've always created an HTTP web application as the default zone. Then extended the web app, creating a new IIS website on port 443 and enabled SSL. This seems to have worked fine, but I recently read an article stating that it is not good to
    extend a web app unless absolutely necessary. So can someone tell me what the proper way is to configure a single web application to work with HTTP and HTTPS?

    Extending the web application to support both HTTP and HTTPS is a perfectly good method and in fact is the only way to have a web application support both so what you've done is fine.
    If the web application will only use HTTPS, you can set this up when you first create the web application. Specify port 443 and the SSL option (and ensure the URL has an https://) when creating the web application. You'll need to install the certificate
    in IIS once the web application has been created.
    Jason Warren
    Infrastructure Architect
    Habanero Consulting Group
    habaneroconsulting.com/blog

  • Upgrading BOE XI R2 Java Web Applications to use BOE XI 3.1

    Hello,
    Does anyone know where I can get documentation about how to update Java Web Applications using BOE XI R2 to BOE XI 3.1? I search the documentation online and I couldn't find any.
    I believe that it should be a matter of just updating the Java Archve (JAR) files and the helper files in the 'crystalreportviewers' folder. There should not be any changes to how I use the Enterprise SDK, RAS and Viewers SDK. If there are any, there should be very few. I just want to make sure of this.
    Thanks,
    R.C.

    Hi,
    Upgrading the Jar files and viewers directory ( crystalreportviewers12) should be sufficient. Please refer to 3.1 Java developer guide for ,pre information.
    Thanks
    Aasavari

  • Unable to deploy the web application that uses a ejb3.0

    Hi,
    I have created a adf application with Model and a ViewController.
    Locally from jdeveloper I am able to run the application successfully by right clicking the web page and click on Run.
    However, when I try to deploy this application that contains both Model and ViewController, I am getting an error:
    [04:41:52 PM] Weblogic Server Exception: weblogic.application.ModuleException: Could not setup environment
    [04:41:52 PM] Caused by: weblogic.deployment.EnvironmentException: [J2EE:160167]The module QC-ViewController-context-root in application QC_application1 uses ejb-links but no EJB modules were found for this application.
    [04:41:52 PM] See server logs or server console for more details.
    [04:41:52 PM] weblogic.application.ModuleException: Could not setup environment
    [04:41:52 PM] #### Deployment incomplete. ####
    [04:41:52 PM] Remote deployment failed
    Any help on this issue is appreciated.
    Thanks
    Saikrishna

    Hi Saikrishna,
    I had the same problem. My fix was to create a new Deployment Profile (EJB JAR file) in my Model (the default is an "ADF Library JAR file") and have my ViewController depend on that.
    Also, make sure your ejb references in web.xml have the ejb-link attribute:
    <ejb-local-ref>
    <ejb-ref-name>AuditSessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>com.incomemax.ejb.session.AuditSessionEJBLocal</local>
    <ejb-link>AuditSessionEJB</ejb-link> <---- this entry
    </ejb-local-ref>
    Hope that helps,
    Chris

  • Web Application Designer uses wrong server name

    Hello,
    I am using BI under NW04s.
    When I execute a web template in Web Application Designer it opens up the url with the server name without it's FQDN name and than I get: "URL used, <URL>, is invalid; distributed session management (DSM) cannot function. See SAP Notes 596698 and 654326.
    I've looked at these notes but I don't see how it can solve my problem.
    I've already followed the suggestions in <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=279031">this</a> thread including checking RZ10 and RSPOR_T_PORTAL table.
    Any other ideas...?
    Roy

    Hi,
    try maintaining parameter <b>icm/host_name_full</b> in SMCIM (goto/parameters/change).
    hope this helps...
    Olivier.

  • Web Application by using Tomcat

    I want to create my own application by using servlet, jsp, tomcat.
    I want to create my own context and in the last I want to deploy by using the tomcat.
    I do not want to use the EJB.
    I do not want to use any IDE also.
    I also want to use the war files.
    Please help me how can I start, what are the necessary steps I have to do.

    Hi,
    There is the official J2EE Tutorial for technologies such as Servlets and JSPs. You can download it from Sun.
    If you have already downloaded Apache Tomcat, you can find many web applications examples in its directory.
    You can find lots of information here:
    http://www.coreservlets.com/
    And yes, Google...
    Akos.

  • Tutorial: Build a Web Application (JSF) Using JPA

    Hi,
    I am trying the subject tutorial at
    [http://www.oracle.com/technology/products/ias/toplink/jpa/tutorials/jsf-jpa-tutorial.html#CHDIIEHA]
    and it seems I have to install OC4J and TopLink JPA.
    I will appreciate if anyone explain me if it is necesary, and in case of it
    witch is the reasson.
    I have some configured enviroments to develop JEE 5. I am talking about Eclipse Galileo against JBoss
    and NetBeans 6.7.1 aginst glassfish v2ur2
    Thanking in advance,
    Jose

    You might want to ask your question in a JDeveloper/ADF forum. With JSF/JPA, the only reason for XE is to provide a JDBC Data Source, so this product is hardly used.
    Once you move to JSF, you are switching to a 3-tier (or n-tier) software model, and the middle of the tiers is OC4J. So you need to get that. And TopLink provides the connection to the database.

  • Using JavaFx in Web application

    I want to use JavaFx in Web Application which consists of JSP or Servlet. How can I use it ?

    CRatan, this is a very obscure (but valid) question.
    Where does JavaFX fit into Web Applications?????
    Well, normally you use a html 'view' that is generated from jsp. Depending on how you use servlets (and lets face it a servlet can provide almost anything you can dream of providing the request/response is delivered over http(s)) you might typically be providing service to that html page derive's it's content from. JavaFX is a 'view' that is not html. It sure can use http request and fetch data from a servlet and provide a UI outside the browser container (you can lanch it... applet, mobile, or desktop).
    In the coming days/months/years I would expect to see http request/session EE JavaFX client side support be introduced or documented more so than what it is now (so that JavaFX client applications can maintain stateful https sessions between itself and server) much like a browser does. There is DEFINITELY java support for this already (see HTTPClient) but this is something you need to learn yourself. You could also step outside the square by NOT using http (but firewalls do often suck).
    I hoped I helped - I try but I don't charge.

  • How to configure ADF application to use OAM Identity Assertion ? web.xml

    We have a web application developed using ADF (application development framework) and deployed on WebCenter 11.1.1.2 (weblogic 10.3.2)
    OID Authentication and OAM identity assertion is configured in WebLogic 10.3.2 .
    How to configure security in ADF application (web.xml or weblogic.xml) so that it uses OAM identity assertion (already configured as authentication providers in weblogic server)
    Any pointers or documentation so that application (developed using ADF) check for identity tocken and verifies it with one of identity assertion providers.

    John,
    I have to concur. With OAM you don't need this. OAM intercepts the calls and inserts a cookie for WLS to get user information from.
    I strongly advise to go through the above mention OFM Security Guide. Esp. Chapter 10 tells you in every detail how to implement OAM SSO with WLS (with or without OHS as a proxy).
    Reading this chapter saves you time and turnarounds on this topic...
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to find out how many concurrent users using web application?

    Hi all,
    I have a web application deployed using 9iAS. I am trying to find out how to find out how many concurrent users are using this application at any one time. According to Oracle there is no way to see this information using the enterprise manager interface.
    Does anybody out there know how I can find out this information in real time? Failing that, are there any good analysis tools out there that display usage to the minute (all the tools I have found show usage by hour which is not sufficent for my needs).
    Any help would be much appreciated,
    Caroline

    I know I haven't heard of any software to do this, but this also sounds like a really hard problem to try and really analyze well.
    The trick is, you might "infer" how long a user is using an application based on when cookies are set and when they're set to expire. If that's a long time, though, that could count far more "concurrent" users than are actually there. A user could simply close the application at any time and stop using the application; you can't really detect that because the server isn't "told" when the user closes their browser or goes somewhere else.
    A good perl script might be able to read the Apache access log and tell you how many unique IPs asked for a given directory in which various applications are stored in any 5 minute span of time... that could be something like an indicator of "concurrent" users.
    If you don't know Perl, I'd suggest getting the O'Reilly & Associates book on Perl and learning it, because the more I think about this, the more this sounds like a textbook example for applying a Perl script.

Maybe you are looking for