You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Adams <ja...@ucar.edu> on 2001/11/14 19:55:22 UTC
Why am I getting a Javascript file instead of my servlet ?
I have a page (JSP) which contains a form with a servlet as the action
of the form. However whenever I submit the form I am getting a Not
Found 404 error telling me that a Javascript file which is used for
Javascript on the page is not found. I am perplexed as to why this is
happening, especially since the Javascript is working as it should. I
should instead be forwarded to the servlet which will handle the form
parameters. Can anyone suggest ways to find out what is going wrong
? Thanks in advance for any suggestions...
-James
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: Why am I getting a Javascript file instead of my servlet ?
Posted by "Corey A. Johnson" <cj...@cniweb.net>.
Sounds like you may have a:
<script language="JavaScript" src="filename.js">
statement in your returned HTML code.. and the .js file can not be
found...
hope that helps.
Cj
James Adams wrote:
> I have a page (JSP) which contains a form with a servlet as the action
> of the form. However whenever I submit the form I am getting a Not
> Found 404 error telling me that a Javascript file which is used for
> Javascript on the page is not found. I am perplexed as to why this is
> happening, especially since the Javascript is working as it should. I
> should instead be forwarded to the servlet which will handle the form
> parameters. Can anyone suggest ways to find out what is going wrong
> ? Thanks in advance for any suggestions...
>
> -James
>
> --
> To unsubscribe: <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
--
Corey A. Johnson
Creative Network Innovations
http://www.cniweb.net/
1-800-CNi-5547 ** 1-321-259-1984
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: Why am I getting a Javascript file instead of my servlet ?
Posted by Rajah Kalipatnapu <ra...@soundpipe.com>.
>From my experience you might be facing this problem with Netscape browser.
If you try the same with explorer you may not face this problem.
This is only one possibility I know. There may be some other reasons which
I cannot guess.
Ok, lets c if you can access your page through IE( thought IE says that
there are errors in page)
and not through Netscape, that means in the result page you have a wrong
path to your javascript file.
Its always possible when you use a relative path in your servlet or jsp
output page
and use servlet to get that page.
I would rather use
<%=request.getContextPath()%>/javascriptDirectory/myjsfile.js
instead of some thing like ../../javascriptDirectory/myjsfile.js
hope this helps,
Raj
-----Original Message-----
From: jadams@acd.ucar.edu [mailto:jadams@acd.ucar.edu]On Behalf Of James
Adams
Sent: Wednesday, November 14, 2001 10:55 AM
To: tomcat-user@jakarta.apache.org
Subject: Why am I getting a Javascript file instead of my servlet ?
I have a page (JSP) which contains a form with a servlet as the action
of the form. However whenever I submit the form I am getting a Not
Found 404 error telling me that a Javascript file which is used for
Javascript on the page is not found. I am perplexed as to why this is
happening, especially since the Javascript is working as it should. I
should instead be forwarded to the servlet which will handle the form
parameters. Can anyone suggest ways to find out what is going wrong
? Thanks in advance for any suggestions...
-James
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>