Valhalla Legends Forums Archive | Java Programming | JSP

AuthorMessageTime
iago
Next semester, I need to do programming in JSP. How different is it from Java? Is it the same thing, except that the output is redirected to a webbrowser? And how is the CGI parsed?
December 19, 2003, 2:14 PM
Hostile
[quote author=iago link=board=34;threadid=4345;start=0#msg36349 date=1071843286]
Next semester, I need to do programming in JSP. How different is it from Java? Is it the same thing, except that the output is redirected to a webbrowser? And how is the CGI parsed?
[/quote]

In theory, JSP is just Java servlet coding embedded into HTML pages. However, syntactically the logic for it is quite a bit different. I'll assume you don't have servlet experience so, you'll want to take a look at the API for JSP 2.0.
http://java.sun.com/products/jsp/ - This should most definitly be helpful. Check out the Documentation and FAQs area.
http://jcp.org/aboutJava/communityprocess/final/jsr152/index.html - JSP2.0 API
http://java.sun.com/webservices/downloads/webservicespack.html - Java Web Services Developer Pack 1.3, a worthy download that comes with Tomcat, JSTL 1.1(JSP Standard Tag Library which you'll want to learn if you take JSP seriously since it simplifies coding -alot-, You can also build your own tag libraries but this is basically a standardized one with alot of helpful things) and Java API for XML classes(JAX, as well as many other classes for other Java -> XML interfacing).
Eventually, I'm going to strongly suggest BEA WebLogic 8.1 Platform which is the best damn application server/tools for it, It's great to learn under but I basically learned under WebLogic 5.1 which was alot less complicated then 8.1 :p
http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html - Java Servlet 2.4 Spec, Granted you wont be writing servlets it has info on the request and responce objects.
http://java.sun.com/products/jsp/syntax/1.2/card12.pdf - Syntax reference card - very helpful for beginning. Its for the 1.2 Spec but I beleive all of it is still valid.

Ok, references and materials aside. JSP is quite fun to program with well until you try interacting client side and server side. JSP is strictly server side so you have to use alternative methods for interacting client side like EJB or mainly JavaScript. Even then JavaScript can not so basically you'll find yourself with one page for the form and then submitted to the next page, I often use the the URI header and thats generally when you'll use the servlet request object, to get the URL/URI/IP Address and such. I think you should look into it some more, then I can perhaps give you some more tips, I seriously doubt random logic is any help right now but let me know.

Edit: PS: CGI??? lol
December 19, 2003, 6:59 PM
iago
I should also note I'm going to be working from a Solaris machine. But since this is Sun's, I'm sure they have binaries for all platforms.
December 20, 2003, 3:45 AM
Hostile
right, everything I mentioned you can get for linux/solaris/windows :P but iirc you still run windows at home and I'm guessing you don't have solaris there so might wanna download same stuff for windows too, for practice.
December 20, 2003, 5:43 AM
iago
[quote author=Hostile link=board=34;threadid=4345;start=0#msg36438 date=1071898990]
right, everything I mentioned you can get for linux/solaris/windows :P but iirc you still run windows at home and I'm guessing you don't have solaris there so might wanna download same stuff for windows too, for practice.
[/quote]

Excellent!
Right.
Wrong - it's just not installed yet
Good idea.

:)

btw, thanks for all the links, I'll look at them later this week :)
December 20, 2003, 1:31 PM
iago
Ok, now that I've been buried, I have a problem. How do you compile/run servlets?

I have a test server that Thing set up for me, and I have a .java/.class for Hello World. It lives in:
/examples/WEB-INF/classes/HelloWorldExample.java and HelloWorldExample.class
I downloaded the .java, changed the name/class name to HelloWorldExample2.java and .class, and uploaded it to the same spot, but when I try to run it from the same url as HelloWorldExample.class, I get a 404.

My point is, how do I tell it I added the class, and want to be able to run it?
January 7, 2004, 1:46 AM

Search