It's not an inconstancy in the way Java works.
Your comparing client side, markup code with server side
JSP code.
You image tag is just text as far as the JSP interpreter is concerned.
It just sends it to the browser, verbatim.
The JSP tags, on the other hand are interpreted on the server.
Since your browser knows nothing about server side Java apps, it has now way of knowing what your context path is unless you specify it.