What if you put this,
Code:<SCRIPT type="text/javascript"> Today is: <%= new java.util.Date().toString() %> </SCRIPT>
AoA,
I have tried to execute JSP with apache, by using tomcat and mod_jk2 connector.Now, i have placed the following code in my server's html folder, the file name is "hello.jsp and the code is:
Now, when i try to read the output of this code, by using:Code:<HTML> <HEAD> <TITLE>Hello World</TITLE> </HEAD> <BODY> <H1>Hello World</H1> Today is: <%= new java.util.Date().toString() %> </BODY> </HTML>
i get the following display:Code:http://localhost/hello.jsp
I don't understand what's the problem.Can anyone guide me?Code:Hello World Today is: <%= new java.util.Date().toString() %>
What if you put this,
Code:<SCRIPT type="text/javascript"> Today is: <%= new java.util.Date().toString() %> </SCRIPT>
Hello!
If i use this script, i only get the following output:
, but not the date and time.Code:Hello World![]()
Do you see any errors on your tomcat log?
My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive.
The original code works just fine on my tomcat installation:
Hello World
Today is: Wed Jun 14 10:00:29 EDT 2006
Are you sure tomcat is serving you the page, and not apache?
Did you configure the JAVA_HOME variable on the tomat settings?
My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive.
Are you running this page out of Apache or Tomcat? If Apache did you install the mod_jk connector? Better to just try it directly through Tomcat first, get it working then attempt to connect Apache and Tomcat.
Hello!
The JSP is working fine with tomcat.The results are displayed correctly.If i try to execute the same page through apache then i am not getting the correct display.
Apache displays result of java script correctly, i.e if i try to execute the following code through apache:
I get the following result:Code:<head> <title>My Javascript Page</title> </head> <body> Hello!!!<br> <script> document.write("Welcome to my world!!!<br>"); </script> Enjoy your stay...<br> </body> </html>
But with the previous JSP pages and other codes similar to that is not showing the correct results for apache web server.Code:Hello!!! Welcome to my world!!! Enjoy your stay...
In tomcat i haven't made any JAVA_HOME setting.Can you tell me where to make these changes?
It seems you have something misconfigured then.
I'd say you go again through your setup and make sure it is kosher.
Here is a setup guide for the mod_jk2.
My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive.
Hello!
Its working now.Thanks a lot for your replies.![]()
Bookmarks