Originally posted by: halik
Originally posted by: IHateMyJob2004
Originally posted by: halik
Originally posted by: IHateMyJob2004
Originally posted by: halik
jsp is not one of those things. JSP is java code embedded into html that gets parsed into a java class, compiled and ran with the VM during runtime.
This is what I get for working under morons at my company. TOTALLY CLUELESS and the "software lead" actually knows more than me but I want to kil lmyself when she says stuff liek this. She has no idea how to be a leader.
Best way to think of JSP is that they are on-the-fly servlets. What actually happens is that the code gets pasted into a blank servlet and gets compiled and run and the output is assembled with the static text inside the file.
The bytecode is actually compiled the first time you access the JSP, so it's a lot faster than php or other CGI languages.
You jsut made my brain flip inside out. I do understand the speed benefit though. Thanks for explaining that.
I geuss the thing I am getting at is that if the output is HTML for example.... all of hte details in the JSP file are hidden. So if you get data from a database, the table names are hidden from the end user.
Alright what happens when you access a jsp file.
The server will grab the whole thing and put it into a regular java servlet. Anything in between the <% %> tags gets parsed as java code. Anythign outside those gets included as static text. Then the whole thing is executed and you get plain text output.
IE:
jsp like this:
<html>
<body>
<%
out.print("hey");
%>
WHAT UP!
<%
out.print("nuffin");
%>
OH AIGHT
</body>
</html>
turns into servlet with:
out.print("<html>\n<body>");
out.print("hey");
out.print("WHAT UP!);
out.print("nuffin");
our.print("OH AIGHT \n</bdoy>\n</html>");
and the code gets executed as a servlet. The acual way i slightly more complicated and the static stuff gets goofed around, but the principle is the same.