Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I declare a variable inside Jsp_init()  RSS feed

 
John Francis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am aware of the jsp elements like declarations, scriptlets , directives , expressions. But the code with these elements land up either on class level or inside service method.
Can I declare a variable inside the init() of the jsp without overwriting the init() fully.

Thanks for your answers.
John
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of those elements that you mention are artifacts from JSP 1.x and have been discredited since the inception of JSP 2.0 over eight years ago. I'd advise setting sights on the present and future of JSP rather than far past.

Unless you are asking because you need to support a very old legacy application?
 
John Francis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bibeault.
I have worked with jsp 1.2 for a few months and in a recent interview I faced this question.
I tried searching for the answer in google, but could not find one. The question asked was- Is there a way I can declare a variable inside the init() without overriding the whole init()?

I really appreciate your answers.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone asked you that as an interview question?!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!