What is the difference between variable declared inside a declaration part and variable declared in scriplet part?

Variable declared inside declaration part is treated as a global variable.that means after convertion jsp file into servlet

  • that variable will be in outside of service method as an instance variable
  • the scope is available to complete jsp and to complete in the converted servlet class.

Variable declared inside a scriplet that variable will be declared inside a service method and the scope is with in the service method.

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

  |   |