• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Where i cud put contex-param

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rancher,
Cud anybody tell me where i cud put context-param in the deployment descriptor,
i tried to put inside servlet tag but it does not work like this
<servlet>
<servlet-name>ServletDemo</servlet-name>
<servlet-class>servletDemo</servlet-class>
<context-param>
<param-name>MyParam</param-name>
<param-value>MyParamValue</param-value>
and i tried to put under web-app also , it does not work out like this
<web-app>
<context-param>
<param-name>MyParam</param-name>
<param-value>MyParamValue</param-value>
</context-param>
<web-app>
. so cud u tell what is location to put the contxt-param .and i am getting the error on cmd prompt saying we cud not put the context param in servlet or some times server does not start.so what cud be problem
thanks in advance
..gaurav
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The context-param element declares servlet context initialization parameters for a Web Application. So it should be part of <web-app> </web-app>. You set each context-param within a single context-param element, using <param-name> and <param-value> elements. You can access these parameters in your code using the javax.servlet.ServletContext.getInitParameter() and javax.servlet.ServletContext.getInitParameterNames() methods.
I tried it and it works beautifully with Weblogic Server.
Send me your code if it still does not work.
Rohit
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

"Cgaurav"
your name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing the
guidelines at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- satya
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
Rohit now its working fine ,and Madhav now i am using the rancher policy for the name .
------------------
with warm regards
..gaurav
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Appreciate your cooperation.
- satya
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
you have put <web-app> at the end of code instead of </web-app>

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic