I have written a note in HFS myself regarding your question. If the "/" is missing, it would mean relative to something. But what that something is when a path is specified in web.xml? It is quite different from request.getRequestDispatcher("someurl.jsp") where the call is associated with a request object and hence a URL where "someurl.jsp" is relative to.
Joined: Jun 07, 2007
Thanks for the replays guys !
Hmmm ... I asked myself this question after posting on the forum but to be honest I'm still not sure :/
Trying to write servlets and learn web technology without even knowing HTML or what it is used for doesn't make a whole lot of sense. You will find yourself running in circles because you don't know what anything talks about. You can intelligently look at any of the specifications.
Do you have ANY programming experience? If you have some C or C++ you might be able to scrape by with the java stuff as long as you understand the main concepts behind OOP.
One thing I've learned, also being new to the technology, is that specifications are your friend and don't fight them because you can't do anything about them! Just follow them and your path will be much easier.
[ December 07, 2007: Message edited by: Bryce Martin ]
I'm actually thankful that containers don't try to 'figure things out for you.
As we learned with HTML over the last decade, the result of interpreters that allow sloppiness is more sloppiness. Eventually, the sloppiness gets so bad and the level of sloppiness tolerance between different interpreters became so disparate that it became almost impossible anything that will work in all environments.
With HTML, the move towards the stricter XHMTL has helped out a lot. Luckily, most servlet containers stick to the specification and steer clear of things like this. The result is that it is fairly easy to write web apps that can be deployed in any spec compliant container.
subject: DD: url-pattern and "/" - explanation please ...