Calling Function on JSP page

Hi all
can someone please tell what am I doing wrong here? I'm trying to call Function on a JSP page
CallableStatement cs = connection.prepareCall("{? = call pa_dump_xml.fn_user_diary(?)}");
ResultSet rs = cs.executeQuery();
while (rs.next()) {     
%>
    <input type="text" name="app1" id="textfields1" size="" value="<% out.println(rs.getInt(11));%>" readonly="readonly"/>
<%
rs.close();
%>... And I keep getting this error
root cause
javax.servlet.ServletException: java.sql.SQLException: Missing IN or OUT parameter at index:: 1Thanks

Thanks for your reply, this is my code ;
CallableStatement cs = connection.prepareCall("{? = call pa_dump_xml.fn_user_diary(?)}");
proc.registerOutParameter(1, Types.INTEGER);
ResultSet rs = cs.executeQuery();          
while (rs.next()) {     
%>
    <input type="text" name="app1" id="textfields1" size="" value="<% out.println(rs.getInt(1));%>" readonly="readonly"/>
......And the error I'm getting is
java.lang.NullPointerException It's a JSP page as an index page where I need to show Data in some textfields on load of page. I'm sure there is a better way of doing this but I can not think how to go about it.
Thanks
Zed

Similar Messages

  • Calling applet in jsp page

    i have made a line graph in applet and i want to call that applet in my jsp project's page....
    <jsp:plugin type= "applet" codebase="." code= "ibill.lineGraph.class" width="400" height="400">
    </jsp:plugin>
    but it dosnt show the applet and give error of Loading java applet is failed....
    can anyone help me please
    with regards

    In one of my project i tried to load applet using the <jsp:plugin> tag but failed. Since i had less time so i have not done the R&D instead i called the applet as
    <applet id="MyApplet" code="MyApplet.class\" archive=\"MyApplet.jar\" width=5 height=3/>and it worked fine for me. You can try this method.
    NOTE: My applet jar file was in the same directory of my JSP page
    Message was edited by:
    diptaPB

  • Calling Classes From JSP pages

    I am importing an application specific class in a JSP page and calling it
              (Win NT). It compiles the servlet successfully but cannot appear to find the
              class during execution.
              I have tried placing the class file / jar file containing the class in
              CLASSPATH environment / weblogic JAVAPATH variable / weblogic ServletClasses
              directory .. so far without any luck.
              I would appreciate any suggestions.
              Regards,
              Pradeep
              

    Put it in WEBLOGICCLASSPATH variable. And make sure it is only in
              WEBLOGICCLASSPATH , nowhere else.
              Cheers - Wei
              John Brown <[email protected]> wrote in message
              news:39693f9e$[email protected]..
              > I am importing an application specific class in a JSP page and calling it
              > (Win NT). It compiles the servlet successfully but cannot appear to find
              the
              > class during execution.
              > I have tried placing the class file / jar file containing the class in
              > CLASSPATH environment / weblogic JAVAPATH variable / weblogic
              ServletClasses
              > directory .. so far without any luck.
              > I would appreciate any suggestions.
              >
              > Regards,
              >
              > Pradeep
              >
              >
              >
              

  • Calling Beans from JSP page

    hi,
    I tried to my best to call java beans from JSP page but it generate error that "unable to load class....", please help me that in which directory jsp file and bean *.class file reside, currently my setting are as follows.
    Note: I am using tomcat server and my jsp and servlet files are running seccessfuly, there is any special change in classpath for java beans? if any please tell
    My jsp file is in tomcat-->webapps-->jsp--><my file>
    My bean (*.class) file-->webapps-->Root-->web-inf-->classes--><my file>
    Pleae help me for the above problem.
    Mubashar ([email protected])

    According to J2EE standards:
    The web appl directory structure should be:
    WebAppRootDirectory
    |
    |---html, jsp, images etc
    |
    |---WEB-INF---
    |---classes--
    |---lib
    |
    |
    1) Make sure WEB-INF is in capital letters
    2) Place all ur beans in classes dir or sub-directory in
    classes
    3) In Tomcat place WebAppRootDirectory in webapps
    directory
    [email protected]

  • Can EJB's be called from within JSP pages?

    Hi,
    (This is a general question, not necessarily related to OAS in any way...)
    I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
    Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
    Any help would be appreciated. Thanks!
    David Christopher
    [email protected]

    Hi,
    Check the following code: http://www.jguru.com/jguru/faq/view.jsp?EID=5314 for ejb example.
    -Ruchi
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Davidc:
    Hi,
    (This is a general question, not necessarily related to OAS in any way...)
    I have read/heard conflicting reports pertaining to calling EJBs from within JSP pages.
    Can anyone tell me if it's possible to reference an EJB session bean from a JSP page? Can anyone point me to some documentation on the topic?
    Any help would be appreciated. Thanks!
    David Christopher
    [email protected]<HR></BLOCKQUOTE>
    null

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • How to pass servlet parameter using encodeURL function in JSP page

    Hi!!!
    I have a very urgently problem.
    in my JSP I have this:
    <IMG border="0" src='<%=response.encodeURL("/MyImageServlet")%>'>
    In this way, my servlet works fine (and I have in my page my blob-image).
    But I have to pass to my servlet a list of dynamic parameter. I have tried all the possibilities like:
    <IMG border="0" src='<%= (response.encodeURL("/MyImageServlet") + "?Param_name=" + sessionBean.getParamValue() + "&anotherParam" + sessionBean.getAnotherParamValue())%>'
    but nothing....
    In my servlet I use the init function to retrieve the initial parameters(defined in my web.xml file) in this way:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    myParam = getInitParameter( "name_of_param");
    but I retrieve only the default value (-1).
    How to pass to my servlet the parameters? Please help me!
    Excuse me for my english,
    thank you for your help!

    Hi!
    Thanks for your reply!
    I have tried this solution but it doesn't work!
    When I do getInitParameter in the init function, the servlet take the default values...
    Maybe I have wrote something wrong?
    Excuse me for my english,
    Thanks

  • How to return javascript function value to jsp page

    Hi i want to retrieve values from javascript function to jsp page, how can i do that ? i am trying this but its not working
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <td>
    <jsp:param id="description" value= "<%=request.initRTE('', '')%>"/>
    </td>
    here this initRTE function is used for displaying rich text editor .....i want to retrieve back the contetnt written in this editor and save it to DB.
    Please help.
    Edited by: xtech on Apr 4, 2008 12:00 PM

    surely i will do that but my app is still not working.....
    here is my code
    </td>
    <td align="left">
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <h:inputHidden id="introtext" value= "<%=request.getParameterValues(description)%>">
    <script>
    initRTE('','');
    </script>
    </td>
    in java script function i am geeting the text content
    function initRTE(rtePreloadContent, rteCSS) {
    rtePreloadContent=document.getElementById('surveyinfo:introtext').value;
    startRTE(rtePreloadContent);
    menuBuilder();
    var description= document.getElementById(rteFormName).value;
    return description;
    basically i want to get the text written in text editor in jsp and want to send it to DB.(Here initRTE() function is calling rich text editor)
    i have downloaded this editor from this url
    http://freerichtexteditor.com/page/4.htm
    and trying to embed it in my app.

  • How Can I Add Pivot Tables of Excel Into JSP Pages

    Hello all,
    Basing upon a query to database, i wanted to add a Microsoft Excel pivot table functionality in JSP page [with the result of query].
    Is it possible to create a Pivot Table in JSP with dynamic data from database ??
    Can any body help me in solving this issue ???
    Thanks & Regards
    Krishna

    There are a few alternatives to doing this (depending on the clients you are serving this page up for).
    Going the pure HTML
    There is an open source project called JPivot which provides an HTML front end for Pivot Table (using tag libraries)
    Going the Microsoft Office route there are a few options:
    1) POI HSSF ( http://jakarta.apache.org/poi/index.html) allows you to "update" an existing Pivot table by replacing data values contained in a template pivot table.
    2) Use the open source XELEM api (xelem.sourceforge.net) which produces SpreadsheetML (Micorsofts current XML file Format). At present, I don't believe this handles creating a pivot table from scratch (you have to manually create the Pivot Table template, read in the template (with XELEM) and update the data values in the template before writing it out. (the same holds true for POI)
    3) Commercially the company I work for (www.workbeans.com) is writing a pure Java Pivot Table API that will allow you to create a Pivot Table in the Excel SpreadsheetML file format from scratch. (supported by Office 2000, XP and 2003). The Pivot table functionality isn't slated until a future release (Oct. 2005), so if you can wait until then we could help you further.
    Best,
    Eric
    M. Eric DeFazio
    Application Architect, workbeans
    [email protected]

  • How can i execute some code in a jsp page on the same page ? plz read.

    I have made a single JSP Page where in i want to delete users, create users, update table data.
    I have all the UI on the first page. Now i want to write my all JDBC coding on just this single page. I don't want to create 3 separate pages. Can it be done ?

    This is my page !!
    I have 3 separate pages insert.jsp, delete.jsp, update.jsp to implement the jdbc coding. I know that i can get it done by calling a single jsp page using URL rewriting. But i want to code for events on this very page only.
    <%@page language="java"%>
    <%@page import="java.sql.*"%>
    <HTML>
         <BODY>
              <form method=post action="insert.jsp">
                   Username:<input type=text name=username><br>
                   Password:<input type=password name=password><br>
                   <input type=submit>               
              </form>
              <hr>
              <form method=post action="delete.jsp">
                   Username:<input type=text name=username><br>
                   <input type=submit>               
              </form>
              <hr>
              <form method=post action="update.jsp">
                   Username:<input type=text name=username><br>
                   Password:<input type=password name=password><br>
                   <input type=submit>               
              </form>          
         </BODY>
    </HTML>

  • Not displaying decalritive component in my jsp page

    i delete my adf libarary jar in my deploy folder and it works fine,but now
    not able to dislay decalartive components in my jsp page
    hi i have decalarative components page which am calling from another jsp page,the thing is when irun my jsp page am not able to display my decalartve components but in design of my jsp page i can see my decalartive components
    my decalaritive components xml is
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <af:componentDef var="attrs" componentVar="comp" definition="public">
    <af:panelGroupLayout id="dc_pgl1" inlineStyle="width:736px;" layout="horizontal" valign="middle"
    halign="center">
    <af:panelFormLayout id="dc_pfl1" rows="1" maxColumns="10"
    inlineStyle="width:376px; height:33px; border-color:Navy; border-style:ridge;">
    <af:commandLink text="Home" id="dc_cl1" action="Home"/>
    <af:commandLink text="TaskPool" id="dc_cl2" action="toPool"/>
    <af:commandLink text="LogOut" id="dc_cl3" action="logout"/>
    <af:selectOneChoice label="Skin" id="dc_soc1" value="#{SkinHelper.currentSkin}">
    <f:selectItems value="#{SkinHelper.currentSkin}" id="dc_si1"/>
    </af:selectOneChoice>
    <af:commandButton text="Select" id="dc_cb1" action="#{SkinHelper.switchSkin}"/>
    </af:panelFormLayout>
    </af:panelGroupLayout>
    <af:xmlContent>
    <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>SmscomponentDef</display-name>
    <component-class>component.SmscomponentDef</component-class>
    <component-extension>
    <component-tag-namespace>component</component-tag-namespace>
    <component-taglib-uri>/componentLib1</component-taglib-uri>
    </component-extension>
    </component>
    </af:xmlContent>
    </af:componentDef>
    </jsp:root>
    when i drag and drop my decalaritive components from my components platter i get the below xml in my jsp page
    <sms:SmscomponentDef id="sd1"/>
    reference
    error running running application with decalaritive components

    timo
    Please be patient and wait for an answer in the other thread...
    how can i display the declarative components on the jsp page, am not able to diplay in runtime but can see decalarative components in design
    Edited by: Tshifhiwa on 2012/06/26 8:26 PM

  • Left menu in a jsp page

    Hi,
    There is a standard jsp page, which has a menu on the left side and this menu appears on some of the pages forwarded from this page.
    I have created an OA page, in this I need to call the second jsp page.
    I am able to forward to this jsp page, but the menu on the left side is not getting displayed.
    What could be the reason?
    How can I forward to the standard page?
    --Divya.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You need to analyze the page structure and logic of the jsp which has the menu. Try to find out if the menu rendering has any dependency on any session variable or something similar.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                               

  • Carrying values across jsp pages

    hi there!
    i got a quick question...
    ive got a login page where users enter their email address and a password and upon pressing the submit button the login page calls the page processlogin.jsp which verifies this email addres and password with those values stored in the database.
    a successful login then displays another page where users submit other details. this form then calls another process jsp page which stores this new information in another table in the database.
    my question is how do i 'pass' through that initial email address the user enters on the login page through to this latter page....and inevitably...on to other pages too.
    the reason i need to do this is cos the table which i am storing these new details has email address as its foreign key and i need to store the same value.
    many thanks! :o)

    the simplest thing to do is create a bean to hold on to values a user enters and simply have access to them using the <%= bean.getEMAIL() %> or something like that. For multiple form pages, I like using <input type=hidden ...> to store values without having to create object to store them.
    But I think in your case, since you have a processing page for the form before it goes on then the bean is the best solution.
    Good luck

  • PLEASE HELP!!! using servlet to generate an image in jsp page

    Hi,
    I am so stuck on this... please help.
    I have a servlet that generated a gif image dynamically. It uses a bean that stores the gif image in a byte array.
    The servlet outputs the byte data to the output stream. The code is really simple and looks like this:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            //HttpSession session = request.getSession();
            try {
                ServletOutputStream stream = response.getOutputStream();
                ImageByteInformation imageByteInfo = (ImageByteInformation) request.getAttribute("imageByteInformation");
                response.setContentType("image/gif");
                response.setContentLength(imageByteInfo.getByteData().length);
                stream.write(imageByteInfo.getByteData(), 0, imageByteInfo.getByteData().length);
                stream.flush();
            }catch( Exception e){   
                System.out.println("You are hooped!: " + e.getMessage() + " " + e.toString());           
            }When I redirect from the dispatch servlet straight to this servlet an image shows up in the browser window.
    However when I try to use this jsp page to display the image nothing happens...
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h2>Hello World!</h2>
            <img src="servlets/Map24ImageDisplayServlet"/>
             //I also tried src/servlets/Map24..., /src/servlets/Map24..., /display, servlets/display
            <h2>Did you see the image?</h2>
        </body>
    </html>My web.xml is here if it helps...
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <display-name>HelloProject</display-name>
    <servlet>
        <display-name>ServletDispatcher</display-name>
        <servlet-name>ServletDispatcher</servlet-name>
        <servlet-class>servlets.ServletDispatcher</servlet-class>
      </servlet>
      <servlet>
        <display-name>Map24ImageDisplayServlet</display-name>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <servlet-class>servlets.Map24ImageDisplayServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>ServletDispatcher</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
      <error-page>
        <error-code>404</error-code>
        <location>/404_error.html</location>
      </error-page>
      <servlet-mapping>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <url-pattern>/display</url-pattern>
      </servlet-mapping>
    </web-app>I can never get an image to come up. In fact I can never get the jsp page to run the servlet at all! HELP!!! What am I doing wrong?
    Thanks
    Edited by: Kind_of_Green on May 5, 2008 3:55 PM
    Edited by: Kind_of_Green on May 5, 2008 4:00 PM

    OK... so you WERE absolutely right about the src path for the image tag.
    However I also had another problem that was quite a bit more insidious and mostly just a symptom
    of how little I know about what goes on under the hood of a web app.
    My bean storing the image info was stored as a request attribute. When the servlet was called from the
    jsp page the request object was either reset or just never initialized. Anyway it is not the same request
    object I assumed it was being passed in the doGet method. I added my bean as a session
    attribute and everything is sparkly :)
    I can only assume that when a request is neither forwarded nor included (as is the case with
    calling the servlet from the img tag) it is disappeared.
    Anyway, thanks a mint man. I so totally appreciate your time.
    Ciao :)

  • Please help, jsp pages does not display...

    Hi, I am writing simple JSP pages and running it on
    Tomcat.
    I create a jsp file that has frame in it
    (call this chat_entry_frame.jsp)
    In the frame I call other 2 jsp pages.
    (which is chat_entry.jsp and chat_control.jsp)
    When I test both chat_entry.jsp and chat_control.jsp
    separately, they both fine.
    But when I try to call chat_entry_frame.jsp, it did not
    show anything.
    I have not create web.xml file inside my application...
    I just call both jsp files by specifing their path (relative
    path). All jsp files I put in the same directory.
    So, I wonder what is wrong?
    Thanks in advance for help and suggestion!
    Here are the jsp files:
    chat_entry_frame.jsp:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <%@ page errorPage="chat_error.jsp" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=x-user-defined">
    </meta>
    <title> Online Chat Frame </title>
    </head>
    <body>
    <frameset cols="25%, 75%" border="0">
    <frame src="/chat/jsp/chat_control.jsp" name="entry_control">
    <frame src="/chat/jsp/chat_entry.jsp" name="entry_screen">
    </frameset>
    </body>
    </html>
    chat_control.jsp:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <%@ page errorPage="chat_error.jsp" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=x-user-defined">
    </meta>
    <title> Online Chat </title>
    </head>
    <body bgcolor="#00FFFF">
    <font face="Verdana" color="black">
    <table border=0 cellspacing=0 cellpadding=0 rows=4 cols=1 width=100% bgcolor=#00FFFF>
    <tr>
    <input type="hidden" name="chatCommand" value="register_entry"></input>
    <input type="submit" value="Register" name="register"></input>
    </tr>
    <tr>
    <input type="hidden" name="chatCommand" value="faq_entry"></input>
    <input type="submit" value="FAQ" name="faq"></input>
    </tr>
    </body>
    </html>
    chat_entry.jsp:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <%@ page errorPage="chat_error.jsp" %>
    <%
    String username = "";
    try
    username = (String) session.getAttribute("username");
    if (username == null)
    username = "";
    catch (java.lang.NullPointerException ex)
    username = "";
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=x-user-defined">
    </meta>
    <title> Online Chat </title>
    </head>
    <body bgcolor="#00FFFF">
    <font face="Verdana" color="black">
    <h3 align="center"> Login Page </h3>
    <br>
    <h5>
    <form name="chat_entry" method="POST" action="/chat/servlet/ChatEngine">
    <table border=0 cellspacing=0 cellpadding=0 rows=4 cols=1 width=100% bgcolor=#00FFFF>
    <tr>
    <td><label for="username">Username: </label></td>
    <td><input type="text" name="username" value=<%=username%> ></input></td>
    </tr>
    <tr>
    <td><label for="password">Password: </label></td>
    <td><input type="password" name="password"></input></td>
    </tr>
    <tr>
    <td><input type="hidden" name="chatCommand" value="check_login"></input></td>
    <td><input type="submit" value="login" name="submit"></input>
    <form name="forgot_password" method="POST" action="/chat/servlet/ChatEngine">
    <input type="hidden" name="chatCommand" value="forgot_password"></input>
    <input type="submit" value="Forgot Password" name="submit"></input>
    </form>
    </td>
    </tr>
    </h5>
    </body>
    </html>

    Hi,
    Your problem is not with TomCat, When you specify a frameset, the HTML code cannot have the body tag, just remove it from your chat_entry_frame.jsp and it has to work.
    Hope this helps...

Maybe you are looking for