?
Solved

Filtering HTML on a Web Server

Posted on 1999-01-18
2
Medium Priority
?
152 Views
Last Modified: 2013-12-25
All requests which reach Web Servers are responded with HTML streams back to the requesting client. Is there a way I can filter ALL the HTML output from the Web Server BEFORE it is sent to the client. This has nothing to do with files with specific extensions which I want to handle differently but with all the HTML output of the Web Server. I want to identify a specific tag which might be in any of the output and DO SOMETHING when I find it...

Thanx....
0
Comment
Question by:ariefishler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 200 total points
ID: 1832312
In short yes maybe. To do it you must write an extension to the Web Server. How you do that depends on the web server.

The basic approach is that when an HTML page is transmitted by the server the server reads the head section of the page and transmits any HTTP messages indicated by HTTP-EQUIV meta tags.

This is known as head parsing and the trick to doing what you want to do is to include some additional parsing that will check the rest of the file.

There is a slight problem with this in that whilst HTML files are parsed most other types are not. So you will also need to include the code to parse any others that you wish to implement this upon and configure the server accordingly.

I don't think doing this is much of a problem with Netscape (I know it isn't because I've done it) and I think it shouldn't be a problem with either Apache or IIS. To do it with Oracle you will probably need to be on version 3 and you will need to dump the listerner an use an alternative HTTP server (if you're not using Oracle this won't make any sense so ignore it).

It is quite a big job and certainly too big for here. I would suggest that you look up the documentation for Apache, NSAPI (for Netscape) or ISAPI (for IIS) as you next step.

Incidentally in all cases you basically will have to write a library (DLL in windows, so on Unix) which is linked into the Server dynamically. Generally such libraries are (and should be ) written in C.

HTH
   Steve
0
 

Author Comment

by:ariefishler
ID: 1832313
Thanks for the answer....this is more or less what I expected but,
Before I accept I just want to clarify some things: I actually need to parse only HTML files (static, dynamic and any other created HTML type) which pass through the Web Server at a specific site.
I think that the part you wrote about "There is a slight problem with this in that whilst HTML files are parsed most other types are not. So you will also need to include the code to parse any others that you wish to implement this upon and configure the server accordingly. " becomes irelevant isn't it?

Can you elaborate on the other part you wrote "The basic approach is that when an HTML page is transmitted by the server the server reads the head section of the page and transmits any HTTP messages indicated by HTTP-EQUIV meta tags". What is the web server doing exactly here. I could not understand it from what you wrote. Do u also mean that I will have to hook the extension at the end of this parsing done by the server?

What I am trying to do is to plant my own tag in the HTMLs and parse it with my own code. This is something like Cold Fusion is doing if you know the product, but I think they have a specific extension for their files, and maybe that is how they map it to their code.

Wouldn't it be just easier to use a CGI at the place I want my special tag and make this CGI do what I want instead of parsing all the HTML. How much will I pay in communication time? (The HTML goes to the browser and then the CGI/Servlet is being called again from the BROWSER. Will it be expensive?)

Thanks....It can sure help :)
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question