Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP vs HTML

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I GOT IT...THANKS
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic