ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
what are the jsp tags with example?
 Question Submitted By :: Gopalraop
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what are the jsp tags with example?
Answer
# 1
(1)A declaration tag places a variable definition inside 
the body of the java servlet class. Static data members may 
be defined as well. Also inner classes should be defined 
here. 
Example:<%! int serverInstanceVariable = 1; %>

Declaration tags also allow methods to be defined.

<%!
  /** 
   * Converts the Object into a string or if
   * the Object is null, it returns the empty string.
   */
  public String toStringOrBlank( Object obj ){
    if(obj != null){
      return obj.toString();
    }
    return "";
  }
%>

(2)A scriptlet tag places the contained statements inside 
the _jspService() method of the java servlet class. 

<% int localStackBasedVariable = 1;
out.println(localStackBasedVariable); %>

(3)An expression tag places an expression to be evaluated 
inside the java servlet class. Expressions should not be 
terminated with a semi-colon . 

<%= "expanded inline data " + 1 %>

(4)Also we can use the following tag to give comments in 
jsp: 

<%-- give your comments here --%>
 
Is This Answer Correct ?    1 Yes 0 No
Sivasubramanian.k
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Explain Connection Pooling?  2
What is the differnence between String Buffer and String builder despite having knowledge that String builder is faster than String Buffer and last one is threadsafe.please tell another important difference.  2
What is the default initialized value of String type variable?  3
Without creating a new object, How you can retrieve a String or other object?  1
Difference between the paint() and repaint() methods?  1
what is the purpose of the final in the try-catch-final  4
What is the is a and has a relation ship in oops concept in java? BearingPoint5
What is meant by final class, methods and variables?  2
What is the difference between this() and super()? TCS5
what is meaning of JIT?  2
Can an abstract class be final?  3
what is the use of private constructor in core java? Satyam3
different types of threads? TCS5
What is the preferred size of a component?  1
What is hash method?  1
can we declare private class in java file?  4
how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access? Verizon1
Default layout of Dialog object?  1
what is the purpose of method overriding in java where v r completely re-defining a inherited method instead y can't v create a new method and define.If the question is very silly plz excuse me and do reply.Thank U!  3
By what default value is an object reference declared as an instance variable? Wipro1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com