/    Sign up×
Community /Pin to ProfileBookmark

JSP/Tomcat Question

[font=trebuchet ms]Hey guys,

I was looking over a lot of Java-related documents over at Apache.org a few minutes ago, remembering that Java was ideal for XML parsing, and became interested in learning to use the Java Server Pages (JSP) technologies. I was curious, though, if there were any outstanding features of Java over other common scripting languages such as ASP, Perl, Python, or PHP, before I invest my time in learning new syntax for a new language which may otherwise be unnecessary.

Thanks.[/font]

to post a comment
Java

26 Comments(s)

Copy linkTweet thisAlerts:
@chrisranjanaAug 31.2004 — Want to feel good about java here you go

http://java.about.com/od/javaadvocacyandcriticism/
Copy linkTweet thisAlerts:
@PeOfEoAug 31.2004 — Personally I hate java. I know it, took the ap and passed it, so I have a college credit in it. But I cant stand it. JSP is powerful because java is oo, but jsp lacks language flexibility and will lag like crap when it first compiles. Asp.net is OO as well, and it compiles on app start as well, yet it will not lag like jsp. The only thing jsp has over asp.net right now is that jsp will go cross platform seamlessly, but asp.net will catch up with jsp soon enough. Asp.net is also event oriented.

Because all of the languages used with asp.net are oo and php is now oo java does not have anything over them. Php is server parsed html though, while jsp and asp.net compile at app start.

Also I do not see how java would be supeior over other things at xml parsing.

Ps: Jona, asp is not a language. Its a technology. Asp commonly uses vbscript but can also use jscript, perl, etc.

Asp.net is not a language either, it most commonly uses vb.net or c#, but has a wider array of languages that includes c++.net, j#, delphi, so on and so fourth.
Copy linkTweet thisAlerts:
@buntineAug 31.2004 — I have been a Java programmer for quite a while and love it. Its by far the best environment I have ever developed in. Peo is not an OO programmer, hence the reason he hates it.

Though, if you enjoy OO, definetaly have a go at JSP.

Regards.
Copy linkTweet thisAlerts:
@ray326Aug 31.2004 — I won't get into the "my language is bigger than your language" battle but the primary difference between JSP and the others you listed is that it is not a scripting language. It's a specialized source that is essentially HTML with additional tags that is compiled into a servlet.

Why Java? It's compiled OO, runs on about any machine architecture and OS, the syntax of the language is nice, there is a monumental set of interface libraries, there's a nice set of supporting tools, it's easy to move back and forth between it and C# and that helps unify your outlook of both the J2EE and .Net platforms.

If you decide to pursue Java then I'd recommend you do it in Eclipse and have a look at MyEclipse for a nicely pre-configured set of J2EE plugins at a super price. My primary job is WebSphere development so I've got the IBM configured Eclipse IDE running on the laptop sitting here just to the left of this keyboard.
Copy linkTweet thisAlerts:
@neil9999Aug 31.2004 — Just a note, when I got this computer (it's windows XP, got it about 2 years ago) I had alot of trouble installing the Java viewer.

Neil
Copy linkTweet thisAlerts:
@JonaauthorAug 31.2004 — [font=trebuchet ms]Thanks guys. I've had experience in VB, Peo, but the main reason I didn't like the language was because it was hard to read -- the syntax is almost like pseudo-code and I can never tell when a statement begins or ends. I'd heard that Java has open-source applications to parse XML and is very unique in that area, but perhaps I misunderstood.

So from what I understand, Java and ASP(X) are not precompiled languages like PHP and Perl are? So in order to write Java/ASP code, I'd have to have a compiler to write applications. How does that apply to the Web, though? A request is sent to the server, it runs a *.jar/*.aspx application based on one of the supported languages, and the output of the application is what is printed on the web page? How exactly does that work? I'm interested in expanding my language fields, but if Java/ASPX must be compiled, I may go with CGI/Perl or Python for now...

Also, as far as OOP, I've never had much experience in the area. What are its advantages? When I look at OO code, it seems extremely redundant... I can understand how classes etc. are used to save coding space, but in the same way you can use a simple function, can you not?[/font]
Copy linkTweet thisAlerts:
@PeOfEoSep 01.2004 — [i]Originally posted by buntine [/i]

[B]I have been a Java programmer for quite a while and love it. Its by far the best environment I have ever developed in. Peo is not an OO programmer, hence the reason he hates it.[/B][/QUOTE]
Yes I am, infact I have said that before in another thread and you neglected to read that. I said I have not made much use of it with asp.net, I have not dug into polymorphism, inheritance, etc from the server. I used it when I used java. I do not like java because I think it takes too long to compile and run (on any platform, though jsp will run fast enough after compiled) and that its syntax is retarded. I can remember sitting in computer class twiddleing my thumbs waiting for the stuff to compile, we were on crappy boxes so that obviously added to it, but c++ blazed past it. I also had thought that c++ runs faster on linux then java (dono about mac because isnt its swing made up of java?). I have used c++ before and find it to have a much nicer syntax.

No, jsp and asp.net are compiled, php and perl are not, that does not mean that you have to compile it before you upload though. The server compiles it all when it is first requested, it stays compiled through the application length. OOP can be a big time saver for one thing, I found myself using inheritance a whole lot when I was using java
Copy linkTweet thisAlerts:
@JonaauthorSep 01.2004 — [font=trebuchet ms]I've never written any applications before, but I think it would be an interesting experience and also a useful one. I've read up on some C++, but the environment that I've developed in has always been very difficult to use (free compilers suck), and I never really could grasp how it worked. What's more, I had no idea what kind of a program to create, and I couldn't figure out how in the heck I was supposed to make menus. I later learned that the Microsoft .NET package has some sort of an application designing option, which generates the basic user interface code for you. I tried Visual BASIC again afterwards, but it never really seemed to have any usefulness to me... I have tons of C++ books that were given to me, but I can't quite figure it out. I know it will be important for me to have experiences in these languages - VB, Java, and C++ - but I don't understand how they can be useful.[/font]
Copy linkTweet thisAlerts:
@PeOfEoSep 01.2004 — visual basic differs from the other stuff because when you use visual basic to code you have the interface at your finger tips, it was designed for makeing light weight applications with a gui, its used extensively for software within businesses. I know our school board hired a bunch of vb shmucks to make their book checking stuff... they could have come to our classroom when we were sophmores and had us do it as a project :rolleyes:.

But java and c++, you have to hard code the interface. I mean you request the packages and then basically say where you want them within code. http://jan.netcomp.monash.edu.au/java/tut/tut.html
Copy linkTweet thisAlerts:
@JonaauthorSep 01.2004 — [font=trebuchet ms]Looking at that code, Peo, it's understandable... What kinds of things would it be used for, though?[/font]
Copy linkTweet thisAlerts:
@buntineSep 01.2004 — 
Yes I am
[/quote]

Hang on, you told me that you had not ever done much Java. Infact, you said that you have never even done anything outside of the command window. Such as the AWT and Swing packages.
Copy linkTweet thisAlerts:
@PeOfEoSep 01.2004 — [i]Originally posted by buntine [/i]

[B]Hang on, you told me that you had not ever done much Java. Infact, you said that you have never even done anything outside of the command window. Such as the AWT and Swing packages. [/B][/QUOTE]
No, I have not done much [i]practical[/i] java. We did ap style java. It was all in a prompt. But we did do a lot of java. I wish we would have learned the gui though. I have a college credit in java now, I have downed a few cups of java, and I think they tasted aweful.
Copy linkTweet thisAlerts:
@buntineSep 01.2004 — You said the only thing that you didnt like about Java was the syntax. How could you like C++? It has very similar core syntax.
Copy linkTweet thisAlerts:
@ray326Sep 01.2004 — I'd heard that Java has open-source applications to parse XML and is very unique in that area, but perhaps I misunderstood.[/quote]There are several XML parser packages, probably more than any other particular language but people have written parsers for almost any high level language out there at this point.

So from what I understand, Java and ASP(X) are not precompiled languages like PHP and Perl are?[/quote]I'm not sure I follow that. Java and the .Net languages run from precompiled modules. So in order to write Java/ASP code, I'd have to have a compiler to write applications.[/quote]Yes but "application" has many meanings. How does that apply to the Web, though? A request is sent to the server, it runs a *.jar/*.aspx application based on one of the supported languages, and the output of the application is what is printed on the web page? How exactly does that work? I'm interested in expanding my language fields, but if Java/ASPX must be compiled, I may go with CGI/Perl or Python for now...[/quote]You're thinking in terms of CGI. Java and .Net servers don't work like CGI at all. When they load objects for their web apps, those objects are loaded into the context of the web/app server for the life of the application, which is often until the server is rebooted the next time. CGI creates a separate process at the OS level and connects to its I/O streams. When the CGI service ends that process is destroyed and the CGI app exits. It's a very different way of thinking about your application.

Also, as far as OOP, I've never had much experience in the area. What are its advantages? When I look at OO code, it seems extremely redundant... I can understand how classes etc. are used to save coding space, but in the same way you can use a simple function, can you not?[/quote]
OO is fundamentally a different cut at the problem of developing software to satisfy business requirements. It gets you to the same place but it hopes to get you there along a better path. It's more process than language. You can do OO analysis and OO design then code the design in C or COBOL, translating the OO concepts into the procedural concepts of library cohesion and coupling and data structures. The OOP languages eliminate the need for that design translation by directly expressing the OO concepts in their syntaxes.

One of the primary things people have told me as they moved into OO platforms is they never realized how much more powerful the OO embodiment of "reuse" is. Most procedural programmers think "reuse" is synonymous with "cut and paste". That reuse happens at the source level. Reuse in OO platforms happens much more directly. As you've seen with C++ that can make it hard to understand how to make a program at all when so much of what needs to be done is already done for you.
Copy linkTweet thisAlerts:
@PeOfEoSep 01.2004 — [i]Originally posted by buntine [/i]

[B]You said the only thing that you didnt like about Java was the syntax. How could you like C++? It has very similar core syntax. [/B][/QUOTE]
Its some of the keywords in particular, and how java gets so fussy about parsing this into this and this into this, and it saved me some time when I used css. But I do not know much css. Also everyone just seems to claim that java's greatest advantage is that it can go anywhere, but so can c++....

If you like java, then more power to you, but I came to the conclusion that I do not like it as I was learning it.
Copy linkTweet thisAlerts:
@Khalid_AliSep 02.2004 — [i]Originally posted by Jona [/i]

[B][font=trebuchet ms]..I'd heard that Java has open-source applications to parse XML and is very unique in that area, but perhaps I misunderstood.

[/B]
[/QUOTE]

you did not misunderstand...there are ton of open source parsers available out there which you can use to parse XML using Java, just go to w3c.org or xml.org you will see their tools section is full of tools written in java or integrating with Java. As a matter of fact you can use Java classes right inside of your PHP code..

[B]

I'd have to have a compiler to write applications. How does that apply to the Web, though? A request is sent to the server, it runs a *.jar/*.aspx application based on one of the supported languages, and the output of the application is what is printed on the web page? How exactly does that work? [/font] [/B]


When you use Java(jsp or servlets) in a web server,the web server is typically a servlet engine, so it knows that you are trying to access jsp/servlet code. Tomcat is the most popular free open source servlet engine out there(you can configure your apache web server to pass on the jsp requests to tomcat).

When a request is processed by a servlet engine, and the first time when a jsp is accessed its compiled( to a servlet) and then its served.After that its lightening fast.

I think one can see that with the programming languages there is a natural progression towards the best programming language.

C was evolved to C++, then C++ was evolved to Java( has its own handicaps), Now C# is supposed to be the next step(most of us are skeptical because MS usually doesn't do anything to help the industry)

C++ syntax is almost look alike to that of Java syntax.

And C# is for sure 99% Java programming language...

You have 2 options,if you like to be part of the open source community(ocourse java definitly has its advantages over MS technologies) go for Java otherwise ASP is your technology

P.S if you want to look into JSP's look straight into Struts...
Copy linkTweet thisAlerts:
@PeOfEoSep 02.2004 — C++ and java are quite similar, java just has some irritateing little things that really tick me off, it just seems to be so much more fussy and anal retentive IMO. AP comp sci was not a positive experience for me ?
Copy linkTweet thisAlerts:
@JonaauthorSep 02.2004 — [font=trebuchet ms]I'm thinking learning JSP/Java would be good for my portfolio and for myself. Thanks everyone, I'm going to try out Tomcat and Struts, and see what I can use this stuff for. I have just one more question that I'm still unclear on... What can Java do that PHP can't?[/font]
Copy linkTweet thisAlerts:
@PeOfEoSep 02.2004 — [i]Originally posted by Jona [/i]

[B][font=trebuchet ms]What can Java do that PHP can't?[/font] [/B][/QUOTE]
executable applications

applets

those are the first things that pop in to my mind. I have never used php so I can't say any more on that.
Copy linkTweet thisAlerts:
@JonaauthorSep 02.2004 — [font=trebuchet ms]Can I begin writing Java right away, or do I need a compiler; and if so, how/where do I get one, and how much does it cost or is it free?[/font]
Copy linkTweet thisAlerts:
@PeOfEoSep 02.2004 — www.jcreator.com there you go, all set.
Copy linkTweet thisAlerts:
@JonaauthorSep 02.2004 — [font=trebuchet ms]Thanks, I'll get right into it. ? [/font]
Copy linkTweet thisAlerts:
@ray326Sep 02.2004 — Grab Eclipse and you'll be set. It has the JRE and JDK it uses bundled and can run the apps you build right from the IDE. Making your app standalone is a simple export to a jar file. For J2EE you can't beat MyEclipse for value ($30/yr with a 30 day free trial). If you want to do the work yourself you can find the plugins and install them for free.
Copy linkTweet thisAlerts:
@Khalid_AliSep 02.2004 — I think for Java IDEs you can use several tools, SUN One from Java is all right,but the best one that I know of is "IntelliJ".

I had always used JBuilder,but as soon as I tried intelliJ I was hooked on to this.its probably most productive IDE for Java development out there...
Copy linkTweet thisAlerts:
@onthinkSep 05.2004 — agree to the opinion above
Copy linkTweet thisAlerts:
@JonaauthorSep 05.2004 — [font=trebuchet ms]Thanks, everyone. ? [/font]
×

Success!

Help @Jona spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...