JSP includes XHTML, XML and Java

Sep 29, 2004
18,656
68
91
I know it's the wrong forum, but I needa quick response...

I am a software engineer, stuck on an IT project. I always thought JSP was seperate from XML, XHTML and java.

JSP uses those others technoolgies but is not XHTML, XML and Java
 

halik

Lifer
Oct 10, 2000
25,696
1
0
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.

You can set up tomcat/whatver to parse which ever files you want - xml, html, asp etc. The only thing that matters is that the server is able to find the java inside the file and make a class out of it to run.
 
Sep 29, 2004
18,656
68
91
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.
 
Sep 29, 2004
18,656
68
91
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.

You can set up tomcat/whatver to parse which ever files you want - xml, html, asp etc. The only thing that matters is that the server is able to find the java inside the file and make a class out of it to run.

The java "code" is interpretted on the server, correct? And the end user just gets HTML... I thought the point of JSP was to had database details and other details you don't want the user to see.
 

halik

Lifer
Oct 10, 2000
25,696
1
0
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.
 
Sep 29, 2004
18,656
68
91
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.

 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Stupid bosses suck.

xHTML and XML and both markup languages.. totally nothing to do with JSP except probably JSP can output data in one of these markups.. can I say that JSP is just a subset of Java though? I'm sure your lead is going to confuse Java with Javascript too :p
 
Sep 29, 2004
18,656
68
91
Originally posted by: notfred
What company do you work for? I want to remember not to send them my resume.

I'd tell you, but I don't want to risk getting fired. This place sucks. I came here to work on embedded systems, not web pages. But I am indeed surrounded by morons and the people I respect with experience tell young people to leave this place because they know how bad it is here.

I work for a prominant defense contractor...that's all I'll say.
 

halik

Lifer
Oct 10, 2000
25,696
1
0
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.
 
Sep 29, 2004
18,656
68
91
Originally posted by: screw3d
Stupid bosses suck.

xHTML and XML and both markup languages.. totally nothing to do with JSP except probably JSP can output data in one of these markups.. can I say that JSP is just a subset of Java though? I'm sure your lead is going to confuse Java with Javascript too :p

HAhahaahhaah.... we've already been down that path. She said we wern't using java script, but never could give a reason. Took her weeks to finally realize that people were confused about the technology choices she is making.

One guy was told to do a prototype. Deadline...2 weeks. End of first week. "Why are you doing it in HTML?". No direction being the answer. Then he uses Oracle Reports. Then he was asked why he made the reports look that way. The lead then says, "I want them to look like this document. Upon being asked how long she had those documents handy, she said 3 weeks. Never bothered to tell the developer up front what tech to use and that she had these documents handy.

I can start a new thread about this project. It's quite pathetic. Also, like trying to pound it into her head that we can't go to the customer and tell them that we asusme certain technologies will work. This being in repsonse to what is concerns in short comings i nthe prototyping we are doing. Took her WEEKS to realize or cocerns and to explain to us in about 5 minutes why our concerns are unfounded.

Hell, after 6 months, she finally managed to get the phrase "I don't know" out of her mouth. Nothing like a lead that gives assumptions as answer most of the time.

Oh, then I was told to do something in a document. A month later she was in a meeting and someone asked about why the document was done a certain way. They had to call me into the meeting to ask why I did it that way. I told them that it was by direction. And then the lead blames someone that's not there. I WAS SO PISSED. I was about to snap and tell her ... NO! YOU SAID TO DO IT HTAT WAY YOU DUMB FVCK.

80% of the people don't want ot be on this project, but there is nothing else to do. IT SUCKS.
 
Sep 29, 2004
18,656
68
91
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.

Cool! Thanks....I think I ge tit now. It's stuff I have read about but not done yet. I think we are on the same track now.
 

MaxDepth

Diamond Member
Jun 12, 2001
8,757
43
91
I build jsp pages for this big company I work for.

JSp is handy because certain HTML coding can be handled with include files. This means certain parts of a page will be indentical with all the other pages regardless of who else is coding. Also, I can build templates that others can input context data that will be parsed along with the template through Tomcat to produce web pages.

So what you see when you view source on a page is actually formatted out from the Tomcat engine within WebSphere Application Server. It's not idiot proof but it slows down the more dangerous idiots.


Example:
in the jsp file:
<%@ include file="/main/inc/lang/en/alt-header-1.inc" %>
<%@ include file="/main/inc/lang/en/alt-header-2.inc" %>

Produces close to 80 lines of code for our webpage masthead. (example: http://www.ibm.com/software/info/mgmt/central/index2.jsp - the black banner at the top of the page)


It is the pathway to the future of the web when many things will move to a Portal active page. Where you as a end user will have content appear as you receive live data. Right now, HTML is a static page that does not update (meta refresh is not a content live mode)
 

johnjbruin

Diamond Member
Jul 17, 2001
4,401
1
0
Originally posted by: IHateMyJob2004
Originally posted by: notfred
What company do you work for? I want to remember not to send them my resume.

I'd tell you, but I don't want to risk getting fired. This place sucks. I came here to work on embedded systems, not web pages. But I am indeed surrounded by morons and the people I respect with experience tell young people to leave this place because they know how bad it is here.

I work for a prominant defense contractor...that's all I'll say.

Oh my god. Are you my neighbor at work?