Access parameter from web.xml

<servlet>
<servlet-name>serverText</servlet-name>
<servlet-class>abc</servlet-class>
<init-param>
<param-name>serverParam</param-name>
<param-value>parameter</param-value>
</init-param>
</servlet>
Hi, above is what i defined in my web.xml.
i want to know how to get the serverParam from my jsp file.
i tried to use String param = pageContext.getServletConfig().getInitParameter("serverParam");
but i got null.
please help me.
thanks

hi,
well all jsps are compiled to servlets before running anyway, well if you using a jsp you can still do the
String param = getInitParameter("serverParam");
you could do this in the jspInit method
public void jspInit()
String param = config.getInitParameter("serverParam");
// config is the implicit ServletConfig object
The getInitParameter method is actually defined in the javax.servlet.ServletConfig class, the ServetConfig object is available as an implicit object by name config in a jsp page with page-level scope). well hope this was useful.
Cheerz

Similar Messages

  • How to initialized a variable in java file by taking the value from web.xml

    suppose i declare parameter in web.xml file
    i want to access if from a java file .
    how can i do this . plz help me its urgent...............

    In your Servlet class you can use the getInitParameter("configfile") method.

  • Passing parameter from WEBI report to xcelsius

    hi
    i transfered the parameter from WEBI report (3.1 sp2) table using a link to a gauhe from xcelsius
    i can see the parameter the right number in the gauge value but the problem is that the pin does not move

    How are you connecting your report to Xcelsius? Live Office or QAAWS?

  • Move env-entry from web.xml into deployment plan

    I have:
    <env-entry>
    <env-entry-name>USERNAME</env-entry-name>
    <env-entry-value>someUser</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    and I'd like to move it from web.xml into my_app_plan.dat. Is it possible? How?
    Thank you in advance!

    Let me describe my case in few more words...
    I have some kind of client-server app. Clients have OC4J installed and they download myApp.ear and myApp_plan.dat files and by using script (Windows CMD batch file) clients install those files with admin_client.jar, OC4J's admin utility. The problem is that I have 2 different types of clients and I have client specific settings set in web.xml file and each time I compile myApp.ear I have to uncomment/comment some lines in web.xml.
    So, to make a long story short, I need a way to deploy those settings separated from (outside of) myApp.ear. By following you link, I have read that orion-web.xml should reside inside WEB-INF folder of myApp.ear, which is not good for me.

  • Access context parameter in web.xml

    Hi, all. I add a entry into Context Initialization parameter at tab Application in file web.xml with name: path and value img/product. I don't know how to get the context parameter. I want access the context by EL in file .jspx or .jsf, as #{path} but error. Can anyone help me.Thanks.

    Hi,
    have a go with
    #{initParam['param_name_here']}"
    alternatively
    #{facesContext.externalContext.initParameterMap['param_name_here']}
    Frank

  • How to get parms from web.xml?

    Hello,
    I want to store some config parms in web.xml and read them from within JSP.
    What is the syntax for the web.xml and the code needed in JSP to read it?
    Thanks
    Frank

    Global parameters:
    <context-param>
        <param-name>myParam</param-name>
        <param-value>1</param-value>
      </context-param>
    //Accessing in a servlet
    getServletContext().getInitParameter("myParam");
    // in a JSP
    <%
    application.getInitParameter("myParam");
    %>
    // using JSTL
    ${initParam.myParam}

  • Need help to set values from web.xml in a jsp class

    Hey :-)
    I`m trying to get value from my web.xml file into a jsp class. The problem is that the value always retur null. My web.xml file is replaced in the WEB-INF directory where should be. Here is my web.xml
    <servlet>
    <servlet-name>Html</servlet-name>
    <servlet-class>Html</servlet-class>
    <init-param>
    <param-name>html_test</param-name>
    <param-value>Value I want have in my jsp class
    </param-value>
    </init-param>
    </servlet>
    And her i my java class who don`t work:
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.ServletConfig;
    public class Html extends BodyTagSupport
    String title="";
    String html_test;
    ServletConfig config;
    public void doInitBody() throws JspException
    html_test = config.getInitParameter("html_test");
    }//End of method doInitBody()
    public int doStartTag() throws JspException
    try
    JspWriter out = pageContext.getOut();
    out.print( "<HTML>\n" );
    out.print( "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" );
    out.print( "<BODY>\n" );
    out.print( "<BR><H1>" + html_test + "</H1>" );
    And here are my html_test variable return null.
    I hope somone can help me, duke dollars will be given away for the solution answer.
    paulsep

    Nothing seems to work, have change the string and rewritten the web.xml file to:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
              <context-param>
                   <param-name>html_test</param-name>
                   <param-value>Value I want have in my jsp class</param-value>
              </context-param>
    </web-app>

  • Pass a parameter from webi to Xcelsius

    Hi all,
    Anybody knows how to pass a parameter from a webi report to Xcelsius via URL?
    I need to refresh the Xcelsius data with a parameter coming from the webi report. With Live Office works but only the first time: the data is not being refreshed in Xcelsius everytime I change the parameter in the webi report.
    I'm thinking in someting like openDocument.jsp but how do I read this parameter in Xcelsius? Which connection should I use?
    Thank you very much,
    jon

    Hi Peter,
    the link provided refers to Xcelsius V4.5.
    In Xcelsius 2008 you have to control Flash Vars in the Data Manager.
    Go to the Data Manager, Add the Flash-Var Connection Type, Select CSV-FlashVar and define a name and a range.
    But i am not sure if Xcelsius Engage can handle FlashVars, because i am only working with Enterprise.
    Please take a look at your manual.
    For sure there are other ways to import data during runtime. Take a Look at the Connections provided by Data Manager. (e.g. QaaWS, SSRS, LiveOffice, Webservices, ...)
    Also take a look at the link below. It might be another nice option for "pseudo" data connectivity
    http://labs.businessobjects.com/xcelsiuspublishing/default.asp
    Best Regards
    Ulrich

  • Simplest way to modify properties from web.xml

    I'm testing a very small Web application which uses init-params in web.xml for configuration. For manual testing purposes, I need to be able to change the values of these as easily as possible, preferably from the WebLogic admin console. (I can do it from the console on Websphere App Server, and on Tomcat by editing a file which is immediately re-read.) We don't currently use deployment descriptors in any way and this is only a test of basic code functionality, not of deployment mechanisms, so the change can be as quick-and-dirty as you like. I'm using WebLogic v10 on Linux.
    Thanks,
    Pete

    Another option for you may be to deploy the application in exploded format and use weblogic.Deployer or WLST to redeploy the application :
    http://edocs.bea.com/wls/docs100/deployment/autodeploy.html
    This would be slightly more similar to your Tomcat deployment, but requires a few more steps.

  • Passing Parameter from Web Page to Form 6i

    Dear All,
    We are using 9i AS with Form 6i. I want to created a web page for user login and called my application By passing value
    window.open("http://hrtest/dev60cgi/ifcgi60.exe?form=login_form.fmx&width=1000&height=700&
    userid=logme/logme1@test","","width=1000,height=700,top=0,left=0,location=no,directories=no,
    status=no,menubar=no,toolbar=no,maximize=yes,resizable=yes")
    and it successfully run.
    I want to pass additional parameter to my login_form.fmx from web page like User Shift entered by user on logon ?
    Please help me out.
    Regards,
    Khurram

    I got the clue
    pass parameter in your UR
    as
    //hrtest/dev60cgi/ifcgi60.exe?form=LOGIN_FORM_Para.fmx&width=1000&height=700&userid=power/power1@hrtest&otherparams=PAKISTAN=ALLAH"
    Define a :PARAMETER.PAKISTAN on Form
    and write following trigger
    BEGIN
    if :PARAMETER.PAKISTAN = 'ALLAH' then
    message('ALLAH HO AKBAR');
    message('ALLAH HO AKBAR');
    message(:PARAMETER.PAKISTAN||' HO AKBAR');
    message(:PARAMETER.PAKISTAN||' HO AKBAR');
    else
    message('INSH'||:PARAMETER.PAKISTAN);
    message('INSH'||:PARAMETER.PAKISTAN);
    end if;
    END;
    Regards
    Khurram Altaf | Assistant Manager ERP
    Enterprise Resource Planning Department
    Kohinoor Textiles Mills Ltd
    Peshawar Road, Rawalpindi.
    +92.51.5473940-44 ext 250 | +92.333.5256626
    e-mail: [email protected] | web: www.kmlg.com

  • Getting Email Value from web.xml and displaying in JSF

    HI,
    I have a web.xml with the entry:
    <env-entry>
            <description>The email address for the Support Team.</description>
            <env-entry-name>support</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>[email protected]</env-entry-value>
    </env-entry>I want to display on the JSF the value *"[email protected]"*. I dont want to Hard Code the Email Id on the JSF hence I am looking for this solution.
    One way would be to get the value of the email in a backing bean and then setting a managedBeanValue which will be accessed in the JSF Display page.
    My question is how do I get the email value in my backing bean ?
    Thanks in advance !!!

    I tried using this code:
        FacesContext context = FacesContext.getCurrentInstance();
        ServletContext servletContext = (ServletContext)context.getExternalContext().getContext();
        String value = (String)(servletContext.getAttribute("support");But when I do a System Out on value I get null
    Please Help.
    Thanks in advance

  • Edit env-entry values from web.xml in the WLS console.

    Hi guys!
    Is it possible to define JNDI variables of type java.lang.String using WLS Console?
    Thanks

    I think this would require the use of a deployment plan, which you can learn about here: [http://e-docs.bea.com/wls/docs103/deployment/config.html] . This won't be as convenient as just editing the value directly in the admin console. In fact, it won't even prevent the requirement of redeploying the webapp. It will only allow you to make the change without rebuilding and repackaging the webapp.
    It's questionable whether it's practical or meaningful to change env-entry values in a web.xml without redeployment, because even if you could change the values without redeploying, you'd have to reinitialize the servlet/filter with the changed environment parameter.
    If you really need this dynamic reconfiguration ability, you might have to design the facility into your application, using some sort of polling or event handling capability.

  • Env-entry from web.xml not in generated plan.xml

    Hello,
    Recently I migrated a JDeveloper 10.1.3.4 project to 11.1.1.3 and from there to 11.1.2.4. When I deploy this project to an 10.3.5. weblogic server then the 'env-entry' entires in the web.xml are not available on the application server.
    Even when i use weblogic.PlanGenerator with the -all option to create a plan.xml from the WAR-file the env-enties are not found.
    The web.xml is like this:
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <listener>
    <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>jaxrpc</servlet-name>
    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>VersionServlet</servlet-name>
    <servlet-class>nl.deltalloyd.alfa.keten.version.VersionServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>VersionServlet</servlet-name>
    <url-pattern>/version</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>jaxrpc</servlet-name>
    <url-pattern>/RelatieSoapHttpPort</url-pattern>
    </servlet-mapping>
    <jsp-config/>
    <security-role>
    <role-name>Administrators</role-name>
    </security-role>
    <resource-ref>
    <res-ref-name>jdbc/AlfaDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <env-entry>
    <env-entry-name>appl/version</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>2013.06</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>appl/releasedate</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>13-06-2013</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>appl/loglevel</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>INFO</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>appl/omgeving</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <env-entry>
    <env-entry-name>service/case</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>http://test.services.intranet.company.nl/GixoCaseWeb/services/CaseServiceHttp</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>mqueue/rc/host</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>nl001wwavm058.ad.intra</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>mqueue/rc/port</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>1414</env-entry-value>
    </env-entry>
    </web-app>
    Maybe I missed something in the migration path. Can someone please help me.
    With kind regard,
    Martin

    Let me describe my case in few more words...
    I have some kind of client-server app. Clients have OC4J installed and they download myApp.ear and myApp_plan.dat files and by using script (Windows CMD batch file) clients install those files with admin_client.jar, OC4J's admin utility. The problem is that I have 2 different types of clients and I have client specific settings set in web.xml file and each time I compile myApp.ear I have to uncomment/comment some lines in web.xml.
    So, to make a long story short, I need a way to deploy those settings separated from (outside of) myApp.ear. By following you link, I have read that orion-web.xml should reside inside WEB-INF folder of myApp.ear, which is not good for me.

  • How to access properties from portallapp.xml in jsp file

    <b>portalapp.xml</b>
    <property name="SupportUrl" value="http://sapdp1ci.zrh.swissre.com:53000/irj/portal?navigationtarget=navurl://8f7e974723098424468c8ae903228c0e">
              <property name="personalization" value="dialog"/>
              <property name="plainDescription" value="Support Desk Link URL"/>
              <property name="category" value="Navigation"/>
            </property>
    <b>jsp code</b>
    private String getSupportUrl(IPortalComponentRequest request)
         IPortalComponentContext myContext = request.getComponentContext();
         IPortalComponentProfile profile = myContext.getProfile();
         String supportDeskLocation = profile.getProperty("SupportUrl");
         //String supportDeskLocation = (String)request.getNode().getValue(SUPPORT_URL);
         return supportDeskLocation;
    but supportDeskLocation is coming as null.
    Please help me in solving the issue.
    Points will be awarded
    thanks
    bala

    Hi Michal,
    How are you?
    I´m trying to access a property from portalapp.xml and I have in the right place according to your post and here is my code to retrieve it:
    String value = (String)request.getNode().getValue("MyLogoffUrl");
    Did you activated something or did something else so your property could be reached by the JSP?
    It is just returning null in my case.
    Thanx in Advanced!
    Kind Regards,
    Gerardo j

  • Access files from Web Dynpro component

    Hi,
    I need to access files from a Web Dynpro component but I couldn't find any information. Has anyone done this?
    My questions are:
    1. Can I pack these files into the WD component so they can be deploy together?
    2. And what API should I use to access these files?
    Thanks,
    Kizza

    Hi,
    You can follow the Creating the JCO connections in the Content Administrator section in the following
    help.sap.com [link|http://help.sap.com/saphelp_nw70/helpdata/EN/f8/bdfe80d9a3b048a5fb32a7d149774e/content.htm].
    For the RFC_ERROR_COMMUNICATION error, you can check if the system sapmsR3D is defined in your
    SAP Logon pad or in the hosts file under Drivers -> etc folder.
    Regards,
    Alka.

Maybe you are looking for

  • How do I know if I have an antiglare screen

    Hello there, Just wondering airing on the line of paranoia I suppose but I just bought a MBP from apple specifically with an anti glare screen and paid an extra £80 for the privilage. How do I know for sure it is anti glare screen?  Before you all sc

  • Aggregate Devices - any tips appreciated

    Can anyone give me some pointers to info on handling aggregate audio devices with L8 + 10.5.1? Keyword and topic searches across the forums don't return anything useful. This is the setup: 2x MOTU Traveler 22-in/22-out interfaces (counting ADAT, SPDI

  • Why do my sync'd photos all look pink

    I just upgraded itunes to 10.5 and my iPad1 to iOS 5.  When I sync my photos, they all have a pink tint to them.  Previously, my photos were true to the pics that I have saved on my PC.  Is anyone else seeing this? 

  • TS3276 Sleepy Apple Mail - any advice?

    Periodically my Apple Mail (system 10.7.4), stops downloading incoming mail, even when probed to do so.   The ony recurse which I found so far is to restart the mail application, and  send a message tomyself. That puts it back on track.  That's rathe

  • Time Capsule estimated size accuracy

    Hello, I recently ran out of space on my MBP and needed to quickly offload a 25 GB folder onto something else so I could continue using my Mac. The only thing I had available was my Time Capsule at the time, and I copied everything to the "Time Machi