9.0.3, web.xml, context-param

Using documentation found on oracle's website, where I needed to have a specific initialization parameter, I setup a context-param in web.xml. In 9.0.2, I got a warning (and posted here but got no response) but was able to continue. In 9.0.3 I can't run my project when I include this parameter.
Here's what I add to web.xml
<context-param>
<param-name>ReportServerURL</param-name>
<param-value>http://localhost:8888/reports/rwservlet</param-value>
</context-param>
when trying to compile, I get:
Error(76,18): Invalid element 'context-param' in content of 'web-app', expected elements '[taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
Any ideas?
Thanks,
Jeff

If only you would see web-app.dtd you could know that context-param must be enclosed in web-app and be at certain place. See that (from web-app.dtd):
<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

Similar Messages

  • Access custom variable value in web.xml context-param?

    My requirement or need is to access a variable value either in a class in my Model project or a backing bean in my View project. For example, one variable I need to access is an application server I am integrating with - 'testserver' or 'productionserver' - I want to be able to configure this within an external file so that I do not have to re-compile my application to change the variable.
    I was thinking about placing this variable in the web.xml <context-param> section as:
    <context-param>
    <param-name>servername</param-name>
    <param-value>testserver</param-value>
    </context-param>
    I need to access this value within a class (not a servlet) on an Application Module service method, though if needed, I could access it from a backing bean and pass it to the service method (less desirable.) Is this a good approach and how do access this variable from within a Java class including any imports I need to do (code example)?
    Thanks and Happy New Year!
    Hopefully most everyone is out spending time with friends and family versus stuck trying to complete a project like me...

    I found an example from SRDemo that provides what I was looking for:
    String serverhostaddress =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("param-name-var-in-webxml");

  • Web.xml context-param problem...

    Hi all,
    Thoes anyone know how to set CHECK_FILE_MODIFICATION in web.xml param permanently, because whenever I set it on true, after few moments it's back on false?
        <context-param>
            <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
            <param-value>true</param-value>
        </context-param>Regards,
    s o v i e t

    Hi Soviet,
    We suffer from the same bug (which is very annoying) on our project too. One of the exasperated team member fixed it by saving the value to true then removing the write right on that file at OS level... It's a hardcore fix, but it works.
    Regards,
    ~ Simon

  • C:import and web.xml

    Im using <c:import url="http://path_to_html" />. I want to put this value in the web.xml using context param. The problem is I don't know how my c:import tag will refer to that context param inside web.xml. Can anyone give a solution? Thanks.

    web.xml
      <context-param>
        <param-name>abc</param-name>
        <param-value>http://path_to_html</param-value>
      </context-param>
    JSP
    <c:import url="<%= application.getInitParameter("abc") %>"></c:import>More info for c:import
    http://www.onjava.com/pub/a/pub/a/onjava/2002/05/08/jstl.html?page=2
        * Absolute URL: <c:import url="http://sample.com/Welcome.html"/>
        * Relative URL (to the current context): <c:import url="/copyright.html"/>
        * Relative URL with a foreign context: <c:import url="/myLogo.html" context="/common"/>
        * FTP resource: <c:import url="ftp://ftp.sample.com/myFile"/>

  • [ADF-11.1.2.2] Design tab of jspx/jsff goes blank becuase of web.xml config

    Hi,
    I had my project created in 11.1.2.0 version and got upgraded to 11.1.2.2 recently.
    I think there is one following problem with new version:- When you create a new page (jspx) and drag and drop a BTW, the page at designer becomes blank. That goes for all pages under webproject. I debug and found the root cause.
    under web.xml file, there are different context-param tags.
    when I drag and drop BTF in jspx page, jdeveloper insert following new tag in web.xml
      <context-param>
        <description>Security precaution to prevent clickjacking: bust frames if the ancestor window domain(protocol, host, and port) and the frame domain are different. Another options for this parameter are always and never.</description>
        <param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>
        <param-value>differentOrigin</param-value>
      </context-param>I don't know why, but this create some problem in jdeveloper and the designer tag goes blank. If I remove the above tag, it start working fine.
    Is this the issue with jdeveloper ?

    Hi,
    Timo, This is not an issue with new application. I will tell you the reason.
    Frank, for 11.1.2.0 project, I think you are talking about
    <context-param>
        <description>Security precaution to prevent clickjacking: bust frames if the ancestor window domain(protocol, host, and port) and the frame domain are different. Another options for this parameter are always and never.</description>
        <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
        <param-value>differentDomain</param-value>
      </context-param>and I was talking about following tag in my previous post
      <context-param>
        <description>Security precaution to prevent clickjacking: bust frames if the ancestor window domain(protocol, host, and port) and the frame domain are different. Another options for this parameter are always and never.</description>
        <param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>
        <param-value>differentOrigin</param-value>
      </context-param>Look at param-name tag, it's different.
    Vinay, thank you very much for the link that makes whole thing clear :)
    I tell you the whole scenario.
    When I created the project in 11.1.2.0, web.xml had following tag
    <context-param>
        <description>Security precaution to prevent clickjacking: bust frames if the ancestor window domain(protocol, host, and port) and the frame domain are different. Another options for this parameter are always and never.</description>
        <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
        <param-value>differentDomain</param-value>
      </context-param>When you create a new project in 11.1.2.2, web.xml already have following tag
      <context-param>
        <description>Security precaution to prevent clickjacking: bust frames if the ancestor window domain(protocol, host, and port) and the frame domain are different. Another options for this parameter are always and never.</description>
        <param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>
        <param-value>differentOrigin</param-value>
      </context-param>but not the "oracle.adf.view.rich.security.FRAME_BUSTING" tag, since it is deprecated in newer version.
    The problem comes when you migrate 11.1.2.0 version project to newer version. Jdeveloper adds "org.apache.myfaces.trinidad.security.FRAME_BUSTING" tag instead of replacing the deprecated tag "oracle.adf.view.rich.security.FRAME_BUSTING" when you drag and drop BTF in jspx file for the first time. As per the link by vinay, developer has to "manually" modify the web.xml content manually (if not automatically done by Jdeveloper) before we proceed with any further development in newer version.
    The solution is to follow what is written in http://jdevadf.oracle.com/adf-richclient-demo/docs/release-notes.html#New_in_this_Release :)

  • XCM configuration path in web.xml file

    Hi,
    Here is a requirement that all the XCM configuration files are stored at local desktop(like QAT, PRD..), and need to use them by modifying web.xml.
    Please let me know at
    1)which web.xml tag the path of XCM confiuration files to be specified.
    2) specify the names of the XCM files for configuration to be put in that folder.
    Thanks,
    Devender V

    Hi,
    1)which web.xml tag the path of XCM confiuration files to be specified.
    Try to find below lines in your web.xml
    <context-param>
            <param-name>path.xcm.config.isa.sap.com</param-name>
            <param-value>/WEB-INF/xcm/sap/system/bootstrap-config.xml</param-value>
            <description>Turns the Extended Configuration Management on if a
                path to the configuration file is specified. It is a
                relative path, with context-root of web application as root</description>
        </context-param>
    bootstrap-config.xml file contains XCM configuration related XML file path. You can modify or extend this file and give your user Define path.
    Also you can find below line in web.xml file.
    <!-- Action Servlet Configuration -->
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>com.sap.isa.core.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/config.xml,/WEB-INF/xcmadmin-config.xml,/WEB-INF/ccmsims-config.xml,/WEB-INF/ipc-config.xml,/ipc/customer/config.xml,/WEB-INF/config_lwc_b2b.xml,/WEB-INF/scheduler-config.xml,/WEB-INF/ipcpricing-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>config/user</param-name>
                <param-value>/WEB-INF/config_user.xml</param-value>
            </init-param>
            <init-param>
                <param-name>config/dealerlocator</param-name>
                <param-value>/WEB-INF/config_dealerlocator.xml</param-value>
            </init-param>
            <init-param>
                <param-name>initconfig</param-name>
                <param-value>/WEB-INF/xcm/sap/system/init-config.xml</param-value>
            </init-param>
    I hope this will help you.
    eCommerce Developer

  • 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>

  • How to use dynamic file as welcome-file-list in web.xml

    I have configured my web.xml file as this,
    <web-app>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>login.jsf</welcome-file>
    </welcome-file-list>
    </web-app>
    and my login.xhtml file as this,
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:f="http://java.sun.com/jsf/core">
    <body>
    <f:view>
    <h:form>
    UserName:<h:inputText id="userName"
    value="#{bean.userName}" rendered="true"
    required="true"/>
    Password:<h:inputText id="password"
    value="#{bean.password}" rendered="true"
    required="true"/>
    <h:commandButton id="submit" value="Submit" action="#{bean.authenticate}" />
    </h:form>
    </f:view>
    </body>
    </html>
    but when i deploy this using tomcat and try to put url as this,
    http://localhost:8080/project
    Its not identifying welcome file from web.xml
    I am getting error like this,
    The requested resource (/project/) is not available.
    How to resolve this,
    Thanks,
    Vinutha

    This might help:
    http://forum.java.sun.com/thread.jspa?threadID=696586
    As well, you might have to change the servlet-mapping in your web.xml. The url-pattern, I think, needs to be .xhtml. Your login.jsf file in the welcome list will need to be renamed to login.xhtml.
    CowKing

  • Replacing web.xml values with a deployment plan.  Not working on WL 10.3.2

    Hi All-
    I am trying to replace a value from web.xml with one in a weblogic deployment plan. I deployed the application on WL 10.3.2 and used the deployment plan below. No matter what I do it doesn't seem to want to take the value.
    web.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>TokenGroup</param-name>
    <param-value>oldvalue</param-value>
    </context-param>
    </web-app>
    Deployment Plan:
    <?xml version='1.0' encoding='UTF-8'?>
    <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd"
    global-variables="false">
    <application-name>APPName</application-name>
    <variable-definition>
    <variable>
    <name>TokenGroup</name>
    <value>Key123456</value>
    </variable>
    </variable-definition>
    <module-override>
    <module-name>APPName.war</module-name>
    <module-type>war</module-type>
    <module-descriptor external="false">
    <root-element>web-app</root-element>
    <uri>WEB-INF/web.xml</uri>
    <variable-assignment>
    <name>TokenGroup</name>
    <xpath>/web-app/context-param/[param-name="TokenGroup"]/param-value</xpath>
    <operation>replace</operation>
    </variable-assignment>
    </module-descriptor>
    </module-override>
    </deployment-plan>
    I've also tried other formats for the xpath such as:
    /web-app/context-param/{param-name="TokenGroup"}/param-value
    /web-app/context-param[param-name="TokenGroup"]/param-value
    Any ideas why this doesnt work?
    Thanks,
    Joe

    "web.xml"
    <?xml version='1.0' encoding='WINDOWS-1252'?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <context-param>
    <param-name>name</param-name>
    <param-value>Joe</param-value>
    </context-param>
    <context-param>
    <param-name>password</param-name>
    <param-value>password</param-value>
    </context-param>
    <servlet>
    <servlet-name>ParameterServlet</servlet-name>
    <servlet-class>ParameterServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ParameterServlet</servlet-name>
    <url-pattern>/ParameterServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    ParameterServlet
    import java.io.IOException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ParameterServlet extends HttpServlet {
    private String dbName = "";
    private String dbPassword = "";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    ServletContext context = getServletContext();
    dbName = context.getInitParameter("name");
    dbPassword = context.getInitParameter("password");
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws IOException {
    ServletOutputStream out = res.getOutputStream();
    res.setContentType("text/html");
    out.println("<html><head><title>Basic Servlet</title></head>");
    out.println("<body>Database username is <b>" + dbName);
    out.println("</b><br>Database password is <b>" + dbPassword + "</b>");
    out.println("</body></html>");
    "Plan.xml"
    <?xml version='1.0' encoding='UTF-8'?>
    <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd" global-variables="false">
    <application-name>virtual</application-name>
    <variable-definition>
    <variable>
         <name>name</name>
         <value>akshay1</value>
         </variable>
         <variable>
         <name>password</name>
         <value>koul1</value>
         </variable>
    </variable-definition>
    <module-override>
    <module-name>virtual</module-name>
    <module-type>war</module-type>
    <module-descriptor external="false">
    <root-element>web-app</root-element>
    <uri>WEB-INF/web.xml</uri>
         <variable-assignment>
              <name>name</name>
              <xpath>/web-app/context-param/[param-name="name"]/param-value</xpath>
              <operation>replace</operation>
         </variable-assignment>
         <variable-assignment>
              <name>password</name>
              <xpath>/web-app/context-param/[param-name="password"]/param-value</xpath>
              <operation>replace</operation>
         </variable-assignment>
    </module-descriptor>
    </module-override>
    <config-root>C:\DOCUME~1\user\LOCALS~1\Temp\user\.\config\deployments\virtual\plan</config-root>
    </deployment-plan>
    It works for me... I think your "web.xml" is causing the issue.
    Try replacing
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>
    with
    <?xml version='1.0' encoding='WINDOWS-1252'?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    Hope this helps.
    -Akshay

  • Weblogic.servlet.reloadCheckSecs in web.xml not working

    Given the following web.xml file:
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <context-param>
              <param-name>weblogic.servlet.reloadCheckSecs</param-name>
              <param-value>100</param-value>
              </context-param>
              <servlet>
              <servlet-name>CookieCounter</servlet-name>
              <servlet-class>servlets.CookieCounter</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>CookieCounter</servlet-name>
              <url-pattern>monster</url-pattern>
              </servlet-mapping>
              <welcome-file-list>
              <welcome-file>hello.html</welcome-file>
              </welcome-file-list>
              <error-page>
              <error-code>404</error-code>
              <location>/error.jsp</location>
              </error-page>
              </web-app>
              It seems the weblogic.servlet.reloadCheckSecs property is not taking effect.
              The
              default value of -1 is always used. I did stop and restart weblogic.
              I also trid to set the servlet classpath in the web.xml file with
              weblogic.servlet.classpath
              property and it did not change the classpath for the servlet. It seems that
              other
              items are working such as adding new servletrs to the web application. Note
              that
              this is the cookie sample application that installes with the beta 2
              download.
              Thanks,
              Dan.
              

    Hi All:
    Thanks for all your help regarding the adfAuthentication success_url. Now I am able to configure to make this work. But now I am facing another issue i.e. I am getting 401 Not authorized message when the success_url is pointed to the jspx page.
    Note: I am using custom login module similar to DBProcOraDataSourceLoginModule so my roles are stored in the custom Role class. So I am not sure how to pass this role info to the security in ADF in order to authorize the page to be viewed.
    Could you please help and can you point me to any specific link.
    Thanks & Regards
    Sridhar Doki

  • How to config the web.xml file, when I use Richfaces + RI 1.2?

    Hi there:
    I want to use Richfaces + RI 1.2 to build a project. I don`t know how to config the web.xml file.
    By the way, my web server is Tomcat 6.0, my JDK's version is 6u6. I don`t want to use the facelets.
    thanks.
    lxm

    just add this before *</web-app>*
    <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>blueSky</param-value>
      </context-param>
      <filter>
           <display-name>RichFaces Filter</display-name>
           <filter-name>richfaces</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
           <filter-name>richfaces</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

  • What's this mean in web.xml?

    As part of assigning portal desktops, we've altered the web.xml file to add an additional portal alias - the portal system was, at that time, a 6.40 system.  The additional portal alias worked great.  However, I was comparing web.xml files from the deployed portal application (now at 7.0 SP10) and the web.xml that we currently use, and I found these new bits in the new web.xml:
    <init-param>
      <param-name>
        wsrp_producer_service
      </param-name>
      <param-value>
        ProducerImpl
      </param-value>
    </init-param>
    and
    <servlet-mapping>
      <servlet-name>gateway</servlet-name>
      <url-pattern>/wsrp/producer/resource/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>gateway</servlet-name>
      <url-pattern>/wsrp/consumer/resource/*</url-pattern>
    </servlet-mapping>
    I can only assume that these entries have something to do with the Federated portal (and perhaps the producer part) since WSRP is the protocol used to access remote portlets (iViews).
    Can someone verify?

    Hi Ken,
    These entries are dedicated to WSRP usage either as consumer or as producer and have no role in the FPN (remote role assignment and remote deltalinks).
    Thes entries map the urls dedicated for fetching of static resources from the remote system.
    Avi.

  • Significance of context param in web.xml to initialize any variable?servlet

    I am writing a standalone web appplication for rss (xml) creation where i am having jsp servlets class etc.
    Now to write rss.xml and read it back in application i have temporarily used c:\\rss.xml but to make it capable working in web application which can be uploaded in website i need to make it configurable i need to kep it in context param of web.xml and in init() method of servlet of my application what exactly i should do there.what i have tried is this :
    public class Startup extends HttpServlet {
    private static String rssFeed;
    private ServletContext ctx;
    Logger log = Logger.getLogger(Startup.class);
    public void init(){
    log.debug("Initializing APPLICATION CONTEXT Variables");
    ctx = getServletContext();
    rssFeed = (String)ctx.getInitParameter("RssFeed");
    log.debug("Rss : " + rssFeed);
    String rssFile = this.getServletContext().getRealPath("") + File.separator + "WEB-INF" + File.separator + "rss.properties";
    Properties property = new Properties();
    try{
    InputStream propertiesFile = new FileInputStream(rssFile);
    property.load(propertiesFile);
    catch (IOException e) {
    log.error("IOException during domainValuesList file Reading");
    e.printStackTrace();
    log.error("Exception while loading AllowedDomainValues file");
    log.debug("Domain Values Lists Updated");
    /** Get Host Name (Server Name) where application is hosted on
    public static String getRssFeed(){
    return rssFeed;
    after that i called this startup servlet class in other servlet taken this getRssFeed()
    stored it as string passed as parametr to other class where i need to call it but there i am getting null pointer exception which says not initialized.
    even what i have written in web.xml is here:
    <context-param>
    <param-name>RssFeed</param-name>
    <param-value>c:\\rsshandler.xml</param-value>
    </context-param>
    <servlet>
    <servlet-name>Startup</servlet-name>
    <servlet-class>src.Startup</servlet-class>
    <init-param>
    <param-name>RssFeedConfig</param-name>
    <param-value>/WEB-INF/rss-config.xml</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>Startup</servlet-name>
    <url-pattern>/Startup</url-pattern>
    <load-on-startup>1</load-on-startup>
    </servlet-mapping>
    i tried what i know or understood but its not working.
    one more thing i have doneis:created rss.properties files in web-inf
    lines added are
    rssfeed=c:\\rsshandler.xml
    but even i am not getting this why
    or what sholud i do here.
    this thing needs to be configurablewhich we can change later easily.
    any suggestions.
    thanks
    vijendra

    Ben -
    There can be init params for the servlet or for the servlet context. For the servlet, this looks like:
    <servlet>
    <servlet-name>InitServlet</servlet-name>
    <servlet-class>package1.InitServlet</servlet-class>
    <init-param>
    <param-name>message</param-name>
    <param-value>Hello From Initialization Parameter</param-value>
    </init-param>
    </servlet>
    in the web.xml file, and is accessed using:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    message = config.getInitParameter("message");
    For a servlet context init param, you define it as you did using the web.xml settings editor:
    <context-param>
    <param-name>hello</param-name>
    <param-value>hi</param-value>
    </context-param>
    This is accessed using:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    message1 = config.getServletContext().getInitParameter("hello");
    Hope this helps,
    Lynn
    Java Tools Team

  • How to read Standard JSR Portlet Web.xml's context-param

    Hi
    I am completely new to Java.
    I want to keep some configuration in Web.xml in Context param. My Web.xml looks like
    <context-param>
    <param-name>ConfigUrl</param-name>
    <param-value>http://localhost:8083/</param-value>
    </context-param>
    How can I read these values? Can I read these values directly in my JSP file or will I have to read it in my Portlet Class in some function.
    Thanks

    As soon as I use portletConfig, it gives me NullPointerException. I am definitely using <portlet:defineObjects/>
    My Jsp looks as :
    <%@ page contentType = "text/html; charset=windows-1252"
    pageEncoding = "windows-1252"
    import = "javax.portlet.*, java.util.*, port.Port, port.resource.PortBundle,javax.portlet.PortletContext"%>
    <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
    <portlet:defineObjects/>
    <%
    PortletContext ctx = portletConfig.getPortletContext();
    String configpath = "Hello";
    %>
    <label>Welcome</label>
    <label><%=configpath%></label>

  • Generated JSP reports and context-param in web.xml

    I have what I believe to be a problem when using .jsp files generated from reports builder (actually, it looks as if the problem is in the reports tag library. When adding a context-param to web.xml, I get an error when compiling the following line:
    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    Error(1): oracle.xml.parser.v2.XMLParseException: Invalid element 'context-param' in content of 'web-app', expected elements '[taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
    Note that I can read the context param and no other JSP pages seem to care, just those with the Reports Tag library.
    Regards,
    Jeff

    Ben -
    There can be init params for the servlet or for the servlet context. For the servlet, this looks like:
    <servlet>
    <servlet-name>InitServlet</servlet-name>
    <servlet-class>package1.InitServlet</servlet-class>
    <init-param>
    <param-name>message</param-name>
    <param-value>Hello From Initialization Parameter</param-value>
    </init-param>
    </servlet>
    in the web.xml file, and is accessed using:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    message = config.getInitParameter("message");
    For a servlet context init param, you define it as you did using the web.xml settings editor:
    <context-param>
    <param-name>hello</param-name>
    <param-value>hi</param-value>
    </context-param>
    This is accessed using:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    message1 = config.getServletContext().getInitParameter("hello");
    Hope this helps,
    Lynn
    Java Tools Team

Maybe you are looking for

  • How can I make a navigation dependend on the database content with JSF?

    Hi, I want to navigate dynamicly between pages, but pages which addresses that are taken from database. I want to take a list of page's addresses (links) from database, and while application is running, I want to generate on my page that working link

  • How to extract jar files into  a folder in the local disk and then import?

    hai forum, will any one tell me how should i extract jar files into a location in my project folder and then how to import the class files for further usage? Thank you .

  • Character encoding with xsql

    I have a similar application running to the xsql document demo. However, when I am pulling the xml clob out of the database, the character set is incorrect and the xml is not parsed correctly. Instead of a "<" in the returned xml source, I get the fo

  • How to select and read #define lines from a code file

    Hi, I would like to read a .m file and select the lines which begins with '#define PL-KEY', like {quote} #define PL-KEYTAG TAG_values #define PL-KEYGROUP GROUP_value #define PL-KEYINFO "INFO_ValueTxtMax120Char" // could be max 120 char ..... more PL-

  • No permission to create an appt. in standalone Outlook 2013

    Hello! I am struggling with the .ost / ,pst thing when trying to migrate from Outlook 2010 to 2013. I installed Outlook 2013 on a standalone computer (no network/servers etc) and when I migrated calendar items from my Outlook 2010 on another computer