servlets generating for .html .xml requests

Is there a way to map addresses from html, xml, css and other path extensions to servlets? I want to find a way to have a server hide the dynamic sources of its html, xml, and other content.

I started implementing a server to do this but developing it is a lot of work. I set up a path mapping scheme which simply maps from for example page1.html to page1.jsp. If Tomcat can do this, it would be a huge help.

Comments

  • : Is there a way to map addresses from html, xml, css and other path
    : extensions to servlets? I want to find a way to have a server hide
    : the dynamic sources of its html, xml, and other content.
    :
    : I started implementing a server to do this but developing it is a
    : lot of work. I set up a path mapping scheme which simply maps from
    : for example page1.html to page1.jsp. If Tomcat can do this, it
    : would be a huge help.

    Use AddHandler to link the servlet handler to the various extensions. For example (using isapi):
    [code]
    AddHandler isapi-handler .htm
    [/code]
    This will cause the apache to see all .htm files as isapi libraries.
    If you want a specific servlet for each content, then you can configure it like this:
    [code]
    Action ehtml-handler "/cgi-bin/htmlbuilder.dll"
    AddHandler ehtml-handler .htm

    Action exml-handler "/cgi-bin/xmlbuilder.dll"
    AddHandler exml-handler .xml

    Action ejpg-handler "/cgi-bin/jpgbuilder.dll"
    AddHandler ejpg-handler .jpg
    [/code]
    This is again based on isapi libraries, because I'm using this myself. I think tomcat can handle similar settings.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion