Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Problem in downloading js files specified in our webpages

Thread view: 
Venkatesh - 01 Mar 2007 10:29 GMT
Hi All,

We have a retail site hosted on one of our servers. The context path
of site is /retail, and the main servlet for us is dispatch.do. So
basically our site URL is of the form http://www.host.com/retail/dispatch.do.
This will take the visitor to main page of the site. One can also jump
to an arbitrary page in our site by supplying additional query
parameters in the URL directly. Some thing like
http://www.host.com/retail/dispatch.do?currentState=Options&st=....
where st is a symbolic state token that we'll be processing
internally. Thus, the resulting page rendered after processing request
parameters need not be the main page of the site. This is working
perfect in our testing environment, but on production site we are
facing one weired issue:

Our html pages have reference to javascript files in the form of
<script language="JavaScript" src="js/vehicleimage.js"></script>. and
strangely for some visitors (~5%), these javascript files are getting
downloaded using a GET request of the form shown below:

GET /retail/dispatch.do?
&foldedTablesList=&st=1%7C4B7E4F04905B0110DF8C500FE0190000%7C1172018077588%7C18%7CChevrolet
%2499502%7Cfalse%24false%7Cfalse%7Cfalse%7Ctrue%7C2007uva_in
%7Cexi4.07%7C%7Ek8/js/vehicleimage.js

The above GET request is present in our apache logs. As a result of
above, our servlet is getting executed while downloading javascript
file.

More stranger is the fact that the above URL is malformed and request
parameters present in above URL are incomplete, and hence our servlet
is throwing exceptions during it's execution.

Does anybody have an idea as to why this is happening?

Also, when we put references to javascript files in the form <script
language="JavaScript" src="js/vehicleimage.js"></script>, doesn't it
get translated to http://www.host.com/retail/js/vehicleimage.js ???

Thank you,
Venkatesh
Andrew Thompson - 01 Mar 2007 13:29 GMT
..
> ...Thus, the resulting page rendered after processing request
> parameters need not be the main page of the site. This is working
> perfect in our testing environment,

Using which browser?

>..but on production site we are
> facing one weired issue:
>
> Our html pages have reference to javascript files in the form of
> <script language="JavaScript" src="js/vehicleimage.js"></script>. and

It might pay to validate your HTML.
<http://validator.w3.org/>

Andrew T.
Venkatesh - 01 Mar 2007 18:17 GMT
> > ...Thus, the resulting page rendered after processing request
> > parameters need not be the main page of the site. This is working
> > perfect in our testing environment,
>
> Using which browser?

We do manual testing using IE 6, 7 and Firefox 2

Automated testing is done using Canoo webtest

> >..but on production site we are
> > facing one weired issue:
[quoted text clipped - 4 lines]
> It might pay to validate your HTML.
> <http://validator.w3.org/>

Did a quick validation of one of our pages by hitting through
http://validator.w3.org .. I'm getting nearly 40 - 45 errors. The
errors pointed out are as follows:

1. no document type declaration; implying "<!DOCTYPE HTML SYSTEM>"
2. <link rel="stylesheet" href="/data/brand/chevrolet/css/
chevrolet.css"/> - document type does not allow element "LINK" here .
- 3 errors

3. <script language="JavaScript" src="js/jsobj.js"></script> -
Required attribute - "type" is missing - for all declarations of
javascript files

4. <script language="JavaScript"> - Required attribute - "type" is
missing.
<img src="/data/brand/chevrolet/img/footer.gif" border=0> - Missing
alt 23 errors

These are the errors for one of our page. But is there any
relationship b/w these errors and the problem we are facing?

> Andrew T.
Sem - 01 Mar 2007 18:29 GMT
> > > ...Thus, the resulting page rendered after processing request
> > > parameters need not be the main page of the site. This is working
[quoted text clipped - 38 lines]
>
> - Show quoted text -

since you mentioned on
form http://www.host.com/retail/dispatch.do.

It means you use Struts then you have to check your struts-config.xml
file and your
Action class.

Also see the form file that is used by the action class

Unless I see the whole program, it is very hard to pinpoint the
problem.

-Sem
Andrew Thompson - 01 Mar 2007 18:58 GMT
..
> These are the errors for one of our page. But is there any
> relationship b/w these errors and the problem we are facing?

Then best way to find out, is to remove
them and try the page again.

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.