can anyone tell me what is the difference between javaservlet & jsp. and which is the best of them? thank'z in advance bye.
------------------ Sagar Surana optimist
Sagar Surana<BR>optimist
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
A JSP is just another way of constructing a servlet. Choosing one or the other depends on what you are trying to create. If the HTML pages you want to create are heavy on the HTML and don't need much Java code, JSP is worth looking at. If you creating functions that can be expressed as custom tags, JSP is what you want. If your application involves a lot of decision making and branching, a servlet is what you need. You can also combine a decision making servlet with JSP pages that handle various specific types of output. I suggest getting comfortable with writing servlets first so you can understand basic ideas and limitations of servlets. Servlets are easier to debug. Bill
aren't servlets dying down with the advent of JSP. Doesn't a jsp engine comiple a JSP into a servlet after it is accessed the first time? If the jsp requires lot of branching and complex programming stuff, wouldn't creating a bean (multi-tier) and still using JSP not a solution? Need clarification!!
Thanks Zaeem
sandeep vijan
Greenhorn
Joined: Dec 28, 2000
Posts: 7
posted
0
servlets are used for small projects. for medium to large projects use jsp.
. ))<BR>. ((<BR>. C|~~|<BR>. `--'<BR>. JAVA
Danny Mui
Ranch Hand
Joined: Dec 14, 2000
Posts: 42
posted
0
IMHO, Servlets should be only used as dispatch/processing modules (ie. posting to or some other specialized task). JSPs should be used for presentation. This argument is made because clients I've worked with don't necessarily agree with my web-designers and they work out the kinks. I don't want a web-designer mucking around in my servlet code, it's harder to totally ruin a JSP page. If they do, it's their fault haha .
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
aren't servlets dying down with the advent of JSP. NO! (Many people consider JSP to be Ugly Tech) Doesn't a jsp engine comiple a JSP into a servlet after it is accessed the first time? To be precise - WHEN it is accessed for the first time. If the jsp requires lot of branching and complex programming stuff, wouldn't creating a bean (multi-tier)and still using JSP not a solution? There is a near infinity of possible architectures, some people swear by a single servlet which takes all requests, decides what to do, and dispatches the request to the appropriate JSP for output. Like everything else in computing - consider the task at hand, don't just blindly apply the current buzzword technology. Bill (Who personally writes pretty big servlets)
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Thanks Bill Zaeem
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.