Re: Why cant I access a folder at root level which contains Java Script

2010-04-07 Thread nzindian

Awsome thanks guys.
I'm going to try some of your suggestions tonight - as a quick work around I
have just 'included' the javascript files.

Cheers.
-- 
View this message in context: 
http://old.nabble.com/Why-cant-I-access-a-folder-at-root-level-which-contains-Java-Script-tp28129493p28171291.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why cant I access a folder at root level which contains Java Script

2010-04-06 Thread Juha Laiho

On 04/03/2010 11:57 PM, nzindian wrote:

Im trying to use a javascript WYSIWYG editor in a JSP page.

The JSP is in the following directory:
apache-tomcat-5.5.28/webapps/SimpleBlog

The Java script is in this directory:
apache-tomcat-5.5.28/webapps/SimpleBlog/js

The JSP contains the following code to include the JS file:



and it doesnt work,


... because if that's really how you have things set up, the paths
to the scripts should not have the /scripts/ level, but instead they
should be:

src="js/wysiwyg.js">
src="js/wysiwyg-settings.js">



Ive also tried adding a backslash before the js in the "src=".

However if I copy the JSP into the js folder (and remove the "js" from the
"src=") then it works!

Why can the JSP see the "js" folder?


As others have said, it's the browser which either sees or doesn't see
something. If you're using Firefox, you could use one of the many
extensions to find out what the browser actually requests, and what
is the request from the server. My preferred FF extension for this
would be TamperData. If you have access log enabled on your server,
the requested resource path along with the HTTP response code set by
the server will also be visible there.

Remember that the browsers always request with absolute paths; relative
paths are an HTML feature, but requests are done with HTTP, which only
recognizes absolute paths. Thus, the browser will create the absolute
paths based on location of the referring resource and the relative
reference. As always with relative references, you have to pay close
attention to the context.
--
..Juha

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why cant I access a folder at root level which contains Java Script



--- On Sat, 4/3/10 at 5:07 PM, Hassan Schroeder  
wrote:

> To: "Tomcat Users List" 
> Date: Saturday, April 3, 2010, 5:07 PM
> On Sat, Apr 3, 2010 at 1:57 PM,
> nzindian 
> wrote:
> 
> > Im trying to use a javascript WYSIWYG editor in a JSP
> page.
> 
> > The JSP contains the following code to include the JS
> file:
> 
> > and it doesnt work,
> 
> Look at the page source in a browser and see what it is.
> Why doesn't
> it work? Because it's wrong, *from the perspective of the
> user agent*.
> 
> You can hard-code your context path or use JSTL e.g.
> " the corresponding JSP declaration to add your context path
> in front of
> the context-relative script directory path.
> 

Or you can specify a *correct* relative path.

For example, if your .jsp is in jsp/ and your .js is in a parallel js/
folder you can use a relative path:

   src="../js/the-js.js"

- Bob


  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why cant I access a folder at root level which contains Java Script

On Sat, Apr 3, 2010 at 1:57 PM, nzindian  wrote:

> Im trying to use a javascript WYSIWYG editor in a JSP page.

> The JSP contains the following code to include the JS file:

> and it doesnt work,

Look at the page source in a browser and see what it is. Why doesn't
it work? Because it's wrong, *from the perspective of the user agent*.

You can hard-code your context path or use JSTL e.g. "

Why cant I access a folder at root level which contains Java Script


Hi,

Im trying to use a javascript WYSIWYG editor in a JSP page.

The JSP is in the following directory:
apache-tomcat-5.5.28/webapps/SimpleBlog

The Java script is in this directory:
apache-tomcat-5.5.28/webapps/SimpleBlog/js

The JSP contains the following code to include the JS file:



and it doesnt work,

Ive also tried adding a backslash before the js in the "src=".

However if I copy the JSP into the js folder (and remove the "js" from the
"src=") then it works!

Why can the JSP see the "js" folder?

Thanks

-- 
View this message in context: 
http://old.nabble.com/Why-cant-I-access-a-folder-at-root-level-which-contains-Java-Script-tp28129493p28129493.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org