GetInitParameter on a jsp

I am running a jsp in Jdev 9.0.0.10.76. The following call is returning null. Please advise!!
mapFileDir = config.getInitParameter("mapFileDir");
Below is the jsp declaration in the web.xml file.
<distributable/>
<servlet>
<servlet-name>UpdateProductImage</servlet-name>
<jsp-file>UpdateProductImage.jsp</jsp-file>
<init-param>
<param-name>mapFileDir</param-name>
<param-value>/testCatalog/</param-value>
<description>
Full path to a directory on a mapped drive (mounted file system) which
contains a text file created by the graphics team to identify the product
images that need to be updated. These images support the online catalog.
</description>
</init-param>
<init-param>
<param-name>mapFileName</param-name>
<param-value>imageMap.txt</param-value>
<description>
The name of the text file created by the graphics team to identify product
images that need to be updated. These images support the online catalog.
</description>
</init-param>
<init-param>
<param-name>imageSrcDir</param-name>
<param-value>/testCatalog/eps/</param-value>
<description>
Full path to a directory on a mapped drive (mounted file system) which
serves as the root directory in which or under which is contained all
graphic images created by the graphics team. This images support the
printed catalogs and after conversion to a jpeg format support the
on-line catalogs.
</description>
</init-param>
<init-param>
<param-name>imageDestDir</param-name>
<param-value>/testCatalog/jpeg</param-value>
<description>
Full path to the local directory that contains all jpeg conversions of
images supplied by the graphics team.
</description>
</init-param>
<init-param>
<param-name>emailAdr</param-name>
<param-value>[email protected]</param-value>
<description>
The email address to which detailed error messages are sent when error
conditions occur.
</description>
</init-param>
</servlet>

You know that you can debug the JSP directly by putting a breakpoint into it?

