I recently attened a workshop on JSP's and was suprised to find out that Really JSP are nothinbg but a Servelt in disguise?
Is this true.
Well I think the Point may be valid.
Both JSP's and Servelts can generate HTML pages and have JAva code in them - Correct?
I was also informed the really when a JSP is executed it is in fact calling a servelet POST method - is this true?
My other question is about over head. are JSP's heavy components and would it be beter to have java code in a true Servelet and let JSP's handle the HTML part.
If I am building say a shopping cart example where is the best place to have the HTML for displaying a page?
No, it is not true that when a JSP page is executed it is calling a servlet POST method. It is the geenerated servlet class file that is getting called and executed. There is a lot more to it than I am posting though. It's good to get a very good understanding of servlets before taking on JSPs.
Originally posted by Manish Hatwalne:
Moreover, what u can do in 4/5 lines using JSP may take 25/30 lines code for a servlets. Also, HTML is embeded inside servlet code which again is not desirable. JSP code however must be less than 64 K, AFAIK. Pls. correct me on this one if this info is obsolete.
The solution is usually to break the text up somehow :- either split the page into several separate JSPs and "include" them when the main pag is displayed, or load the page text from somewhere else (a file, JNDI, a session, another URL, a ResourceBundle, a database etc etc.) and show it under program control.
In general, though, you shouldn't need to worry about it until you get a class file size exceeded error message, then remember this thread!