Maintain session when calling servlet from form in a JSP

I have the following set up:
index.jsp calls login servlet from the action tag in a form.
Login servlet handles the login, stores the user info and db connection in the session and uses forward(req,res) to call another jsp.
That jsp has a form where user enters search info and in that form's action tag there is a search servlet. In the search servlet I am unable to access the session.
Is there any way to pass the session to the servlet from that jsp using a form/action?

I've read elsewhere that if you go from a jsp to a servlet that the >request object is cleared of any attributes from the previous request.which is correct. But arent we speaking about session object here? A request object is valid for a request - ie the phase from where the server receieves a hit for a resource upto the point it sends the output for that request.
A session spans multiple requests.
it doesn't retrieve the session info and gives me a null pointer >exception when I try to use the connection object stored in the session.Bad bad bad . Why do you store Connection objects in session? Create them when necessary or use a connection pool. Do you for example clean up the connections when the session expires. What if its a 30 minute session and the user hits every say 15 minutes with a request. Why do you need to hold on to the Connection in the intervening interval when the user's session is inactive?
gives me a null pointer exception when I try to use the connection object stored in the session.which means that the Connection object is null - not the session object.
That last line is where I get the null pointer exception. And that is
Statement stmt = con.createStatement();?
Same answer as above.
If the session object was null,
userSession.getAttribute("connection");would have thrown a NPE.
ram.

