getting param value

how to get the  <param-value> from web.xml to a jsp page in struts
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If your web.xml file contains something like
        <param-value>This is my param value.</param-value>

Open in new window

then in your JSP you can use
<%=config.getInitParameter("myParam")%> or <%=getInitParameter("myParam")%> 
or if you are using latest version of JSP  you can use 

Open in new window

snehavinodhanAuthor Commented:
thanks for this code in jsp......plz help me the same in struts
I don't use Struts but I think the code would be similar. I could google to see any difference. But before I do that you need to tell us what exactly you want to do. Do you want a param-value accessible  to one JSP or Servlet?  This what I posted above here.  Or do want the param-value accessible to your whole web app? For example in your web.xml file you could have the following.
> <context-param>
>  <param-name>myParamName</param-name>
>  <param-value>myParamValue</param-value>
> </context-param>

Open in new window

PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

snehavinodhanAuthor Commented:
i want the param-value in the web.xml  accessible to the whole web application....
Ok. You can read$8c4b3a70$1300a8c0@DOMINIONT%3E   
You could use something like the following in your web.xml file.

Open in new window

In your JSP use

Open in new window

i want the param-value in the web.xml  accessible to the whole web application....

The key thing you have said here is "whole web application".

If this is your requirement, then you need a servlet context param not a init param.

If you then want to access the context param, you have a handle on the request object in your struts action.

Your requirements are very loose. So its hard to say whether this is the solution you seek.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
snehavinodhanAuthor Commented:
thank you...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.