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

Confusion in setting Init Parameters for jsp  RSS feed

 
Ashutosh Mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am new to jsp.I wanted to know how can we set and retreive Init Param for jsp.
I have seen some examples but in those example they are using servlet also along with jsp.
As per my understanding a jsp is converted into servlet so we should be able to set init param(config) for a jsp as well.
I want to set init param for a jsp which only that jsp can retreive.
It would be great if any one could help me out .
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Modern practices do not include setting init parameters for JSPs. JSPs should be pure view components with no processing code of their own. Any processing is handled by the page controller for the view.

What type of data are you needing? An alternate, best-practice approach can be suggested.
 
Ashutosh Mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Modern practices do not include setting init parameters for JSPs. JSPs should be pure view components with no processing code of their own. Any processing is handled by the page controller for the view.

What type of data are you needing? An alternate, best-practice approach can be suggested.


Thanks for your reply.
Actually I am learning jsp from basics so I was just trying it out ,not for any special purpose,just want to have one application with one jsp .
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ashutosh Mehta:
Actually I am learning jsp from basics

Good. Then it is very important that you start out using accepted best practices and not fall into any bad habits that you'll need to unlearn later.

I suggest that you read a few articles that I wrote that might help you get kick-started in JSP:

The Secret Life of JSPs
The Front Man

Also, right from the start, put no Java code in a JSP. That's the old way of doing things.
 
Ashutosh Mehta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes ,You are right,Thanks for your guidance,These articles are very useful for me ,Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!