Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Oct 2004
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JSP Displaying as Plain ASCII

    I downloaded a free JSP script from a code website and it says all you need to do is upload it and access it using a web browser and it will work but it is just displaying the source code. I checked and my schools server is running Tomcat 5 ... any ideas why it is just showing up as the code?

  • #2
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by CF Posting Guidelines
    1) Do not cross post your question in multiple forum categories- When posting, there is no excuse to post the same question in multiple categories in hopes of getting a quicker response.
    Read the rules man...

  • #3
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Where did you upload your jsp files to?

    just write a simple jsp page and upload to the same location to see if it works. copy this code and save it as sample.jsp


    <html><body>
    The time is now <%= new java.util.Date() %>
    </body></html>

    Also, what don't know what jsp script you are using, if the sample.jsp works, then you have to tell me more about the free script you have

  • #4
    New Coder
    Join Date
    Oct 2004
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I asked my prof from my web programming class why I was having this problem, he said it is because I DO NOT have Tomcat running on the server. He said that they put the files onto the server but never installed it over the summer(go figure). In order to get my JSP scripts to work I would have to manually install Tomcat onto the server. Does anyone know any sites that have instructions on how to do this?

  • #5
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.coreservlets.com/Apache-T...nfigure-Tomcat

    that's where I learn how to install, it's very good. looks lots to read, but it's not cuz only one page.

  • #6
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you downloaded the code and just pasted it on a file in a java web server, make sure it is wrapped around <% %> to make it work otherwise it will just display as plain text.

    for functions / methods, use <%! %>

    to display the value use: <%= %>

    first though, make sure it is a java web server or wait until your professor install one on it.

  • #7
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Editted

  • #8
    cfc
    cfc is offline
    Regular Coder
    Join Date
    Dec 2004
    Location
    Keswick, Ontario
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by webcomplete
    for functions / methods, use <%! %>
    Also for properties that you wish to have persistent. IMO it makes more sense to declare functions in beans or custom tags for use in JSP but I have limited experience with J2EE in general so I can't speak from it.

    He's already figured out that the problem is his school not having installed Tomcat though, and the problem (if it still exists) is how to install it.

    As a tip, server.xml is not nearly as hard to understand if you dive right into it.


  •  

    Posting Permissions

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