|
|
 |
| Author |
Message |
Bjorn Abelli

|
Posted: 7/17/2007 2:47:00 AM |
Top |
java-programmer, file-include question..
"maya" <email***@***.com> wrote...
> if I'm in a webapp called "photoblog", for example, if I do
>
> <%@ page errorPage="/errHandler.jsp"%>
>
> it works fine; if I do
>
> <%@ page errorPage="/photoblog/errHandler.jsp"%>
>
> I get an error..
> (this happens both on my personal stuff in Tomcat and my stuff @ work
> on weblogic..)
This is handled by the JSP container, i.e. on the server side.
The path is hence relative to the JSP application.
> within same webapp I have:
>
> <link rel="stylesheet" type="text/css"
> href="/photoblog/css_default.css">
>
> for this one I do need webapp-name in path, otherwise it does not read css
> stylesheet..
css is not JSP includes, but is part of the plain webbrowsing, i.e. handled
from the *client* side.
css is "requested for" by the the browser, i.e. the path is relative to the
visible url.
> can someone enlighten me here?
I hope I have.
/// Bjorn A
|
| |
|
| |
 |
maya

|
Posted: 7/17/2007 3:04:00 AM |
Top |
java-programmer >> file-include question..
Bjorn Abelli wrote:
> "maya" <email***@***.com> wrote...
>
>> if I'm in a webapp called "photoblog", for example, if I do
>>
>> <%@ page errorPage="/errHandler.jsp"%>
>>
>> it works fine; if I do
>>
>> <%@ page errorPage="/photoblog/errHandler.jsp"%>
>>
>> I get an error..
>> (this happens both on my personal stuff in Tomcat and my stuff @ work
>> on weblogic..)
>
>
> This is handled by the JSP container, i.e. on the server side.
>
> The path is hence relative to the JSP application.
ok, I see.. "relative" meaning it can't be an abs. path starting @ root
of app? I mean a path like /inc/style.css is relative, whereas this
<webapp>/inc/style.css is absolute???
reason all this arose 4 me is that I have a var declared in one include
and it's used in another include used by same pg (but that is called
AFTER the include that contains var-declaration..) and get "can't find
symbol".. and I don't get this....
what I mean:
<%@ include file="/training/top125/past-winners/inc_top.jsp"%> --
var-declaration. var here..
<%@ include file="/training/top125/past-winners/inc_paragr.jsp"%>
<%@ include file="/training/top125/past-winners/inc_pg_nav.jsp"%> use
var here.. (get error on var: can't find symbol)
<%@ include file="/training/top125/past-winners/inc_table_top.jsp"%>
??? :( this is very weird....
thank you very much for your help..
|
| |
|
| |
 |
Bjorn Abelli

|
Posted: 7/17/2007 2:45:00 PM |
Top |
java-programmer >> file-include question..
"maya" <email***@***.com> wrote...
> Bjorn Abelli wrote:
>> "maya" <email***@***.com> wrote...
>>
>>> if I'm in a webapp called "photoblog", for example, if I do
>>>
>>> <%@ page errorPage="/errHandler.jsp"%>
>>>
>>> it works fine; if I do
>>>
>>> <%@ page errorPage="/photoblog/errHandler.jsp"%>
>>>
>>> I get an error..
>>> (this happens both on my personal stuff in Tomcat and my stuff @ work
>>> on weblogic..)
>>
>>
>> This is handled by the JSP container, i.e. on the server side.
>>
>> The path is hence relative to the JSP application.
>
> ok, I see.. "relative" meaning it can't be an abs. path starting @ root
> of app? I mean a path like /inc/style.css is relative, whereas this
> <webapp>/inc/style.css is absolute???
Both your examples were "relative", but from different contexts.
JSP directives (those starting with "<%@") are dealt with and resolved by
the JSP container, on the server, where the path always is relative to the
JSP-application.
HTML directives (e.g. "<link" when "including" a style sheet) are dealt with
on the client side, which can use both relative and absolute paths. Relative
paths are in this case resolved by the webbrowser at the client side, with a
leading "/" the path starts at the "web root". Absolute paths in this case
starts with "http://"...
> reason all this arose 4 me is that I have a var declared in one include
> and it's used in another include used by same pg (but that is called AFTER
> the include that contains var-declaration..) and get "can't find symbol"..
> and I don't get this....
>
> what I mean:
>
> <%@ include file="/training/top125/past-winners/inc_top.jsp"%> --
> var-declaration. var here..
> <%@ include file="/training/top125/past-winners/inc_paragr.jsp"%>
> <%@ include file="/training/top125/past-winners/inc_pg_nav.jsp"%> use var
> here.. (get error on var: can't find symbol)
> <%@ include file="/training/top125/past-winners/inc_table_top.jsp"%>
This rather sounds like something else, not related to the issue of "file
paths", as it seems that the "includes" themselves worked. The message hence
refer to another error, e.g. that the variable is defined in a way that it
later isn't recognized, like different spellings, scope constraints, etc.
/// Bjorn A
|
| |
|
| |
 |
| |
|