Similar Messages

  • Getting rep-3002 when calling report from form on web

    i am getting rep-3002 when i call report from a form on web environment. Report is in character mode. It is coming proper if i change it to bitmap. but my requirement is of character mode. pl. give some solution.

    Hello,
    If you are running in WinNT/2000 environment, the NT/2000 user which runs the Report Server service must have a printer defined. In the control panel, look at the properties for the Report Server to see what user it runs as. Log in as that user and make sure a default printer is defined.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Getting   FRM-41029   when calling report from form

    Hi
    I have following procedure to run the report but its running fine but giving error FRM-41029 when calling the report from the form.
    runrep('MATREP,'REPSER','PDF','F:\rec\RepEnt.RDF');
    Repid := FIND_REPORT_OBJECT(repobj);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE, RUNTIME);
    set_report_object_property(repid, REPORT_SERVER, repserv);
    set_report_object_property(repid, REPORT_COMM_MODE, SYNCHRONOUS);
    set_report_object_property(repid, REPORT_DESTYPE,'file');
    set_report_object_property(repid, REPORT_DESFORMAT,repfor);
    set_report_object_property(repid, REPORT_FILENAME,repfile);
    rgds
    soumya

    hi
    try something like this.
    PROCEDURE sarah ( p_report_name varchar2, vParamValue number ) is
    l_param_list  paramlist;
    l_rep_id      report_object;
    l_rep_job     varchar2(100);
    l_rep_status  varchar(100);
    BEGIN
    l_param_list := Get_parameter_List('tmp');
    IF NOT Id_Null(l_param_list ) THEN
    Destroy_parameter_List( l_param_list );
    END IF;
    l_param_list := Create_parameter_List('tmp');
    add_parameter(l_param_list ,'p_num',text_parameter,to_char( vParamValue ));
    l_rep_id := FIND_REPORT_OBJECT( p_report_name );
    if
         id_null ( l_rep_id )
    then
      msg ( 'There is no Report ' || p_report_name || ' in form ' || name_in ( 'system.current_form' ) );
      raise form_trigger_failure;
    end if;
    SET_REPORT_OBJECT_PROPERTY(l_rep_id, REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(l_rep_id, REPORT_DESTYPE,cache);
    SET_REPORT_OBJECT_PROPERTY(l_rep_id, REPORT_DESFORMAT,'PDF');
    SET_REPORT_OBJECT_PROPERTY(l_rep_id, REPORT_OTHER, 'paramform=no');
    l_rep_job := RUN_REPORT_OBJECT( l_rep_id, l_param_list );
    l_rep_status := REPORT_OBJECT_STATUS( l_rep_job );
    WHILE l_rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    l_rep_status := report_object_status( l_rep_job );
    END LOOP;
    WEB.SHOW_DOCUMENT('http://sarah:8889/reports/rwservlet/getjobid'||substr(l_rep_job,instr(l_rep_job,'_',-1)+1) || '?server=repserver', '_blank');
    END; then u may call the procedure something like this.
    when-button-pressed trigger.
    begin
    sarah ('REPORT6', :block.item );
    end;sarah
    Edited by: S@R@h on Nov 30, 2009 9:39 PM

  • When calling report from forms, only html format report can show chinese characters

    To all experts,
    When I run report by calling run_report_object() in forms, only html format can show chinese characters. If I choose pdf format, garbage characters were shown instead of chinese characters. My settings on server are as follows:
    NLS_LANG=TRADITIONAL CHINESE_HONG KONG.UTF8
    FORMS60_REPFORMAT=PDF
    Do you know why? I hope to print report in PDF format as PDF turned out to be more regular in format. Is there any additional settings required?
    May experts here broaden my mind?
    Richard

    You have two different ways of generating Japanese PDF files from Reoprts. One is font aliasing and the other is font subsetting.
    <font aliasing>
    You will need to have the following entries in uiprint.txt (example).
    [ PDF ]
    .....JA16SJIS = "KozMinPro-Regular-Acro"
    "MS UI Gothic".....JA16SJIS = "KozMinPro-Regular-Acro"
    You may need to download and install Japanese Font Pack from Adobe's web site (if your Acrobat is non-Japanese version).
    <font subsetting>
    You will need to add C:\WINNT\Fonts (or wherever your TTF/TTC fonts are installed) to your REPORTS_PATH.
    You will also need to have the following entries in uiprint.txt (example).
    [ PDF:Subset ]
    "Andale Duospace WT J" = "Aduoj.ttf"
    "Albany WT J"="AlbanWTJ.ttf"
    "MS UI Gothic" = "msgothic.ttc"

  • No Parameter form when calling report from Forms 6i webpage

    I have my Forms 6i fmx files and Reports rep files runnung off of HP Unix
    within the same directory and yet when I call the report with RUN_PRODUCT,
    I don't get the Parameter Form popup. I left it as default at first, and then I even tried using ADD_PARAMETER(pl_id,'PARAMFORM',TEXT_PARAMETER,'HTML') to my parameter pl_id in my RUN_PRODUCT call. Can anyone tell me why I don't get a Parameter form?

    Actually if you are on the Web then you don't have much control over the format the parameter form is in, so specifying it as HTML doesn't help.
    Try paramform=yes when calling teh Report and this "temporarily" should help. The problem that you run into the is that there is nothing happening when you click the parameter form submit button. The reason is that when using Run_Product you are talking to a static HTML file generated into teh Reports temp directory with no services assigned to it.
    Check the Whitepaper under http://otn.oracle.com/products/reports/pdf/277282.pdf for the options that you have.
    Frank

  • Urgent: Getting FRM-41211 when calling reports from forms for first time.

    Hi,
    We are running into the FRM-41211 error, when the users try to call a report from a form. The report is called from a form in SYNCHRONOUS mode. This is the only report that is being called. No other report is
    running at that time when the users get this error. This is happening only the first time when they try to call the report from the form. After getting this error, when they click on OK, and when they try to call this
    report again, the report works fine.
    Any ideas?? It's urgent...
    Thanks
    Vamshi.
    null

    Maybe try to use "run_report_product"?

  • Error when calling procedure from form personalization

    Hi every body
    I want to call a procudre using form personalization . I made the procedure and in form personalization i call it as follow:
    built in type : Execute a Procedure
    Argument :
    ='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )'
    but the following error raised when i click on Apply Now button :
    the string (='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )' )
    couldn't be evaluated because of error ORA-06550 :line 1 , column 43
    PLS-00103:encountered the symbol ")" while expecting one of the folowing (- + ...... etc
    can anyone have a solution to this problem because it made me mad .(urgent)
    Or if anyone have another way to call the procedure ??
    Note that i want to pass db_session_id to the procedure from the application so does anyone have a complian about the way of passing this parameter to the procedure ??

    See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674

  • Parameter form not coming up when calling report6i from forms 6i thru run_product

    we are using 3 tier architecture. and using the thin clients on windows platform (netscape navigater 4.7 as browser)
    Middle Tier (IAS ) is on compaq Proliant Windows NT server
    and database is on compaq ALPHA DS20E machine on true 64 UNIX.
    WE are using forms and reports 6i.
    when we are calling a report(from web browser) from a form thru' RUN_PRODUCT report is running with out displaying the parameter form.
    but when we are running the same report in client/server (2 tier)
    parameter form is displaying.
    we are unable to solve this problem.
    Thanks in advance
    Mukesh Sharma
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    we are using 3 tier architecture. and using the thin clients on windows platform (netscape navigater 4.7 as browser)
    Middle Tier (IAS ) is on compaq Proliant Windows NT server
    and database is on compaq ALPHA DS20E machine on true 64 UNIX.
    WE are using forms and reports 6i.
    when we are calling a report(from web browser) from a form thru' RUN_PRODUCT report is running with out displaying the parameter form.
    but when we are running the same report in client/server (2 tier)
    parameter form is displaying.
    we are unable to solve this problem.
    Thanks in advance
    Mukesh Sharma<HR></BLOCKQUOTE>
    But with show_document i have to provide the username and password as url which will be displayed in browser and i dont want to
    provide username and password to end user.
    If Any one have any solution Please revert.
    Thanks
    Mukesh Sharma

  • To open Report in Maximize form when calling it from FORM

    Dear All,
    I am facing a problem related to Report.When a report is called
    from the FORM, this report is not openned in MAXIMIZE form. How
    will it be openned in Maximize form.
    If there is any solution for it. Please write....
    Regards,
    Akhilesh P. Verma

    Have you tried to specify the following Reports runtime
    parameter?
    MAXIMIZE=YES

  • Supressing the parameter form when calling report from form...

    Hi everybody
    I call a report from a form passing a parameter. After pressing
    the button, the runtime parameter from appears. How do I
    suppress it so that the report appears right after pressing the
    button???
    Thanks
    Serguei

    Hi Serguei ,
    You have to add a text parameter 'PARAMFORM' with the value
    'NO' to the passing parameter list.

  • Default file location when calling report from Forms 10G

    I've tried this in the reports forum, but it applies equally to forms I guess..
    Hi,
    I've managed to put together a routine for running a report from a 10G Form. In 6i I specified a "relative path" to my report name as follows:-
    "Run_Product(REPORTS, '..\Reports\myreportname', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL); "
    In 10G I would like to just specify the report name, rather than the full file path. Can I specify a relative file path - or alternatively can I set the default report location in a configuration file?
    At the moment I'm having to specify something like:
    SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME,
    'c:\oracle\systemname\reports\myreportname.RDF');
    I would like to just have:
    SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME,
    'myreportname.RDF');
    Many thanks,
    Keith.

    Do you run your application on an application server?
    If so you should use the REPORTS_PATH environment variable (in windows registry entry).
    Alternatively you could use an environmentid in the reports.conf-file:
    <server version="10.1.2.0.2">
    <environment id="YOURID">
    <envVariable name="REPORTS_PATH" value="C:\......"/>
    </environment>
    You call the report with the parameter &envid=YOURID in the URL.

  • Wierd SQL problem when calling StoredProc from Forms's JavaBean

    Hello,
    I have a Oracle Forms form and it contains JavaBean that uses Oracle DB via JDBC. Wierd thing is that sometimes I get following error in Oracle Forms.
    Error: ORA-06550 line, column 13: PLS-00201: identifier 'F1' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored.
    What in earth this means? Sometimes I don't get it put after a while it starts appearing again.
    F1 is a following function in DB:
    CREATE OR REPLACE FUNCTION F1 ( PN$Param IN NUMBER )
    RETURN VARCHAR2
    IS
    BEGIN
    DBMS_LOCK.Sleep( PN$Param ) ;
    RETURN ('Function ended at ' || To_Char(SYSDATE,'HH24:MI:SS') );
    END;
    My Oracle Forms Pushbutton code is following: (WHEN-BTN-PRESSED)
    Declare
         LC$Res Varchar2(32000) ;
    Begin     
    Set_Custom_Property( 'EMP.BEAN',
    1, 'INITCONN', 'jdbc:oracle:thin:@localhost:1521:demo') ;
    Set_Custom_Property( 'EMP.BEAN', 1, 'INITUSER', 'scott' ) ;
    Set_Custom_Property( 'EMP.BEAN', 1, 'INITPWD' , 'tiger' ) ;           
    Set_Custom_Property( 'EMP.BEAN', 1, 'INITFUNC',
    'begin ? := ' || 'F1(10);' || ' end;' ) ;
    Message('Command sent'); synchronize;      
    End ;
    And JavaBean just fetch data using JDBC code below:
    CallableStatement function = conn.prepareCall (sQuery);
    function.registerOutParameter(1, Types.CHAR);
    function.execute ();
    sValue = function.getString (1) ;
    function.close();
    The purpose is to wait 10 seconds and then return time after that.
    I have put JavaBeans code in jar file, signed it and declated it to Oracle Forms.
    When I have created F1 I have granted execute public access:
    grant execute on F1 to public;
    Have anyone any ideas what could cause this kind of error?
    Cheers!

    Do they give support to their sample snippets?
    Yep, StoredProc+PLSQL is taken from French site's sample to this sample
    but that is the real issue of samples. Or do you disagree?
    But I and my collague have same problems with same kind of thing.
    One thing was that taking time from DB might charge more user rights... but I'm not sure. So, please tell if you know something. Quite mnny seems to have problems with that SP.

  • How to hide URL when calling Reports from Forms 10g.

    Hi ,
    When end user runs a report through a form then report output is displayed and following type of URL is also generated on address bar of browser: http://server:7778/reports/rwservlet/getjobid22243?server=rep_servername_appsrv
    Can we hide this URL so that the user cant change the JOB_ID and get access to other previous reports.
    Thanks & Regards,
    NL

    Actually, there are several options including the one already offered above. Here are a few more:
    1. If you are using 10.1.2.3 and a newer JRE on the client (e.g. 1.6.0_10 or newer), you could use java script to open the report. This will not be a perfect solution because it may not work if using a non-IE browser or if java scripting is disabled. Refer to MyOracleSupport Article 265863.1 for more information.
    EXAMPLE:
    WEB.SHOW_DOCUMENT ('javascript:void(window.open("http://www.oracle.com","","location=no,toolbar=no,menubar=no,"));self.close()','_blank');Replace the url in the above example with the call to your report.
    2. Set the age of the cache to a very short value so that it is only available long enough to be viewed by the user who created it. In other words, when setting the reports properties in your Forms code, include the Reports "others" parameter with TOLERANCE=1
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'TOLERANCE=1');This will cause the cache (on the server) to live for only one minute then be deleted. Refer to the Report Deployment Guide for more information.
    3. Upgrade to Fusion Middleware (Forms/Reports) 11. In version 11, the Reports jobid can be randomized. See section 18.8.2 of the Reports 11 Deployment Guide
    http://download.oracle.com/docs/cd/E14571_01/bi.1111/b32121/toc.htm

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

  • Run servlet from form action tag

    This is my first post to this forum, thanks in advance for any and all help!
    I'm utilizing Tomcat 4.0.1. I've got the following form tag within my JSP:
    <form name="orderForm" method="GET" action="/myAppName/myServletName">
    I've made the context entry for myAppName within ..tomcat/conf/server.xml.
    I've got a properly formatted ..tomcat/webapps/myAppName/web-inf/web.xml
    When submitting the form, Tomcat immediately reports that the resource (myServletName) is unavailable.
    I've download the bookstore sample app from Sun; it is working properly.
    Any idea what I'm missing here?
    The bookstore app calls the servlet from a hyperlink rather that a form action. Do JSP's treat forms differently when calling servlets?
    Thanks again for any assistance.
    Bruce

    Yes, my .class files in in Tomcathome/webapps/appname/web-inf/classes
    If I try and call the servlet from the Address box of the browser, I get the same error listed above.
    Here is the contents of my Tomcathome/webapps/appname/web-inf/web.xml:
    <-- entry begins here
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <servlet>
              <servlet-name>myServletName</servlet-name>
              <servlet-class>myServletName</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>myServletName</servlet-name>
              <url-pattern>/myServletName</url-pattern>
         </servlet-mapping>
    </web-app>
    < -- entry ends here
    Here is the entry I've made in Tomcathome/conf/server.xml:
    <--entry begins here
    <Context path="/appName" docBase="appName" debug="0" reloadable="true" />
    <--entry ends here
    The only Tomcat related entry in my classpath is:
    d:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;
    Again, thanks for all your assistance...this is driving me nuts (granted, it wasn't a long trip!)
    Bruce

Maybe you are looking for