Solved

Filtering HTML on a Web Server

Posted on 1999-01-18
2
137 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
2 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now