Apply Filter to static content

Hi,
I am writing a filter very similar to the one outlined in http://developer.java.sun.com/developer/JDCTechTips/2001/tt0626.html#tip2.
I would like this filter to be applied to all static content on the web server.
I have found a problem that the filter only gets applied to content stored under the context root of the web module that it is defined in.
Does anyone know of a work-around to allow a filter to be applied to content outside of its web-module?
Alternatively does anyone know of a way to store the content which appears at the root of a web module in a location other than its web-module? This is currently unacceptable as the physical path changes every time the module is deployed and graphic designers will expect to be able to upload new content without packaging it in a web-module!
I have considered adding the filter to the /config/web.xml file however I am reliably informed that this will not be applied to any web-modules and will not be able to share session or context state with other servlets and filters in its own web-modeule.
I am using SunOne Application Server 7.
Thanks in advance for any help.

I don't think filters are really the way to go about this, rather, create a servlet that handles requests something along these lines:
void service(HTTPServletRequest request, HTTPServletResponse response) {
  // get document root, base directory for all the xml files
  String docRoot = request.getServletConfig().getParameter("docroot");
  // get the document name
  String path = request.getPathInfo();
  // do some checking on path to make sure it doesn't contain
  // '..' or anything like that, throw an exception if it does.
  // create a java.io.File object representing the file:
  File file = new File(docRoot, path);
  if (/*browser is IE6*/) {
    // open the file (using FileInputStream) and copy it to
    // request.getOutputStream()
  else {
    // pass the file through an xslt transformation that outputs
    // to request.getOutputStream()
}If this servlet is bound to a context called "context1", and the servlet is bound to "xml", requests for eg. /context1/xml/dira/dirb/doc1.xml will result in request.getPathInfo() returning "/dira/dirb/doc1.xml", given that the servlet-mapping element in web.xml is specified correctly (use a wild card: /xml/*).
And be warned, I just typed this in without trying to compile it, so it probably contains bugs!

Similar Messages

  • Using GZIP Compressed Static Content

    I would like to have all of the Static Content (HTML, JS, CSS) compressed in advance to improve performance. I already have a compression filter for use on Dynamic Content.
    We have managed to compress all of the static stuff using the GZIP format. Currently we have the files following the naming convention of appending ".gz" to the end of each file as in "MyPage.html" becomes "MyPage.html.gz" in the WAR file.
    I was expecting that WebLogic would recognize this convention and automatically serve the appropriate file when the request came in. This doesn't seem to be happening:(
    Is there a configuration mechanism to make this work, or a different convention for handling this problem?

    Your idea should work, so let's walk through it:
    1. Create a new Cocoa Application project
    2. Create a new Objective-C class called "AppController"
    3. Place the following code in the header file:
    #import <Cocoa/Cocoa.h>
    @interface AppController : NSObject {
    IBOutlet NSPopUpButton *popupButton;
    @end
    4.Place the following code in the implementation file (beware of curly quotes if you cut and paste):
    #import "AppController.h"
    @implementation AppController
    - (void)awakeFromNib
    [popupButton removeAllItems];// necessary to remove "Item 1", etc
    [popupButton addItemWithTitle:@"Test 1"];
    [popupButton addItemWithTitle:@"Test 2"];
    [popupButton addItemWithTitle:@"Test 3"];
    [popupButton addItemWithTitle:@"Test 4"];
    @end
    4. Save, and open the nib file in Interface Builder
    5. Drag an "Object" blue cube into the little Finder window, click on it, navigate to its Identity panel on the inspector, and set its class to "AppController"
    6. Open the Window, which should be blank, and drag in an instance of "Pop Up Button"
    7. To make the menu items from the AppController class appear in the popup menu, do the following:
    Control-click on the AppController object and drag a blue line up to the Pop Up Button in the Window.
    8. Save, build, and run.
    That should be enough to at least get the menu items to appear in the popup menu.

  • Few values of report column do not display in report while applying filter

    Post Author: anuragg11
    CA Forum: WebIntelligence Reporting
    There are 6 drill filters applied on the report to filter out the report column data. Few values of the report are not displaying in the report when using drill filter. Same issue is with report filter too. If filters are removed then values are appearing in the report. We are using version BO XI R2 & Java runtime JRE 1.4v. It doesn't look issue is with Java version because only few specific data of the report column are not shown in the report when using filter on the data. Example: One of Report data column contains below values: 24.2, 26.9, 120.1, 230, 274.9, 275.8, 333.2 Report is displaying all these values when there is no filter on any data. But report doesn't display data when applying filter on 274.9 or 120.1 howver filter on other values 24.2, 26.9, 230, 275.8, 333.2 are working fine.

    Hello,
    I think i know what your problem is.
    Although in table view your 2 requests combine perfectly and show separate results in pivot view BI unfortunaterly adds them up.
    One work around would be to go in your criteria add in each request a dummy column. This can be obtained the following way:
    1. click on a column to add it in the criteria (it doesnt matter which one)
    2. go into the edit formula of that column
    3. delete the formula and in its place write 'Dummy Column 1'
    Do the same for the second request by adding a "Dummy Column 2'
    Now the Pivot Table should also show up correctly
    Let me know if it goes well or if you have any further questions,
    Kostis

  • Selecting a column in Answers report based on user prompt/ apply filter

    I need to do the following in OBIEE Answers report (version 10.1.3.4.1):
    1) Think of a simple table with dim TX_type and some measures like month_jan, month_feb, month_mar
    so the fact table looks like (column names) tx_type, month_jan, month_feb, month_mar
    2) I need to select the measure column based on a user dashboard prompt, prompt populates a presentation variable var_month = jan or feb or mar
    3) I need to select the correct measure (one of these month_jan, month_feb, month_mar) and then apply column filter based on the dim TX_type to split the values of these into multiple columns for report. So the report may look like (in Answers)
    Sales , Tax, overheads
    where Sales may be defined as sum(month_jan) where rows have TX_type = 'sales'
    where Tax may be defined as sum(month_feb) where rows have TX_type = 'tax'
    where overheads may be defined as sum(month_mar) where rows have TX_type = 'overheads'
    IF the user selects jan
    IF user selects Feb then the 3 report columns are based on month_feb and likewise for month_mar
    I cannot use column selector option as the report column further apply filter in column filter definitions in Answers...
    4) When I try to build the column filter using a presentation variable (var_month), the presentation variable is not getting populated in the column filter.
    For e.g. IF var_month = 'jan'
    THEN month_jan (let us assume the logical column name is month_jan too)
    ELSE month_feb and so on...
    However, the var_month always shows 0 in the IF clause. If we used a repository variable instead, it works fine. But since repostory variable cannot be changed on the fly (by user prompt) it is not usable.
    We cannot change fact table defintion....and we have 12 measures column and about 8-10 different colum filter based report columns using this measure.

    Hi shyamvaran,
    have you thought about a SQL statement in the prompt, something like:
    SELECT
    case when 1=0 then Table."Column" else 'Jan' end
    FROM "Subject Area"
    union
    SELECT
    case when 1=0 then Table."Column" else 'Feb' end
    FROM "Subject Area"
    union
    SELECT
    case when 1=0 then Table."Column" else 'Mar' end
    FROM "Subject Area"
    union
    SELECT
    case when 1=0 then Table."Column" else 'Apr' end
    FROM "Subject Area"
    etc...
    Use this to give you the 12 values for your months then give the prompt column a presentation variable name and set a default value in the 'Default To'. Also set the same default value for the filter.
    A couple of points:
    1. If you're transforming the presentation variable from 'Jan' to 'month_jan' you may need to edit the syntax for the filter column (not using the dialog box).
    2. If you're transforming the behaviour of a dimension / measure column in the report, have you specified the syntax correctly, e.g. sum('@{pres_var}')?
    Hope this helps,
    Justin

  • How to capture the values after applying filter in ALV.

    Hi,
    I have an ALV in my application with 10 projects displayed. Out of those 10 projects, 5 projects have banking as industry.
    when you filter the ALV based on industry banking I get 5 projects .In run time  how  can  I capture only these 5 projects. when I debugged and saw the ALV table node is holding 10 prj not 5 prj.
    How can  read only those 5 values. Kindly help me out with sample code.
    Thanks,
    Priya

    Hi,
    The class name is correct - CL_SALV_WD_FIELD. When you refer the model object(CL_SALV_WD_CONFIG_TABLE-IF_SALV_WD_FIELD_SETTINGS) this will return the field for which
    you have applied filter by passing the field name.
    Before you try out this approach, check the ALV event ON_CELL_ACTION fro that column name to capture the filtering value. Based on this loop at the table where field eq <<filerting value>> and get the filtered records.
    As you have get_static_attributes_table it deosnot return the filtered values.
    Regards,
    Lekha.

  • Anonymous vs session-based static content

    I am running the 7.0 Portal and I am running into a problem where all my static content is being served from within a session context, or not anonymously. This is causing MAJOR performance hits. Eventually, when this app hits production, all static content will be served off of an Apache box, but is there not a setting somehwere that will allow the BEA web server to serve this content anonymously?
    Thanks,
    Justin

    A recent blog on this subject: http://www.extended-content.com/logged-out-of-ucmwebcenter-content-after-opening-an-adf-page/

  • PSE 10 crashes when applying filter

    Steps to reproduce
    1. Load image (In my case .NEF file)
    2. Select Smart Brush (either one)
    3. In the options bar, select    Show All > Florescent Chalk
    4. Apply filter. Elements starts creating multiple layers and than crashes.
    Can reproduce this every time and so far only with the Florescent Chalk filter. (Crashes with Raw and jpg)
    Windows 7 64 bit, 8GB mem, GeForce GTX 275 video

    The action Florescent Chalk should still show up for the Smart Brush Tool under show all.
    I had to start pse 10 up a second time before it would show (that's without rebuilding the media data base file)
    I think the updated action was just to address the crash with the smart brush tool and it would probably take a major rewrite of the action
    to enable it to work with a selected part of a layer and with the smart brush tool at the same time (the two effects use the same action), as
    most of those image effect actions are quite old and some haven't been changed much since photoshop 4 (the first photoshop version with actions around 1996/97).
    You should be able to make a selection on the layer, new layer via copy, then run the action from the effects panel for a similar result as just making a selection on a layer.
    MTSTUNER

  • Post subject: cannot apply filter to the report element

    Hi All,
    I have a report that has checkbox Input Controls. when the user is viewing the report and try to manuplate the input controls its throwing an error saying
    cannot apply filter to the report element: DP0.DO1e5
    I tried to do the same with an admin account still its showing the same error but when when I edit the report its not throwing the error. The problem is with the View mode
    Thanks
    -K

    Not sure why this is but deleting the input controls in the edit mode and re-applying works sometimes.
    Thanks,
    Karthik

  • Use of fonts embedded in photoshop for commerical use? (Static content, like images)

    Hello.
    I am developing a Mobile game for Android, and I can't stop thinking about if i am in the clear when it comes to the use of fonts. I've searched the web, but can't really find a clear answer.
    I am using only font embedded in photoshop/illustrator, and only displaying them in static content, such as Images/logos. So my question is, am I in the clear, or do I need som kind for special license for this?
    FYI I am mostly using the MonoType Impact font. I stumbled over this though, its Monotypes Imaging EULA for fonts ( I think). It says :
    You may embed static graphic images into an electronic document, including a Commercial Product, (for example, a "gif") with a representation of a typeface and typographic design or ornament created with the Font Software as long as such images are not used as a replacement for Font Software, i.e. as long as the representations do not correspond to individual glyphs of the Font Software and may not be individually addressed by the document to render such designs and ornaments.
    Would appreciate any help, thanks!

    you can access them from <bpelx:exec> activity and you can pass these returned document to underlying java class.
    Re: getVariableData in Java Exec

  • I work in a public library and we have two ipod touch and two ipod nanos we would like to circulate for our patrons. Any advice on how we can do this? Should we allow patrons to set the device up for personal use or download static content?

    I work in a public library and we have two ipod touch and two ipod nanos we would like to circulate for our patrons. Any advice on how we can do this? Should we allow patrons to set the device up for personal use or download static content?

    With the Nanos, you should have no problem lending them loaded with audiobooks from Librivox, etc.
    As for the iPod Touches, I'm not sure the question is whether you should allow patrons to set up the device for personal accounts, but whether you can prevent them from doing so. Prepare to to a factory restore every time one is returned.

  • Wls 9.1 doesn't pick up changes to static content in production mode

    Hi Everybody,
              I'm running wls 9.1 on XP in production mode as a stand-alone server. My web app is deployed in exploded format in an external directory.
              I'm trying to force the server to pick up the changes to static content like JSPs automatically and it's not working.
              1. I've set pageCheckSeconds = 1 in weblogic.xml and even though server picks this setting up it does nothing about it.
              2. I tried weblogic.Deployer utitlity to redeploy just one jsp file and it's not working because it's unable to get the full path to a source file. Can this happen due to application Context Path not being set properly?
              Does anybody come across issues like this?
              Thanks.
              Paul.

    Hi Everybody,
              I'm running wls 9.1 on XP in production mode as a stand-alone server. My web app is deployed in exploded format in an external directory.
              I'm trying to force the server to pick up the changes to static content like JSPs automatically and it's not working.
              1. I've set pageCheckSeconds = 1 in weblogic.xml and even though server picks this setting up it does nothing about it.
              2. I tried weblogic.Deployer utitlity to redeploy just one jsp file and it's not working because it's unable to get the full path to a source file. Can this happen due to application Context Path not being set properly?
              Does anybody come across issues like this?
              Thanks.
              Paul.

  • Applying filter in combined requests

    Hi all,
    In obiee 11g how can i apply filter when combining similar requests. I need to filter data from both the requests.
    Thanks in advance

    Use presentation variable while creating page/dashboard prompt and filter both the requests based on it.

  • Static content in iAS 6.5 (for JavaWebstart)

    Hello,
    I'm using iAS 6.5.
    I want to serve a jar file for JavaWebstart in a J2EE App (including a war file)
    That works, but it tooks a very long time before Webstart is loading this Jar and it is fully reloaded every time i access that App from Webstart.
    When I put this jar file into the iPlanet Webserver it is loaded much faster and will not be reloaded every time i access this jar file with Webstart.
    1. Is it possible to serve static content in iAS that Webstart is not fully reloading every time, instead of only checking the header informations for a newer version?
    2. Can you give me a link to an iPlanet documentation about how to handle static content iAS/iWS !
    3. Will be the iPlanet Webserver Settings (e.g. KeepAlive) ignored, when i run Webcontent from the Applicationserver (../NASApp/...)?
    Kinds
    Regards

    JAX-RPC, JAX-M and other JAX-x are tested with JDK 1.3.x and higher. Since iAS 6.5 uses jdk 1.3.1, I think JAX-RPC, JAX-M can be used in iAS 6.5. -Officially, as far as I know, iAS 6.5 does not provide any support for JAX-pack.
    Sun ONE AS 7 fully supports JAX-pack, and it has a tool, XRPCC, (now wscompile and wsdeploy) which generates stubs, ties and WSDLs for the services. Also the same tool can be used to generate the stubs, client side artifacts, from any WSDL file.
    And also JAX-run time provides SOAP 1.1, UDDI v2 Registry access and WSDL support. Interoparability between JAX-Run time and other SOAP 1.1 implementations is also tested successfully.
    There are several third partly tools available from different vendors (around 10-12), you may wish to search for them in google. And with that you may generate WSDL for your Apache SOAP services.
    If you are planning to have a standalone web services client, then you can directly use JWSDP at the client side to communicate with the Apache SOAP services on the iPlanet Application Server 6.5.
    Please get back for any further assistance.

  • DefaultServlet bug? forwarding to static content under WEB-INF

    I've encountered what seems to be a bug in the DefaultServlet in WebServer 7.0u2, when trying to do a requestDispatch->forward to static content (e.g., a .png file) under WEB-INF. In general, I can forward into content under WEB-INF, and my servlet works fine when forwarding to dynamic content under WEB-INF (e.g., a .jsp file), but when I try to forward to static content, a 404 error is sent. The same servlet also works fine if I put the static content outside of WEB-INF. In summary:
    forwarding to /WEB-INF/foo.png responds with error 404 (even though the content exists)
    forwarding to /WEB-INF/foo.jsp works fine
    forwarding to /other-dir/foo.png works fine
    I'm baffled as to why I can't forward to static content under WEB-INF. I have a very simple web.xml file, and no suffix-based mappings, so the only servlet that should be responding to the forward is the servlet container's DefaultServlet. Is there some bug in DefaultServlet? Am I misunderstanding something?

    pl. upgrade to latest update (web server 7 u5 as of now) and see if your problem is still reproduced.

  • Caching static content in ADF

    Helllo ,
    I'm using Jdeveloper 10g ,
    I hope If any one can help me in caching static content in my page " Images and CSS and JS libraries "
    I use The AFC library and the page cach the static content for the same window , but if I open new window the page will load the static content another time is that " browser caching "
    I want to cache this content in the client PC not in page Scope only .
    and If I have miss understanding for caching concept I will be owe to you if you give me the correct concept
    rgds

    Hi,
    the AFC provides server side caching in that the dynamic parts are not re-build if not required. On the client side its the browser that usually takes care of the content caching
    Frank

Maybe you are looking for

  • Linking to specific text

    Hi All! I would like to link to specific text within a PDF document. I can link to pages, but I can't link to specific text within a page.  Is there any way to do this? I'm on Mac OS 10.5.8 using Acrobat 9.4.0 ... Thank you so much!! Diane

  • File Dialog Box in the applet

    Hi... I am trying to make an JAVA applet in which i am trying to read the File through JFileChooser, so for that we need a dialog box to show up...right... when i run that applet from the JCreator environment, it does shows me that dialog box when i

  • Suddenly VERY slow and slow to charge

    I have a powerbook G4 I bought just 3 years ago this past December. I mostly just use Safari, and Microsoft Office on it--nothing fancy. The kids hook up their ipods to it for iTunes. I am running 10.4.11, it has a 1.67 GHz G4 processor, 1GB DDR2 SDR

  • IPod Touch 5 and Windows 8.1 error?

    I recently got a new computer three days ago with Windows 8.1.  I have an iPod Touch 5 with iOS 7.1.1 that is up to date, and when I try syncing it on my new computer I get this error message:  The iPod cannot be synced.  An unknown error occurred. 

  • Audio output in Mono after upgrading to Cap 4

    Hi everyone, I really hope someone can help me. I just upgraded from 3 to 4 and suddenly all new audio that I record plays in mono rather than in stereo as with my older audio files. The strange thing is that audio recorded in Ver 3 plays correctly a