Similar Messages

  • Uploading a file using jsp and com.oreilly.servlet lib package

    Sorry to bother you but I need your help folks
    I am developing an application to pick up files from a database and sent to a specified location on a different system.
    I am presently trying to run this code,I have placed this lib package from oreilly which is supposed to encapsulate the usage of file uploads,which is a jar file called cos.jar into C:\Program Files\Java\jdk1.5.0_03\jre\lib\ext folder .I have a jsp page that calls the bean which does the upload and implement the classes in the oreilly package.I am using tomcat 5
    [b]the jsp page that acts as the user interface
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Please Choose The File</title>
    </head>
    <body bgcolor="#ffffff">
    <table border="0"><tr>
    <form action="Upload.jsp" method="post"
    enctype="multipart/form-data">
    <td valign="top"><strong>Please choose your document:</strong><br></td>
    <td> <input type="file" name="file1">
    <br><br>
    </td></tr>
    <tr><td><input type="submit" value="Upload File"></td></tr>
    </form>
    </table>
    </body>
    </html>
    this is the jsp page that calls the bean
    <jsp:useBean id="uploader" class="com.UploadBean" />
    <jsp:setProperty name="uploader" property="dir" value="<%=application.getInitParameter(\"save-dir\")%>" />
    <jsp:setProperty name="uploader" property= "req" value="${pageContext.request}" />
    <html>
    <head><title>file uploads</title></head>
    <body>
    <h2>Here is information about the uploaded files</h2>
    <jsp:getProperty name="uploader" property="uploadedFiles" />
    </body>
    </html>
    [b]this is the bean class
    package com;
    import java.util.Enumeration;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.ServletRequest;
    import com.oreilly.servlet.MultipartRequest;
    import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
    import javax.servlet.*;
    public class UploadBean {
    private String webTempPath;
    private HttpServletRequest req;
    private String dir;
    // private ServletRequest request;
    public UploadBean( ) {}
    public void setDir(String dirName) {
    if (dirName == null || dirName.equals(""))
    throw new IllegalArgumentException("invalid value passed to " + getClass( ).getName( )+".setDir");
    //webTempPath = dirName;
    dir = dirName;
    /* public String getDir()
    return webTempPath;
    public void setReq(ServletRequest request) {
    if (request != null && request instanceof HttpServletRequest)
    req = (HttpServletRequest) request;
    } else {
    throw new IllegalArgumentException("Invalid value passed to " + getClass( ).getName( )+".setReq");
    public String getUploadedFiles( ) throws java.io.IOException{
    //file limit size of 5 MB
    MultipartRequest mpr = new MultipartRequest(req,dir,5 * 1024 * 1024,new DefaultFileRenamePolicy( ));
    Enumeration enume = mpr.getFileNames( );
    StringBuffer buff = new StringBuffer("");
    for (int i = 1; enume.hasMoreElements( );i++){
    buff.append("The name of uploaded file ").append(i).append(" is: ").append(mpr.getFilesystemName((String)enume.nextElement( ))).append("<br><br>");
    }//for
    //return the String
    return buff.toString( );
    } // getUploadedFiles
    On running the code I find this error messages
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax/servlet/ServletRequest
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:73)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:222)
         com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:151)
         com.UploadBean.getUploadedFiles(UploadBean.java:49)
         org.apache.jsp.jsp.Upload_jsp._jspService(org.apache.jsp.jsp.Upload_jsp:63)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9
    tanks

    Hi,
    Looks like you are missing a file from the classpath. Make sure servlet.jar is available in your classpath. Ordinarily files in <tomcat_home>/lib directory should be added automatically. You need to check why it hasn't been added in your case. A good place to start would be the bat files in the bin directory viz startup.bat, catalina.bat etc.
    cheers,
    vidyut

  • JSP-Descriptor

    I am not exactly a JSP pro. So I have a question which may sound pretty
              basic.
              I want to pass some configuration information to my jsp. I would like to
              specify the parameter names and values in web.xml or weblogic.xml. Is the
              <jsp-descriptor> the right place for such purposes ?
              Also how can I read those values from within my JSP ?
              Regards,
              Adarsh
              

              You can use init params per jsp or context params available to the entire context's
              pages.
              <servlet>
              <servlet-name>snoop</servlet-name>
              <jsp-file>/snoop.jsp</jsp-file>
              <init-param>
              <param-name>myinitparam</param-name>
              <param-value>paramvalue</param-value>
              </init-param>
              </servlet>
              this code:
              from servlet:
              getServletContext().getInitParameter("myinitparam")
              from jsp:
              application.getInitParameter("myinitparam")
              or context params
              <context-param>
              <param-name>mycontextparam</param-name>
              <param-value>paramvalue</param-value>
              </context-param>
              from servlet:
              getServletContext().getAttribute("mycontextparam")
              from jsp:
              application.getAttribute("mycontextparam")
              "Adarsh Dattani" <[email protected]> wrote:
              >I guess I mis-phrased my question. I do not want to pass not from the
              >browser. I want to define configuration settings in the deployment
              >desciptors (like connection pool names or jms queue jndi names etc.).
              > I
              >want to be able to read those values from my JSP.
              >TIA,
              >Adarsh
              >
              >"Deepak Vohra" <[email protected]> wrote in message
              >news:[email protected]...
              >> Speciify the parameters & their values with the Jsp.
              >> For example
              >>
              >http://localhost:7001/ExampleJsp.jsp?parameter1=value¶meter2=value¶m
              >eter3=value
              >>
              >> Retrieve the parameter values in the jsp.
              >>
              >> String param1=request.getParameter("parameter1");
              >> String param2=request.getParameter("parameter2");
              >> String param3=request.getParameter("parameter3");
              >>
              >>
              >> Adarsh Dattani wrote:
              >>
              >> > I am not exactly a JSP pro. So I have a question which may sound
              >pretty
              >> > basic.
              >> > I want to pass some configuration information to my jsp. I would
              >like
              >to
              >> > specify the parameter names and values in web.xml or weblogic.xml.
              > Is
              >the
              >> > <jsp-descriptor> the right place for such purposes ?
              >> > Also how can I read those values from within my JSP ?
              >> > --
              >> > Regards,
              >> > Adarsh
              >>
              >
              >
              

  • Did I break the request?

    Hello
    In the code below for input type=file, the js onchange grabs the file location of the selected file, however when I post it it is not in either the session or request param. (Further below is the jsp). What is odd is when I use the DOM Inspector in Mozilla the #text element for the input element file1Name shows " " for the value. However the input element labeled path does show the correct value. It even fails with the table structure eliminated, of course.
    How do I get the value of the selected file into a parameter accessible by an action or jsp?
    <html>
    <head>
    <title>
    UploadOne_S for the Servlet version
    </title>
    </head>
    <script type="text/javascript">
    function showPath(thisvalue){
              //thisvalue.form.file1Name.value=thisvalue.form.file1.value;
         var msg = thisvalue.form.file1.value;
         var t   = thisvalue.form.file1Name;
         t.value = msg;
         return true;
    </script>
    <body bgcolor="#ffffff">
    <h1>
    test
    </h1>
    <table border="0">
    <tr>
    <!--used to be uploadBean.jsp -->
    <form action="UploadReview.jsp" method="post"
         enctype="multipart/form-data">
              <td valign="top" /><strong>Please choose your document:</><br>
              <td> <input type="file" name="file1" onchange='return showPath(this)'/>
                         <input  type="text" name="file1Name" id="path"/>
                   <br>
                   <br>
              </td>
              <td><input type="submit" value="UploadFile"></td>
    </form>
    </tr>
    </table>
    </body>
    </html>
    <%@ page errorPage="UploadReview_error.jsp" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <jsp:useBean id="uploader" class="filesDM.helper.UploadBean" scope="session" />
    <jsp:setProperty name="uploader" property="dir"
        value="<%=application.getInitParameter(\"save-dir\")%>" />
    <jsp:setProperty name="uploader" property="req"  value="<%= request %>" />
    <jsp:setProperty name="uploader" property="path" value="<%=request.getParameter("file")%>"/>
    <%=request.getParameter("file") %>
    <html>
    <head><title>file uploads</title></head>
    <body>
    From the session the websiteID= <c:out value="${websiteID}" default="not in session"/><br />
    From the session file1= <c:out value="${file1}" default="no file1 from session"/><br />
    From the session file1Name= <c:out value="${file1Name}" default="no file1Name from session"/><br />
    From the parameters varstatus= <c:out value="${param.varStatus}" default="not a parameter"/> state= <c:out value="${param.state}"/>.<br />
    From the parameters file1= <c:out value="${param.file1}" default="no file1 from parameters"/><br />
    From the parameters file1Name= <c:out value="${param.file1Name}" default="no file1Name from parameters"/><br />
    <h2>Here is information about the uploaded files</h2>
    <jsp:getProperty name="uploader" property="uploadedFiles" />
    </body>
    </html>

    The servlet specs have no built in support for multipart requests. I don't know about struts, but normally I would recommend to check out Apache commons FileUpload, which is an API that can parse multipart requests and easily allows you to retrieve file uploads from it.
    http://jakarta.apache.org/commons/fileupload/

  • WL6.1sp3 problem with getServletContext?

              I have just installed WL6.1sp3 and tried to move a web application from Tomcat
              4.02 to WebLogic. When I access a jsp, I get the following compile error indicating
              that it does not recognize the getServletContext method.
              Can anyone tell me why this is happening and how I can fix this?
              E:\WRS\WEB-INF\_tmp_war_WRS\jsp_servlet\__wrslogin.java:101: cannot resolve symbol
              symbol : method getServletContext ()
              location: class jsp_servlet.__wrslogin
              String wrsDBLogin = getServletContext().getInitParameter("wrsDBLogin");
              //[ /WRSLogin.jsp; Line: 12]
              Thanks,
              Chris
              

    AFAIK there is no getServletContext() method in javax.servlet.Servlet.
              change your JSP to
              String wrsDBLogin =
              getServletConfig().getServletContext().getInitParameter("wrsDBLogin");
              or
              String wrsDBLogin = application.getInitParameter("wrsDBLogin");
              "Chris L" <[email protected]> wrote in message
              news:[email protected]..
              >
              > I have just installed WL6.1sp3 and tried to move a web application from
              Tomcat
              > 4.02 to WebLogic. When I access a jsp, I get the following compile error
              indicating
              > that it does not recognize the getServletContext method.
              >
              > Can anyone tell me why this is happening and how I can fix this?
              >
              > E:\WRS\WEB-INF\_tmp_war_WRS\jsp_servlet\__wrslogin.java:101: cannot
              resolve symbol
              > symbol : method getServletContext ()
              > location: class jsp_servlet.__wrslogin
              > String wrsDBLogin =
              getServletContext().getInitParameter("wrsDBLogin");
              > //[ /WRSLogin.jsp; Line: 12]
              >
              >
              >
              > Thanks,
              >
              > Chris
              Dimitri
              

  • JSP and getInitParameter

    I am using iPlanet application server 6.5 and deploying a web application (war file) as part of an enterprise application (embedded in the ear file).
    In the web.xml of the war file, I use the context-param element to set an initial parameter value for the application.
    From a JSP page that is part of the web application, I call application.getInitParameter(). However, the JSP does not appear to be getting passed the context-params. The application.getInitParameterNames() method returns an empty enumeration.
    Has anyone had this problem before?
    Thanks in advance for any help!

    You can put all of these parameters in jndi.properties, then using the
              default constructor will look for the properties there:
              new InitialContext();
              Gene Chuang
              Teach the world. Join Kiko!
              http://www.kiko.com/profile/join.jsp?refcode=TAF-gchuang
              "Peter Wu" <[email protected]> wrote in message
              news:[email protected]..
              > Hi,
              >
              > What's the best way for me to configure my jsp tag extension so that it
              can
              > access my ejb without me hardcoding the parameters to set up the initial
              > context that weblogic (do others do this too?) requires to lookup my ejb.
              >
              > I would set it up in a context-param in web.xml but since my jsp tag
              > extension is not a jsp or servlet, it can't call getInitParameter(...) and
              > it would be kind of ugly to get it in my jsp and then pass it along to my
              > tag everytime I call it.
              >
              > What's the best way to do this?
              >
              > Thanks,
              > Peter
              >
              >
              

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

  • Get init parameter from JSP

    Hello folks
    First of all, I want to say sorry for my English.
    Well, I have one jsp file and I want to pass one value from web.xml file to it but I don't know how
    I also did the same thing with servlet and it's OK, I used function getInitParameter in ServletConfig and modified file web.xml in Tomcat 3.2.
    Please help me
    Thanks in advance.

    Hi,
    For example, if your web.xml has something like:
    <context-param>
    <param-name>testParam</param-name>
    <param-value>[email protected]</param-value>
    </context-param>
    You can access the "testParam" init param from within your JSP scriptlet as:
    String value = getServletContext().getInitParameter("testParam");
    where "testParam" matches the <param-name> element of one of these initialization parameters.
    Hope that helps.
    Regards,
    Senthil Babu
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Open a Local file from JSP

    Hi All,
    I want to access a local file from a JSP. On click of the link the local file should open. The location of the local file is
    O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    and the hyper link on the JSP shows
    file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    somehow the file does not open from the JSP page but it opens from the browser if I type
    'file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc' in the address bar.
    Can anybody please help.
    regards,
    Shardul.

    if you'd like to show the real path to the user, use simply an ftp server !
    however, if you prefer a secure solution, so use a servlet:
    example:
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    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 SendWord extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        //get the 'file' parameter
        String fileName = (String) request.getParameter("file");
        if (fileName == null || fileName.equals(""))
          throw new ServletException(
              "Invalid or non-existent file parameter in SendWord servlet.");
        // add the .doc suffix if it doesn't already exist
        if (fileName.indexOf(".doc") == -1)
          fileName = fileName + ".doc";
        String wordDir = getServletContext().getInitParameter("word-dir");
        if (wordDir == null || wordDir.equals(""))
          throw new ServletException(
              "Invalid or non-existent wordDir context-param.");
        ServletOutputStream stream = null;
        BufferedInputStream buf = null;
        try {
          stream = response.getOutputStream();
          File doc = new File(wordDir + "/" + fileName);
          response.setContentType("application/msword");
          response.addHeader("Content-Disposition", "attachment; filename="
              + fileName);
          response.setContentLength((int) doc.length());
          FileInputStream input = new FileInputStream(doc);
          buf = new BufferedInputStream(input);
          int readBytes = 0;
          while ((readBytes = buf.read()) != -1)
            stream.write(readBytes);
        } catch (IOException ioe) {
          throw new ServletException(ioe.getMessage());
        } finally {
          if (stream != null)
            stream.close();
          if (buf != null)
            buf.close();
      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        doGet(request, response);
    }hope that helps

  • Assigning a URI to a jsp client

    Hi
    I am trying to proxy a message from my OC client to a jsp client. My proxy servlet registers the URI I am supposed to fwd my message to.
    I am not sure if I can assign a URI to my jsp client, and if yes, how?
    If not, is there any other way for me to proxy it? I have been able to proxy stuff to an OC client, based on the sip addess, eg. sip:[email protected]:5064; by configuring the sip.xml and using "proxy.proxyTo(xxxxx)"
    Some of my code is as follows...
    ***************ProxyServlet code***********************
    package oracle.sdp.proxy;
    import java.io.IOException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.sip.Proxy;
    import javax.servlet.sip.SipFactory;
    import javax.servlet.sip.SipServlet;
    import javax.servlet.sip.SipServletRequest;
    import javax.servlet.sip.SipServletResponse;
    import javax.servlet.sip.URI;
    @SuppressWarnings("serial")
    public class ProxyServlet extends SipServlet
         private URI mForwardUri;
         private URI mForwardUri1;
         private URI mForwardUri2;
         private SipFactory getSipFactory() {
         return (SipFactory) getServletContext()
         .getAttribute(SipServlet.SIP_FACTORY);
         protected void doMessage(SipServletRequest request) throws ServletException,IOException
         log("Received: " + request.getMethod() + " Content: "+ request.getContent());
         try
              ServletConfig config = getServletConfig();
              String forwardUri = config.getInitParameter("forwardAddress");
              mForwardUri = getSipFactory().createURI(forwardUri);
              String forwardUri1 = config.getInitParameter("forwardAddress1");
              mForwardUri1 = getSipFactory().createURI(forwardUri1);
              String forwardUri2 = config.getInitParameter("forwardAddress2");
              mForwardUri2 = getSipFactory().createURI(forwardUri2);
         catch (NumberFormatException e)
         try
         Proxy proxy = request.getProxy();
         proxy.cancel();
         SipServletResponse resp = proxy.getOriginalRequest().createResponse(SipServletResponse.SC_CALL_BEING_FORWARDED, "Forward message to " + mForwardUri);
         resp.send();
         proxy.proxyTo(mForwardUri);//this forwards to OC1 client
         proxy.proxyTo(mForwardUri1);//this forwards to OC2 client
         proxy.proxyTo(mForwardUri2);//this forwards to FinalMessage.java, which is a Recepient servlet
              request.getSession().getApplicationSession().invalidate();
         catch (java.io.IOException ioe)
         log("Failed to send response", ioe);
    ********sip.xml for proxyservlet*********************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sip-app
    PUBLIC "-//Java Community Process//DTD SIP Application 1.0//EN"
    "http://www.jcp.org/dtd/sip-app_1_0.dtd">
    <sip-app>
         <display-name>SIP Servlet Application</display-name>
    <servlet>
    <servlet-name>ProxyServlet</servlet-name>
    <servlet-class>
    oracle.sdp.proxy.ProxyServlet
    </servlet-class>
    <init-param>
    <param-name>forwardAddress</param-name>
    <param-value>sip:[email protected]:5064</param-value>
    </init-param>
    <init-param>
    <param-name>forwardAddress1</param-name>
    <param-value>sip:[email protected]:5062</param-value>
    </init-param>
    <init-param>
    <param-name>forwardAddress2</param-name>
    <param-value>sip:@127.0.0.1:5060;transport=tcp;appId=FinalMessage</param-value>
    </init-param>
    <load-on-startup/>
    </servlet>
    <servlet-mapping>
    <servlet-name>ProxyServlet</servlet-name>
    <pattern>
    <equal>
    <var>request.method</var>
    <value>MESSAGE</value>
    </equal>
    </pattern>
    </servlet-mapping>
    </sip-app>
    Please guide me.
    Thanks,
    A

    The URI has to be of the form
    sip:127.0.0.1;transport=xxxx;appId=xxx;
    This solved the issue.

  • Accessing config object in jsp page

    I have been trying to access the config (implicit) object in my jsp page. In my web.xml, for my application, I have specified an init-parameter. To get the value of this parameter, I have the following code being executed
    <%
         String protocol = config.getInitParameter("protocol");
         out.println("Protocol = " +protocol);
    %>
    The output turns out to be Protocol = null.
    If I specify the init-parameter in Tomcat's web.xml in conf directory, then I do get the value. But that does not serve my purpose. I am using jakarta-tomcat-4.0-b7.
    Any suggestions!!!!!!!

    Try this link, http://archives2.real-time.com/rte-tomcat/2000/Apr/msg01124.html

  • BLOB image not shows in JSP page!!

    Hi Dear all,
    I had tried to configure how to show BLOB image to jsp page . The code are works fine and servlet works ok but image can not show only. can you help me that what need to be added. Please help me.
    Can any experts help me? BLOB image not shows in JSP page. I am using ADF11g/DB 10gR2.
    My as Code follows:
    _1. Servlet Config_
        <servlet>
            <servlet-name>images</servlet-name>
            <servlet-class>his.model.ClsImage</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>images</servlet-name>
            <url-pattern>/render_images</url-pattern>
        </servlet-mapping>
      3. class code
    package his.model;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.util.Map;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ClsImage extends HttpServlet
      //private static final Log LOG = LogFactory.getLog(ImageServlet.class);
      private static final Log LOG = LogFactory.getLog(ClsImage.class);
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        System.out.println("GET---From servlet============= !!!");
        String appModuleName = "his.model.ModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleName");
        String appModuleConfig = "TempModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleConfig");
        String voQuery ="select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = 'P1000000000006'" ;// 'P1000000000006' this.getServletConfig().getInitParameter("ImageViewObjectQuery");
        String mimeType = "jpg";//this.getServletConfig().getInitParameter("gif");
        //?IMAGE_NO='P1000000000006'
        //TODO: throw exception if mandatory parameter not set
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName, appModuleConfig);
          ViewObject vo =  am.createViewObjectFromQueryStmt("TempView2", voQuery);
        Map paramMap = request.getParameterMap();
        Iterator paramValues = paramMap.values().iterator();
        int i=0;
        while (paramValues.hasNext())
          // Only one value for a parameter is expected.
          // TODO: If more then 1 parameter is supplied make sure the value is bound to the right bind  
          // variable in the query! Maybe use named variables instead.
          String[] paramValue = (String[])paramValues.next();
          vo.setWhereClauseParam(i, paramValue[0]);
          i++;
       System.out.println("before run============= !!!");
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        System.out.println("after run============= !!!");
        Row product = vo.first();
        //System.out.println("============"+(BlobDomain)product.getAttribute(0));
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null)
          System.out.println("onside product============= !!!");
           // We assume the Blob to be the first a field
           image = (BlobDomain) product.getAttribute(0);
           //System.out.println("onside  run product============= !!!"+image.toString() +"======="+image );
           // Check if there are more fields returned. If so, the second one
           // is considered to hold the mime type
           if ( product.getAttributeCount()> 1 )
              mimeType = (String)product.getAttribute(1);       
        else
          //LOG.warn("No row found to get image from !!!");
          LOG.warn("No row found to get image from !!!");
          return;
        System.out.println("Set Image============= !!!");
        // Set the content-type. Only images are taken into account
        response.setContentType("image/"+ mimeType+ "; charset=windows-1252");
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[4096];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
          //System.out.println("Set Image============= loop!!!"+(is.read(buffer)));
        os.close();
        // Remove the temporary viewobject
        vo.remove();
        // Release the appModule
        Configuration.releaseRootApplicationModule(am, false);
    } 3 . Jsp Tag
    <af:image source="/render_images" shortDesc="Item"/>  Thanks.
    zakir
    ====
    Edited by: Zakir Hossain on Apr 23, 2009 11:19 AM

    Hi here is solution,
    later I will put a project for this solution, right now I am really busy with ADF implementation.
    core changes is to solve my problem:
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        }All code as below:
    Servlet Code*
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException,
                                                             IOException {
        String appModuleName =
          "his.model.ModuleAssetMgt";
        String appModuleConfig =
          "TempModuleAssetMgt";
      String imgno = request.getParameter("imgno");
        if (imgno == null || imgno.equals(""))
          return;
        String voQuery =
          "select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = '" + imgno + "'";
        String mimeType = "gif";
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName,
                                                    appModuleConfig);
        am.clearVOCaches("TempView2", true);
        ViewObject vo = null;
        String s;
          vo = am.createViewObjectFromQueryStmt("TempView2", voQuery);
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        Row product = vo.first();
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null) {
          // We assume the Blob to be the first a field
          image = (BlobDomain)product.getAttribute(0);
          // Check if there are more fields returned. If so, the second one
          // is considered to hold the mime type
          if (product.getAttributeCount() > 1) {
            mimeType = (String)product.getAttribute(1);
        } else {
          LOG.warn("No row found to get image from !!!");
          return;
        // Set the content-type. Only images are taken into account
        response.setContentType("image/" + mimeType);
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        is.close();
        os.close();
        // Release the appModule
    Configuration.releaseRootApplicationModule(am, true);
    }Jsp Tag
    <h:graphicImage url="/render_images?imgno=#{bindings.ImageNo.inputValue}"
                                                        height="168" width="224"/>

  • Problem with accessing init parameters from JSP file

    Hi,
    I have my init parameters and Jsp configured in web.xml
    <servlet>
              <servlet-name>TestJsp</servlet-name>
              <jsp-file>/Test.jsp</jsp-file>
              <init-param>
                   <param-name>username</param-name>
                   <param-value>Balboa</param-value>
              </init-param>
    </servlet> How do I access 'username' field from JSP file.
    Kindly help.
    Thanks.

    you can do this in the jsp
    <%=config.getInitParameter("username")%>or do it in the jspInit method in the jsp:
    <%!  String userName = null; 
      public void jspInit() {   
        ServletConfig config = getServletConfig();   
        userName   = config.getInitParameter("userName ");  
    %>
    Hello <%=userName%>

  • Access Initialization Parameters using jsp

    Hi All,
    Now I'm learning JSP . I want to access the initialization parameters using jsp. How to do it. I used the following code , but it shows null
    initparameter.jsp
        <html>
         <body>
              <h1>
                   <%
                        out.println("InitParameter Checking");
                        out.println(application.getInitParameter("param1"));
                   %>
              </h1>
         </body>
    </html>I configured the following tags in my web.xml.
            <servlet>
              <servlet-name>initparameter</servlet-name>
              <jsp-file>/initparameter.jsp</jsp-file>
            <init-param>
                    <param-name>param1</param-name>
                    <param-value>value1</param-value>
                </init-param>
         </servlet>
                    Help me to resolve this problem
    Thanks in advance,
    mahes

    try overriding the jspInit method and then call getServletConfig() method and call getInitiParameter() on that ..infact the config implicit object would iachieve the same .i don't understand why it's printing null in your case .let me test and see

  • JSP - Bean - Scope Issue with ResultSet

    Hi there,
    I have a JSP page that uses a Bean to get ResultSets from a db. My methods return ResultSets, but they seem to get out of scope on the JSP page when I try to use them. I'm not sure why. I have included 2 snippets below one that works and one that doesn't. I get a java.lang.null exception when the page is run. Not sure how or why the variable seems to go out of scope? I can work around it, but I would rather find out why this is happening.
    This one fails:
    <%@ page errorPage="error.jsp" %>
    <%@ page import="utils.LookupBean" %>
    <%@ page import="java.sql.ResultSet" %>
    <%
    try{
    %>
    <html>
    <head>
    <title>lookup</title>
    </head>
    <body>
    <jsp:useBean id="lookup" class="utils.LookupBean">
    <%
    ResultSet roem = lookup.getOEMDropdown();
    //open db conn
    lookup.openIlprod();
    if(roem!=null){
    %>
    OEM:  
    <select name="OEM">
    <%
    while(roem.next()){
    %>
    <option value="<%=roem.getString("id")%>"><%=roem.getString("name")%></option>
    <%
    %>
    </select><br><br>
    <%
    else{
    out.println("OEM:  no records<br><br>");
    %>
    </jsp:useBean>
    </body>
    </html>
    <%
    catch(Exception e){     
         //log to Tomcat
    %>
    This one works....why??
    <%@ page errorPage="error.jsp" %>
    <%@ page import="utils.LookupBean" %>
    <%@ page import="java.sql.ResultSet" %>
    <%
    try{
    %>
    <html>
    <head>
    <title>lookup</title>
    </head>
    <body>
    <jsp:useBean id="lookup" class="utils.LookupBean">
    <%
    //open db conn
    lookup.openIlprod();
    ResultSet roem = lookup.getOEMDropdown();
    if(roem!=null){
    %>
    OEM:  
    <select name="OEM">
    <%
    while(roem.next()){
    %>
    <option value="<%=roem.getString("id")%>"><%=roem.getString("name")%></option>
    <%
    %>
    </select><br><br>
    <%
    else{
    out.println("OEM:  no records<br><br>");
    %>
    </jsp:useBean>
    </body>
    </html>
    <%
    catch(Exception e){     
         //log to Tomcat
    %>

    <%@ page errorPage="error.jsp" %>
    <%@ page import="utils.LookupBean" %>
    <%@ page import="java.sql.ResultSet" %>
    <%
    String ilprod_db_user;
    String ilprod_db_pass;
    String tedsi_prod_owner;
    String nsp_portal_owner;
    String iladmin_owner;
    String ilprod_db_host;
    String ilprod_db_port;
    String ilprod_db_service;
    try{
         //get the ilprod_db_user from the deployment descriptor
         ilprod_db_user = (String)getServletContext().getInitParameter("ilprod_db_user");
         //ensure a value is present
         if(ilprod_db_user==null||ilprod_db_user.equals("")){
         throw new ServletException("Error retrieving ilprod_db_user from deployment descriptor. - ilprod_db_user is null or an empty string");
         //get the ilprod_db_pass from the deployment descriptor
         ilprod_db_pass = (String)getServletContext().getInitParameter("ilprod_db_pass");
         //ensure a value is present
         if(ilprod_db_pass==null||ilprod_db_pass.equals("")){
         throw new ServletException("Error retrieving ilprod_db_pass from deployment descriptor. - ilprod_db_pass is null or an empty string");
         //get the tedsi_prod_owner from the deployment descriptor
         tedsi_prod_owner = (String)getServletContext().getInitParameter("tedsi_prod_owner");
         //ensure a value is present
         if(tedsi_prod_owner==null||tedsi_prod_owner.equals("")){
         throw new ServletException("Error retrieving tedsi_prod_owner from deployment descriptor. - tedsi_prod_owner is null or an empty string");
         //get the nsp_portal_owner from the deployment descriptor
         nsp_portal_owner = (String)getServletContext().getInitParameter("nsp_portal_owner");
         //ensure a value is present
         if(nsp_portal_owner==null||nsp_portal_owner.equals("")){
         throw new ServletException("Error retrieving nsp_portal_owner from deployment descriptor. - nsp_portal_owner is null or an empty string");
         //get the iladmin_owner from the deployment descriptor
         iladmin_owner = (String)getServletContext().getInitParameter("iladmin_owner");
         //ensure a value is present
         if(iladmin_owner==null||iladmin_owner.equals("")){
         throw new ServletException("Error retrieving iladmin_owner from deployment descriptor. - iladmin_owner is null or an empty string");
         //get the ilprod_db_host from the deployment descriptor
         ilprod_db_host = (String)getServletContext().getInitParameter("ilprod_db_host");
         //ensure a value is present
         if(ilprod_db_host==null||ilprod_db_host.equals("")){
         throw new ServletException("Error retrieving ilprod_db_host from deployment descriptor. - ilprod_db_host is null or an empty string");
         //get the ilprod_db_port from the deployment descriptor
         ilprod_db_port = (String)getServletContext().getInitParameter("ilprod_db_port");
         //ensure a value is present
         if(ilprod_db_port==null||ilprod_db_port.equals("")){
         throw new ServletException("Error retrieving ilprod_db_port from deployment descriptor. - ilprod_db_port is null or an empty string");
         //get the ilprod_db_service from the deployment descriptor
         ilprod_db_service = (String)getServletContext().getInitParameter("ilprod_db_service");
         //ensure a value is present
         if(ilprod_db_service==null||ilprod_db_service.equals("")){
         throw new ServletException("Error retrieving ilprod_db_service from deployment descriptor. - ilprod_db_service is null or an empty string");
    %>
    <html>
    <head>
    <title>lookup</title>
    </head>
    <body>
    <jsp:useBean id="lookup" class="utils.LookupBean">
    <jsp:setProperty name="lookup" property="ilprod_db_user" value="<%=ilprod_db_user%>"/>
    <jsp:setProperty name="lookup" property="ilprod_db_pass" value="<%=ilprod_db_pass%>"/>
    <jsp:setProperty name="lookup" property="tedsi_prod_owner" value="<%=tedsi_prod_owner%>"/>
    <jsp:setProperty name="lookup" property="nsp_portal_owner" value="<%=nsp_portal_owner%>"/>
    <jsp:setProperty name="lookup" property="iladmin_owner" value="<%=iladmin_owner%>"/>
    <jsp:setProperty name="lookup" property="ilprod_db_host" value="<%=ilprod_db_host%>"/>
    <jsp:setProperty name="lookup" property="ilprod_db_port" value="<%=ilprod_db_port%>"/>
    <jsp:setProperty name="lookup" property="ilprod_db_service" value="<%=ilprod_db_service%>"/>
    <%
    //open db conn
    lookup.openIlprod();
    ResultSet roem = lookup.getOEMDropdown();
    ResultSet rstat = lookup.getStatusDropdown();
    if(roem!=null){
    %>
    OEM:��
    <select name="OEM">
    <%
    while(roem.next()){
    %>
    <option value="<%=roem.getString("id")%>"><%=roem.getString("name")%></option>
    <%
    %>
    </select><br><br>
    <%
    else{
    out.println("OEM:  no records<br><br>");
    //******* IF I PUT ResultSet IN FRONT OF rstat HERE IT WORKS FINE?
    rstat = lookup.getStatusDropdown();
    if(rstat!=null){
    %>
    Status:��
    <select name="status">
    <%
    while(rstat.next()){
    %>
    <option value="<%=rstat.getString("id")%>"><%=rstat.getString("description")%></option>
    <%
    %>
    </select><br><br>
    <%
    else{
    out.println("Status:  no records<br><br>");
    //close db conn
    lookup.closeIlprod();
    %>
    </jsp:useBean>
    </body>
    </html>
    <%
    catch(Exception e){
         //set request attributes to pass to error page
         request.setAttribute("javax.servlet.error.exception",e);
         request.setAttribute("javax.servlet.error.message",e.getMessage());
         request.setAttribute("javax.servlet.error.request_uri",     request.getRequestURI());
         request.setAttribute("javax.servlet.error.servlet_name", request.getServletPath());
         //log to Tomcat
         application.log(" Message: "+e.getMessage()+'\r'+'\n'+"RequestURI: "+request.getRequestURI()+'\r'+'\n'+"Servlet Path: "+request.getServletPath(),e);
         //forward to the error page
         RequestDispatcher rd =     request.getRequestDispatcher("error.jsp");
         rd.forward(request,response);
         //out.println(e.getMessage());
    %>

Maybe you are looking for

  • Datasources in ECC 6.0

    Hi, Is there any new datasource added  in ECC 6.0 or BI 7.0? Thanks & Regards, venu

  • Bug report: Website doesn't show flash data with version 11.4

    A website I've used for years no longer shows any data with the new version of Flash Player; I see a spinning "loading" wheel instead, which never stops spinning. Others using the site are having the same problem. I have removed 11.4 and installed 10

  • Downloading Netweaver Abap Trial Version

    Hi Everybody, I am having free download manager installed in my computer. The moment it picks to download the software Netweaver Abap, it says "STOPPED"  and does not proceeds further. Is there any settings in it to correct it or is there any other d

  • Access provisioning through Access List

    I have Inter Vlan Routing done on my Core Switch, through which subnets are restricted to access each other, Example subnet of 10.1.23.0 cannot have access to subnet of 10.1.24.0. Due to certain requirement i want that 10.1.23.19(Users Worskstain IP)

  • New Page before or after subtotalled group

    I have a report which covers multiple projects with subtotals for each project. I currently have the situation where the page break cuts in the middle of the project group and shows on the next page, you end up not knowing what the project is. I can