Click to See Complete Forum and Search --> : Best JSP Server/JSP question
Wynd
Dec 31st, 2001, 04:41 PM
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?
filburt1
Dec 31st, 2001, 04:52 PM
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.
Cudabean
Dec 31st, 2001, 05:02 PM
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
filburt1
Dec 31st, 2001, 05:07 PM
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:
<%@ include file="header.html" %>
Stuff
<%@ include file="footer.html" %>
Andreex
Dec 31st, 2001, 05:29 PM
Does TomCat runs windows... or only in Linux????
Does IIS 4.0 run JSP?
filburt1
Dec 31st, 2001, 05:39 PM
Tomcat runs on Win32 and Linux, and supposedly Mac OS X as well since it is Unix.
Wynd
Jan 1st, 2002, 05:10 PM
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?
Cudabean
Jan 2nd, 2002, 10:55 AM
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
Dillinger4
Jan 2nd, 2002, 06:59 PM
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?
Cudabean
Jan 2nd, 2002, 07:33 PM
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.
Dillinger4
Jan 2nd, 2002, 07:49 PM
That means for jsp you are adding in raw uncompiled Java surrounded by special tag markers in and amongst your HTML tags.
Yikes! :eek: 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. :p
Dillinger4
Jan 2nd, 2002, 08:54 PM
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?
Cudabean
Jan 3rd, 2002, 11:03 AM
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
Dillinger4
Jan 3rd, 2002, 11:31 AM
Yeah i was getting a little confused for a second there. :p 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)
Cudabean
Jan 3rd, 2002, 12:02 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.