Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
JSP with Apache & Tomcat!
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: JSP with Apache & Tomcat!

  1. #1
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Question JSP with Apache & Tomcat!

    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:

    Code:
    <HTML>
    <HEAD>
    <TITLE>Hello World</TITLE>
    </HEAD>
    <BODY>
    <H1>Hello World</H1>
    Today is: <%= new java.util.Date().toString() %>
    </BODY>
    </HTML>
    Now, when i try to read the output of this code, by using:

    Code:
    http://localhost/hello.jsp
    i get the following display:

    Code:
    Hello World
    Today is: <%= new java.util.Date().toString() %>
    I don't understand what's the problem.Can anyone guide me?

  2. #2
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    What if you put this,
    Code:
    <SCRIPT type="text/javascript">
    Today is: <%= new java.util.Date().toString() %>
    </SCRIPT>

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    - The truely community run Linux/Floss forum !

    No IT BS !!

  3. #3
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146
    Hello!

    If i use this script, i only get the following output:

    Code:
    Hello World
    , but not the date and time.

  4. #4
    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.

  5. #5
    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.

  6. #6
    Mentor jro's Avatar
    Join Date
    May 2004
    Location
    Pennsylvania, USA
    Posts
    1,206
    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.
    jro -
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Linux counter#:213782
    GnuPG ID: 406238E7

  7. #7
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Arrow

    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:

    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>
    I get the following result:

    Code:
    Hello!!!
    Welcome to my world!!!
    Enjoy your stay...
    But with the previous JSP pages and other codes similar to that is not showing the correct results for apache web server.

    In tomcat i haven't made any JAVA_HOME setting.Can you tell me where to make these changes?

  8. #8
    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.

  9. #9
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Smile

    Hello!

    Its working now.Thanks a lot for your replies.

  10. #10
    What was the problem???
    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.

Similar Threads

  1. Aliasing in Apache + Tomcat
    By honey bee in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 10-16-2006, 04:00 PM
  2. how can i install apache tomcat in linux??
    By hn2t in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 03-09-2006, 04:16 PM
  3. Apache Tomcat
    By tolstoy in forum Linux - Hardware, Networking & Security
    Replies: 7
    Last Post: 08-30-2002, 02:21 AM
  4. Integrating Tomcat 4.0.3 with Apache 2.0.35
    By Nehctik in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 04-17-2002, 01:20 AM
  5. Tomcat and JDK
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 24
    Last Post: 03-13-2002, 12:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •