I have downloaded the jswdk-1.0.1 which supports the servlets 2.1 api.
However in the API documentation all the methods in the ServletContext Class
used for inter servlet communication:
getServlet
getServletNames
getServlets
are now Deprecated and there doesn't seem to be any replacements.
My problem is now this.
example:
i have 10 static web pages (which can and will in the future become dynamic
generated probably template/DB based). I need to keep a log of when these
pages are seen ( and in the future by who, when i have a session
implemented.) This why don't want to use the web servers log.
Solution:
I turn all the pages into .JSP files. then i give them all an identifier eg.
page1, page2 , page3 etc.
I then create a central SERVLET that maintains a Hashtable that is used to
cross reference the page key with the URL;
eg: page1 will return /jsp/page1.jsp
then every jsp page that wants to link to another page goes through the
SERVLET. They send the key for the page they want.
eg: page1 has a link to page2 like this: hfer=
"/servlet/myservlet?dest=page1"
The servlet then looks up the destination in the Hashtable, logs the request
and redirects to the requested Jsp page. However this is all fine at the
moment as I don't need inter-servlet communication if I hard code the links
in the JSP pages.
however I don't want to do this ( normal reasons for not hard coding)
So I want to call a method on the Central Servlet that I can pass in a key,
it checks if it is valid then returns me back the correct URL.
eg <% myservlet.getURL("page1"); %>
This is were it all goes wrong. To call the public method on the servlet I
need to get a reference to it. However because of the methods that were once
used to do this are now gone I cannot seem to do it.
Ideas
I have been thinking of perhaps Static methods of non servlet classes
or JNDI (bit over kill)
So come on the gurus what is the answer, workaround, alternative ....
cheers in advance..
Ps. I have checked the archives of the mailing list but no joy.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html