File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP  vs HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP  vs HTML" Watch "JSP  vs HTML" New topic
Author

JSP vs HTML

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

HI All,

suppose,in jsp i defined <%%>(scriptlet) code as well as <input/>(html tag)...

-----------------------------------------------------------
my question is
1.which one is understand by server first

2.which one is displayed on browser(understand by) first
--------------------------------------------------------------
please anyone explain me in detail...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The best way to understand this is to use the "view source" feature of your browser.

Scriptlet tags are never seen by your browser.
HTML tags are nothing more than text to the server.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by Ben Souther:

HTML tags are nothing more than text to the server.[/QB]


ok Ben,then html tags or scriptlet which one will understand by server first(means priority)
Soroj Margun
Ranch Hand

Joined: Jun 15, 2008
Posts: 44
Hi seetharaman,

At first server will *compile* JSP and execute whatever you define in JSP page (both tag and scriptlet). After that the result text will be merged with normal HTML code.

Hope this help.


SCJP 1.2; SCWCD 1.2,1.4; SCBCD 1.3; SCJD 5.0
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by seetharaman venkatasamy:


ok Ben,then html tags or scriptlet which one will understand by server first(means priority)


"First" isn't a valid question.
HTML is never interpreted on the server.

All scriptlets, custom tags, JSTL, and EL expressions are interpreted by the JSP compiler. Everything else becomes println(..) statements (including your HTML, CSS, and Javascript).

None of the server side constructs ever make it down to the browser.
Again, get in the habit of always looking at the HTML source from the browser to help get your head around this.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

I GOT IT...THANKS
 
Consider Paul's rocket mass heater.
 
subject: JSP vs HTML