• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

easier way to tell the difference of these??

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always can not understand and remember the JSP .

<%
<%!
<%@

anybody has an easier way to tell the difference? Actually I almost hate the JSP. anybody has a way to learn JSP?

thanks
 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is one more construction :

<%=

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<%

Since the tag contains nothing after "%", you can think that you need to write CODE within this tag.

So, all codes in this tag MUST be valid Java Code.


<%!

! means declaration. You may think that something is important that MUST be declared.


<%@

@ sounds like "at", which means "at"tribute, which means it is the page attribute.


<%=

"=" means equals, which means the output equals to the RHS expression.

Did you feel better to memerize them?

Nick
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick, you are GREAT ! Thanks.

You said, <%@ --- attribute, so your hints are , "all of these attributes are done in the translation phase ", even including --- <%@ taglib %>.

My understanding is right?

Thanks.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent tips, Nick... It's really helpful for JSP beginners, I'm sure...

One thing is that experienced JSP programmers might not need to crack things like this, since they always get in touch with those things in the job... Anyway, it's good for the exam aspirants as well...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You said, <%@ --- attribute, so your hints are , "all of these attributes are done in the translation phase ", even including --- <%@ taglib %>.

My understanding is right?

YES, you are correct.

Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic