This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
So I was handed some rather old code the other day because after a server migration, the folks handling this code found that it no longer worked and they had no one around that could support it. I told them that I'd look at it and see if I could figure out what was wrong.
It's a J2EE web application but, what I find puzzling, is that it runs (or ran, I should say) without a context. By that, I mean that you did this to access the application:
There's no servlet-mapping element - it appears that this accesses the servlet directly. Unfortunately, this mapping appears elsewhere in the application so I can't just change it in one place and be done with it - even worse, this path appears in an old .swf file for which there is no corresponding .fla to modify. As such, I think my only hope to fix this without doing any major changes is to figure out how this "accessing a servlet directly" thing works. Unfortunately, me Google searches have come up empty.
Anyone have any knowledge or any good references I could be pointed to?
Not sure what app server you use and the Java EE spec is used. While changing the URL for this servlet, I would suggest to create a forward/redirect from the old location so that old references keep on working.
P.S. "Context" is the wrong word. Every web app has a context. I think you meant "mapping".
Joined: Dec 20, 2001
You're right on both counts - this old application was using the Invoker Servlet to get things done and "mapping" would have been a much better word to use. I believe I now have it fixed up.
One thing to note - in that article you referenced, there were a couple things that are no longer accurate, particularly when dealing with Tomcat.
1. In addition to the mapping that must be uncommented to use the InvokerServlet, you must also uncomment the actual servlet:
In my installation (Tomcat 6.0.18), both were commented out.
2. Once uncommented, the InvokerServlet still did not start properly on my installation. In addition to uncommenting these sections, I also had to add 'privileged="true"' to the Context element in the conf/context.xml file.
As soon as I made those changes, I was able to get it working. Fortunately, there were not that many places that used the InvokerServlet path so not many changes were required to get the application off of that and working.