• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Web Application without a Context

 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

http://www.server.com/servlet/controller

Within the web.xml is this:



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?

Thanks,
Corey
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The app is probably using the dreaded Invoker. See: http://faq.javaranch.com/view?InvokerServlet
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. "Context" is the wrong word. Every web app has a context. I think you meant "mapping".
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Bear.

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.

Thanks again, Bear.

- Corey
[ October 04, 2008: Message edited by: Corey McGlone ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic