Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getInitParameter problem  RSS feed

 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends, like always I took the example from HFSJ(ch 8,page 382) LOL
Eclipse 3.x.x
Tomcat 6
jsp 2.0 spec



friends,I always get null while I use getInitParameter() to get parameter.

[ March 21, 2008: Message edited by: omi sharma ]
[ March 21, 2008: Message edited by: Bear Bibeault ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything looks fine. Did you set the context-param in the right web.xml ? And did you restart the container ?
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes brother I did correctly everything but it returns null.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know with servlets you have to give it a name in web.xml. since a jsp is actually a servlet, I am thinking it's the same thing. So try to see if you can access the init parameter by naming the jsp instead of using the default name. The knowledgeable folks will probably have a better answer.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edited version:

Well, friend I solved the problem.LOL
I had to add <web-app></web-app> tag to get values.

now everything is fine.

catch you guys later with a new problem. :p

best regards,
omi
[ March 21, 2008: Message edited by: omi sharma ]
 
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!