I'm not sure I get the problem. One interpretation is you have something (a static page, CGI / hander generated output) that contains a link to a URL which is in turn handled by a Java servlet ... somewhere else. In which case, a link to the URL handled by that servlet should be sufficient. Another interpretation is that you have the code for a Java servlet that you'd like to be able to execute when someone accesses a specific URL on your site.

Apache httpd can't do this on its own. Java servlets must run inside a servlet container, such as Tomcat. Now, what you can do is set up a servlet container, and set Apache httpd to run "in front of" the servlet container, and to set up Apache to pass requests for certain URLs onto the servlet container. How to do that with Tomcat is documented on the Tomcat site (op cit.); other servlet containers do it in different ways. But a discussion of setting up Tomcat and Apache really is a topic for another site.

HTH.

If not P, what? Q maybe?
"Sidney Morgenbesser"


In reply to Re: OT: Calling a Servlet from mod-Perl/Apache by arturo
in thread OT: Calling a Servlet from mod-Perl/Apache by coreolyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.