struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Blidorf <so...@nolas.dk>
Subject SV: SV: getInitParameter("url")
Date Thu, 10 Apr 2003 11:32:22 GMT
I got it figured out - sort of!!

BUT how do I specify the servlet name.

Something like getServlet().

-----Oprindelig meddelelse-----
Fra: Deepak [mailto:deepakmr@hotpop.com] 
Sendt: 10. april 2003 12:06
Til: Struts Users Mailing List
Emne: Re: SV: getInitParameter("url")

Use this :
	String url =getServletContext().getInitParameter("url");


On Thursday 10 April 2003 04:14 pm, you wrote:
> Thanks.
>
> I am new at servlets!!!!!
>
> Where do I specify servlet name in my code?
>
> And what is the super.init(config);?
>
>
>
> What I need is to get the string of url in my web.xml
>
> -----Oprindelig meddelelse-----
> Fra: xucheng@gic.com.sg [mailto:xucheng@gic.com.sg]
> Sendt: 10. april 2003 11:04
> Til: Struts Users Mailing List
> Cc: struts-user@jakarta.apache.org
> Emne: Re: getInitParameter("url")
>
>
>
> Not really sure about your problem, here is an example that is
working:
>
> public class InitServlet extends HttpServlet    {
> ...
>     public void init(ServletConfig config) throws ServletException  {
>         super.init(config);
>     ...
>         txnDBPasswordFile =
> config.getInitParameter("TXN_DB_PASSWORD_FILE");
>     ...
>
> and the web.xml has
>
>   <servlet>
>     <servlet-name>init</servlet-name>
>     <servlet-class>xxx.InitServlet</servlet-class>
>     <init-param>
>       <param-name>TXN_DB_PASSWORD_FILE</param-name>
>       <param-value>/WEB-INF/pwd.sav</param-value>
>     </init-param>
> ...
>
> Hope this helps.
>
> |--------+----------------------->
> |
> |        |          Søren Blidorf|
> |        |          <soren@nolas.|
> |        |          dk>          |
> |        |
> |        |          04/10/2003   |
> |        |          05:58 PM     |
> |        |          Please       |
> |        |          respond to   |
> |        |          "Struts Users|
> |        |          Mailing List"|
> |
> |--------+----------------------->
> |
>
>-----------------------------------------------------------------------
>
> -----|
>
>   |       To:     struts-user@jakarta.apache.org
>   |
>   |       cc:     (bcc: Cheng Xu/TD/SIN/GIC)
>   |
>   |       Subject:     getInitParameter("url")
> >
>
>-----------------------------------------------------------------------
>
> -----|
>
>
>
>
> Hi.
> I cannot get the getInitParameter("url") to work.
>
> I have extended HttpServlet and have an init value "url" in my
web.xml,
> but is getting null error.
>
> Can anybody please help.
>
> Søren Blidorf
>
> Nolas Consulting
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message