Solved

Servlet generated Javascript code

Posted on 2002-05-29
3
264 Views
Last Modified: 2013-11-24
I have a servlet that generates HTML code that has embedded Javascript in it. This javascript code excutes normally most of the time but I use a javascript function that has a redirect call in it which fails. None of these javascript calls have been successful:
-document.location.href = 'http://javascriptsource.com';
-window.location='http://javascriptsource.com';
-self.location.href='http://javascriptsource.com';
The same calls execute correctly when the raw html page is used instead of sending it through a servlet.

All 3 result in the line "......../servlet/undefined" appearing in the address line of the browser a stack trace and error entitled 'java.lang.ClassNotFoundException: undefined' appearing in the main window.
Does anyone know a solution to this?
0
Comment
Question by:tom_corc3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 7041905
Please post your code.  
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 7042626
what's your OS/browser/Java version ?

post a small compilable example that we can test.
0
 
LVL 92

Expert Comment

by:objects
ID: 7045614
Interesting answer??
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question