Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Getting Context Parameter from ServletContext
Getting Context Parameter from ServletContext [message #485013] Thu, 10 September 2009 09:08 Go to next message
Martin is currently offline MartinFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

I am using tomcat to deploy my .war file. Everything works, but I cannot
access a context parameter from my web.xml.

I try to get it with:

(String)
RWT.getSessionStore().getHttpSession().getServletContext().g etAttribute( "PROVIDER_URL");

in my web.xml I specified:
<context-param>
<param-name>PROVIDER_URL</param-name>
<param-value>jnp://anotherurl</param-value>
</context-param>

Unfortunetly, when I debug (inspect) the ServletContextAdapter
"RWT.getSessionStore().getHttpSession().getServletContext()", I can access
under

ServletContextAdapter
|-->servletContext
|-->context(ApplicationContext)
|-->context(StandardContext)
|-->parameters

exactly what I defined.

But using getAttribute("PROVIDER_URL") gives me null.

What is the problem with this?


Thanks for your help.

Martin
Re: Getting Context Parameter from ServletContext [message #485046 is a reply to message #485013] Thu, 10 September 2009 11:19 Go to previous messageGo to next message
Vasko Tchoumatchenko is currently offline Vasko TchoumatchenkoFriend
Messages: 2
Registered: July 2009
Junior Member
Hi Martin,

You need getInitParameter(), not setAttribute(), to access the context
initialization parameters.

HTH
-vasko
Re: Getting Context Parameter from ServletContext [message #485084 is a reply to message #485046] Thu, 10 September 2009 13:51 Go to previous message
Martin is currently offline MartinFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks vasko!

That was exactly what I needed.

Martin
Previous Topic:TreeViewer questions
Next Topic:Images in Table HTTPS IE
Goto Forum:
  


Current Time: Fri Apr 19 06:33:29 GMT 2024

Powered by FUDForum. Page generated in 0.23202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top