Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some help pls!! - Java definitions 2

Status
Not open for further replies.

Forri

Programmer
Oct 29, 2003
479
MT
Hi all

I'm a PHP / ASP programmer and never been into JAVA and JSP etc.

I would like to ask someone for some definitions as to what are JavaBeans and Servlets etc in comparison to ASP so i can understand!! sorry pretty sumb question.

Also a client asked me to create a website using java...to create website u have to use jsp or java or?? pls give me some help here cause i will freak out!

Tahnks
Ncik
 
I can't compare jsp and servlet with asp, 'coz I donno much of asp. But to answer ur second question,

"Also a client asked me to create a website using java...to create website u have to use jsp or java or?? pls give me some help here cause i will freak out! "

Servlet and JSP are parts of Java's technology. So you gotto know java programming anyway, to use these. You should probably put the question as "should I use jsp or servlet", because they are comparable. To answer this question, well, anything is ok, but using jsp is relatively cleaner. It depends on ur requirement too.

To give some simple example,

1) You have a plain html form. You just want to store some stuff into the database when the user submits the form. This is pure backend work, and can be done thru servlet.

2) Suppose u have a html page, that has a lot of plain html, but also has some amount of dynamic data. In this case, u can embed some tags within html (just like ASP). When the page loads, those tags will get replaced with their respective values. This is jsp, roughly.


LOL A ship is safe in the harbour, but that's not what it is meant for!!! LOL
 
Uhh! So if i can round up in my own words!

Servlets are like functions...you call them and they will perform some functions.

Whereas the JSP is to display dynamic data!

So JSP and Servlets are two different things right? Sorry to ask lots of questions but i'm really intrested in Java and its technlogy but i can't find a decent Tutorial which can explain things to me in a simple manner!!

What about EJB's, javabeans..i mean...this is my situation...

The company needs an intranet and they asked me to build it...the IT Manager asked me if Java can be used; since i'm new i would not argue with him but i showed him my point of view on PHP...on the other hand exploring a new Laguage wouldn;t be a bad idea!

Is there an IDE that i can use to write java, jsp,servlets etc. And is there a way of creating HTML on the fly without designing it with a WYSIWYG editor etc?

If i want to connect to a Database (mysql) what should i use..is it JDBC if so how would you use it?


Thanks for your concern and patience

Ncik
 
Nick :

If you are new to Java I would avoid IDE's as this abstracts you from the actual code, and you will find it harder to debug when *live* or *uat* crashes ...

I also think you should be clear in the fact that JSP is, in essence once compiled, a servlet. The JSP container (ie Tomcat / Resin etc) comiles your JSP into a servlet at runtime. The difference is that scripters can in effect create an HTML page with embedded Java between tags (<% %>) - but once it is compiled, its all the same. JSP could be described as an abstraction from pure Java code, but you need to know java to use JSP effectively without error.

JDBC is the API you must use to connect to a database.

JavaBeans are just normal Java classes with setter/getter methods.

EJB is entirely different from JavaBeans (confusingly) and is by no means for the Java/JDBC beginner.

If I were you, I'd step back and take some tutorials. There are many, many tech tutorials on (see left handside tab - "Code Examples" or "Tutorials" section of that site).
 
Well, well... I do think u r trying to do a lot at the same time. Now sit back, relax, and take it slow. Java is definitely easy once u get into it. But my advice would be not to delve into servlet or jsp or ejb at once, but learn the basic programming first. Don't even think about "can this web application be done with java?", because the answer is almost always "Yes!". So you can go ahead and commit that you can do the work, then start learning, not worrying about its feasibility.

I double sedj, don't start with IDEs. You'll end up weakening your basics. There are very powerful free editors like Eclipse that can work magic, but reserve them for later use.

To clear things a bit,
1) Go thru some java basics book. Write some simple code and check ur state.
2) Get to know Applets. They introduce u in an easy manner to "using java for the web".
3) Slowly go to servlets. Write some hello world n check.
4) Start with jsp.

Mostly, that'll be enough. To clarify what beans are, thats just a fancy term used for some simple java object (say, an Employee object, that contains some properties and methods), used in the web application. But there's more to it, ofcourse, reserve them for later study though.

For servlets and jsp, u can start from basics using this book -

The above is the pdf version of a full book "Core servlets and jsp", which u can get from the site

For java basics, getting a free book on the net is as easy as eating a cake.

Karthik.

LOL A ship is safe in the harbour, but that's not what it is meant for!!! LOL
 
Thanks both! appreciate your concern and definetly your great help!

i'll try to go through those link you gave me. I'm still trying to convince my boss why should i use One Language and note the other (Java vs PHP). I know PHP very well but i think that for this project we should need something more than PHP and that java with fit very well.


Thanks
Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top