Results 1 to 15 of 15

Thread: Best JSP Server/JSP question

  1. #1

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772

    Best JSP Server/JSP question

    1. What's the best JSP server? I used to use JRun and PWS but I don't like either of those products. I use Apache now. Is there any free things I can use with this to serve JSP pages?

    2. How do you compile JSP pages? Do you use the compiler from Sun?
    Alcohol & calculus don't mix.
    Never drink & derive.

  2. #2
    1. I use Tomcat for my site. It is such a royal pain in the rear-end to set up but when it works it works well. It's partnered with Apache which is running as a service. I'm using 3.3 since 4.0 was impossible for me to figure out.
    2. If I know PHP correctly, there is no way to compile JSP pages like PHP. All you have to do is navigate to http://localhost:8080/project/file.jsp and it compiles it.

  3. #3
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    You can use Tomcat with apache to serve jsp and servlets.

    That might be the best since you are already running apache. The downside is the combo is a lot heavier than need be. An excellent alternative is jetty (http://jetty.mortbay.org). Jetty is light-weight and runs in Java and it's the only program you need because it's both a web server, jsp engine and a servlet server. Another plus is you can update your jsp file and test it without restarting the server, (I heard that you have to cycle the server with Tomcat).

    Both are GPL.

    Both are challenging to configure (jetty uses an XML file that you edit and the challenging part is understanding the well commented XML file)

    I like Jetty and may even consider installing it on a Linux PDA when such a beast becomes commonly (read cheaply) available.

    cudabean

  4. #4
    Originally posted by Cudabean
    Another plus is you can update your jsp file and test it without restarting the server, (I heard that you have to cycle the server with Tomcat).
    Only if you update header.html or footer.html in this example:
    Code:
    <%@ include file="header.html" %>
    Stuff
    <%@ include file="footer.html" %>

  5. #5
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843
    Does TomCat runs windows... or only in Linux????

    Does IIS 4.0 run JSP?
    "The difference between mad and genius is the success"

  6. #6
    Tomcat runs on Win32 and Linux, and supposedly Mac OS X as well since it is Unix.

  7. #7

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    Ok, thanks for all your help

    I am thinking about getting into Java/JSP again, since I didn't really use it the first time around (just in a class). Does anyone have links I can use to learn Java or JSP?
    Alcohol & calculus don't mix.
    Never drink & derive.

  8. #8
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    For JSP:

    Sun's references are not bad. If you don't know Java, jsp is going to be frustrating:
    http://java.sun.com/products/jsp/tags/10/tags.html
    http://java.sun.com/products/jsp/

    Roedy Green's Java FAQ has several links to additional jsp information:
    http://mindprod.com/gloss.html

    For Java:
    Locate the online book Thinking in Java by Bruce Eckel. It's soon to be published (already published?) and I think it's very well written. Bruce is able to describe material with significant complexity in such a way that makes it readily understandable.

    cudabean

  9. #9
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Can anyone explain what exctally Apache is. If say im running on a new server that i just bought. Apache is the software that actually runs the server and takes care of tasks such as i guess creating a log file, sending and recieving packets, address vectoring ect ect.... Now i heard JSP or CGI creates so called "dynamic web pages". Are these web pages initally created from an application such as Dream Weaver or Front Page and then what ever additional content requested is created on the fly from JSP?

    So the server has to have an OS wether it be Unix or Lunix or what ever, then i need to install Apache, or another server software. Then if i wanted a database such as SQL or Oracle(not that i could afford Oracle) id have to install that too. Am i right so far?

  10. #10
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Originally posted by Dilenger4
    Can anyone explain what exctally Apache is. If say im running on a new server that i just bought. Apache is the software that actually runs the server and takes care of tasks such as i guess creating a log file, sending and recieving packets, address vectoring ect ect.... Now i heard JSP or CGI creates so called "dynamic web pages". Are these web pages initally created from an application such as Dream Weaver or Front Page and then what ever additional content requested is created on the fly from JSP?
    Yes, you are pretty close. What a web server does is extermely simple: It listens on TCP/IP port 80 (usually) and when it receives a message from a web browser (or spider) in the form of an URL, if it can or is allowed, it responds to whatever the URL says to do, then it closes the connection. A typical response to an URL might be to send a file back to the browser, another URL might ask the web server to run a program that dynamically generates HTML then again sends the results back to the browser.

    Dynamic web pages could start out in Dream Weaver. I prefer a text editor. Depending on your intentions, you might start with what you want it to look like first, and then, the key! Most dynamic HTML (including jsp), have you insert program code right into the HTML file. That means for jsp you are adding in raw uncompiled Java surrounded by special tag markers in and amongst your HTML tags.

    Originally posted by Dilenger4

    So the server has to have an OS wether it be Unix or Lunix or what ever, then i need to install Apache, or another server software. Then if i wanted a database such as SQL or Oracle(not that i could afford Oracle) id have to install that too. Am i right so far?
    Yup that's most of it. You would also want to install a jsp processor such as Tomcat. Also, for access to the database you'd want to make sure you had JDBC which allows you to access SQL from Java and JSP (I don't recommend accessing SQL from JSP, but it's doable and a good way to learn) Ultimately, it's best to confine your database access to Java servlets.

  11. #11
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    That means for jsp you are adding in raw uncompiled Java surrounded by special tag markers in and amongst your HTML tags.
    Yikes! Java mixed in with HTML. I guess soon it will be Java mixed in with XML. Cool, thanks for the info Cudabean. Im trying to get a better understanding of all of this. It gets to be too much sometimes.

  12. #12
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    I got these off of suns site.

    "JSP Pages let you put segments of servlet code into a static HTML page. When a browser loads a JSP, the servlet code executes and the application server creates, compiles, loads, and runs a background servlet to execute the servlet code segments."

    "A servlet is an extension to a server that enhances the server's
    functionality. The most common use for a servlet is to extend a
    web server by providing dynamic web content."

    So does this mean that JSP's only run on the client side and servlets runs on the server side?

  13. #13
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Originally posted by Dilenger4
    "JSP Pages let you put segments of servlet code into a static HTML page. When a browser loads a JSP, the servlet code executes and the application server creates, compiles, loads, and runs a background servlet to execute the servlet code segments."

    "A servlet is an extension to a server that enhances the server's
    functionality. The most common use for a servlet is to extend a
    web server by providing dynamic web content."

    So does this mean that JSP's only run on the client side and servlets runs on the server side?
    No, JSP runs on the server side. In fact JSP files get compiled into servlets. (It's also common to write servlets from scratch) The description from Sun quoted above is confusing. The browser sends an URL requesting a JSP page, but the server is set to "look out for" JSP pages and do some pre-processing before sending any data to the browser. It's pretty amazing what happens actually because the JSP file is run through an interpreter and is converted to a Java source file (servlet) and is compiled into a class. What? It does all of that just to display a JSP page? Sounds inefficient. Well, it is a little the first time through, but subsequent accesses to the JSP will be handled by the already compiled class--it sticks around. If you hunt around your drive, you can also find the .java file that was generated from your .jsp and that is sometimes useful for debugging.

    cudabean

  14. #14
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Yeah i was getting a little confused for a second there. Ok i see now. That's pretty cool how the JSP file is run through an interpreter then converted to a Java source file (servlet). So is CGI basically the same concept? (Generate dynamic content on the server side)

  15. #15
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Originally posted by Dilenger4
    So is CGI basically the same concept? (Generate dynamic content on the server side)
    Yes, but CGI is much older and not as well thought out. Originally it was thought of more as "Run this program on the server and if it happens to send results to STDOUT, pass it along to the browser."

    cudabean

Posting Permissions

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



Click Here to Expand Forum to Full Width