FAQ


Advertisement



How to translate code bewteen JSP to Servlet?

  • JSP scriptlet (i.e., <% scriptlet %>) and experssion (i.e., <%= expression%>), when translated into a servlet, will end up in the body of doGet or doPost method.
  • JSP declaration (i.e., <%! declaration %>), when translated into a servlet, will end up being instance variables or methods in the servlet class.
  • A variable defined inside of a JSP declaration could translate to an instance variable and a variable defined inside of a JSP scriptlet could translate to a local variable in doGet or doPost method.
  • You may have jspInit() or jspDestroy() methods defined in the JSP declaration. They are equivalent to Servlet's init() and destory() methods.


Printer-friendly version Printer-friendly version | Send this 
article to a friend Mail this to a friend

Previous Next vertical dots separating previous/next from contents/index/pdf Contents

  |   |