cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonid Chumanov" <lchuma...@framedoc.ru>
Subject RE: web.xml parameters in cocoon action classes
Date Wed, 28 Apr 2004 08:00:40 GMT
I had this problem too. 

I had no time to find best solution. My solution is very simple (may be
it is not the best - ?). 

In class MainServlet that is start point of my application 

public class MainServlet
    extends CocoonServlet {
    public void init() throws ServletException {
        super.init();
        String attribute =
getServletConfig().getInitParameter("myAttrName");
        if (attribute != null){
            getServletContext().setAttribute("myAttrName", attribute);
        }
}


In action I use: 

ObjectModelHelper.getContext(objectModel).getAttribute("myAttrName");


-----Original Message-----
From: Anna Bikkina [mailto:anna@pinksheets.com] 
Sent: Tuesday, April 27, 2004 10:35 PM
To: users@cocoon.apache.org
Subject: web.xml parameters in cocoon action classes

>Hi,

>I have a n application which runs on cocoon. I have to get some
parameters 
>from web.xml or cocoon.xconf into my action classes and use them there.
I 
>tried using 
>ObjectModelHelper.getContext(objectModel).getInitParameter("timelimit")
;

>but it didnt work. It is returning null. How can I access init
parameters in 
>cocoon whcih are specified in web.xml






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message