Setting a session via post data on a Java/J2EE server application

Hi.
I can't seem to find anything like a Session.getSession(String sessionId) method, nor can I find anything like a request.setSession(HttpSession) method. Is there any way I can get ahold of a session object by ID rather than relying on the HttpServletRequest object to automagically give me the session object it thinks I want?

HttpSession is directly tied to Session.
HttpSessionContext is there but is depricated now:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionContext.html

Similar Messages

  • 9iAS: Programmatically change data source for Java/J2ee bc4j application

    Background: We obtain a copy of our customer's live data daily for support issues. We'd like to be able to keep up to date as possible and get files early in the morning. due to the size of the database, it takes a few hours to download and import into our Oracle database. what I'd like to do is use two different schemas/users for the data, alternating on each day so that the loading of one, does not affect the running of the other. To make this seamless, I'd like to have a script perform the changes after the download and restart the server. The issue is how/where to change the data source so that my application will pick it up each time? I'm using an application specific data source from EM.
    Any ideas?
    Thanks,
    Jeff

    If it is intended to be accessible from Reports servlet then you can use "ssoconn" command line option where by the user name and password is stored in OID (Oracle Internet Directory)
    Pls see publishing reports to web document --> command line options -> rwservlet
    (link below)
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

  • Passing Parameters via Post Method from Webdynpro Java to a web application

    Hello Experts,
    I want to pass few parameters from a web dynpro application to an external web application.
    In order to achieve this, I am referring to the below thread:
    HTTP Post
    As mentioned in the thread, I am trying to create an additional Suspend Plug parameter (besides 'Url' of type String) with name 'postParams' and of type Map.
    But when I build my DC, I am getting the same error which most of the people in the thread have mentioned:
    Controller XXXCompInterfaceView [Suspend]: Outbound plug (of type 'Suspend') 'Suspend' may have at most two parameters: 'Url' of type 'string' and 'postParams' of type 'Map'.
    I am using SAP NetWeaver Developer Studio Version: 7.01.00
    Kindly suggest if this is the NWDS version issue or is it something else that I am missing out.
    Also, if it is the NWDS version issue please let me know the NWDS version that I can use to avoid this error.
    Any other suggestion/alternative approach to pass the parameters via POST method from webdynpro java to an external web application apart from the one which is mentioned in the above thread is most welcome.
    Thanks & Regards,
    Anurag

    Hi,
    This is purely a java approach, even you can try this for your requirement.
    There are two types of http calls synchronous call or Asynchronous call. So you have to choose the way to pass parameters in post method based on the http call.
    if it is synchronous means, collect all the values from users/parameters using UI element eg: form and pass all the values via form to the next page is nothing but your web application url.
    If it is Asynchronous  means, write a http client in java and integrate the same with your custom code and you can find an option for sending parameters in post method.
    here you go and find the way to implement Asynchronous  scenario,
    http://www.theserverside.com/news/1365153/HttpClient-and-FileUpload
    http://download.oracle.com/javase/tutorial/networking/urls/readingWriting.html
    http://digiassn.blogspot.com/2008/10/java-simple-httpurlconnection-example.html
    Thanks & Regards
    Rajesh A

  • How can FMS create a text file and write data into it in the Server application folders?

    Recently, I writed a programe about creating a text file and writing data into it in the server application folder. My code is as following:
               var fileObj = new File("/MyApp/test.txt");
               if( fileObj !=  null)
                      if(fileObj.open( "text", "append"))
                            fileObj.write( "                                                      ———— Chat Info Backup ————\r\n" );
                            fileObj.close( );
                            trace("Chat info backup document :" +  fileObj.name + " has been created successfully!");    
    But when I run it, FMS throw the error as following: File operation open failed  ;  TypeError: fileObj has no properties.
    Can you help me ? Thanks in advance.
    Supplement: The text file named test.txt doesn't exist before create the fileObj, an instance of File Class.

    Is MyApp the name of the application directory, or is it a child of the application directory? If myApp is the app name, just use test.txt as the path flag in the file constructor.

  • DOCUMENT SETTING that ALLOW FUTURE POSTING DATE does not work in PL34

    Hi Expert,
    I am now using SAP B1 2005B (7.40.252) sp:00 pl:34 and realised that the ALLOW Future Posting Date was not working. 
    I still can remember while I was using pl:11 at B1 2005A, there is no such problem and wish to know when can the bug fix up? in which sp/pl?
    Wish to hear goods news ASAP .
    Thank you.
    Joan.

    Basically can you please clarrify your requirement as to what you want to change ..what I understand you would need to change the code for ABAP - RFEBBE00
    Value Date code in the above abap
            IF PAR_VALD = 'X'.
              MOVE C2-VALDT TO HLP_VALDT.  "  VALUE DATE
             write hlp_valdt to umsatz-budat dd/mm/yy.
            ELSE.
              MOVE C8-BALDT TO HLP_BALDT.
              MOVE HLP_BALDT TO HLP_VALDT.
            write hlp_valdt to umsatz-budat dd/mm/yy.
            ENDIF.
               MOVE HLP_VALDT(2) TO UMSATZ-BUDAT.
               MOVE HLP_VALDT2(2) TO UMSATZ-BUDAT3.
               MOVE HLP_VALDT4(2) TO UMSATZ-BUDAT6.
    Regards
    Anurag
    Message was edited by: Anurag Bankley

  • Programatically accessing certificate data on Sun Java Web Server

    Hi - I have set up Sun Java Webserver 7.x to do client auth. When the client cert is presented to the webserver, I need to capture the data and send it to the app server using the javax.security.cert.X509Certificate class
    I am not creating a webapp/war file. The webserver is the front end for a Broadvision (old school, I know) portal. I tried to create a custom authentication realm, but the webserver could not find the class file, (i assume because it is not associated with a webapp).
    I know i am bucking the trend by not going the webapp route, but this seems to be a simple enough thing - i just don't know where to put the code and how to configure the webserver to see/execute the code.

    more on my problem can be seen here:
    [http://forums.sun.com/thread.jspa?threadID=5370956&tstart=0|http://forums.sun.com/thread.jspa?threadID=5370956&tstart=0]
    the big picture is this - I have an existing Broadvision portal app (in struts) that has only used the webserver as a webserver - no code ever executes on the webserver, it is merely a gateway to the portal app code. At this point, however, I would like to capture client certificate data when it is presented to the webserver and put that data in the request object to be accessed by the portal code. I have written a servlet filter that resides in a webapp on the webserver, but it never gets executed. The initial page presented by the app has the URL http://xxx.xxx.uscg.mil/cgi-bin/ghamrick/portal/ep/home.do, so you're already in the struts app and there is no way to execute the servlet filter.
    I am thinking that i might put an initial page up with links for 'Direct Login' ie login via the Broadvision app, and 'CAC Login', ie login with certificate on CAC Card. I didn't think that it would be this hard to capture cert data and provide it to the Broadvision app
    Thanks for the reply - Gregg

  • DTW Good Receipt Doc. date and Posting Date

    Dear Professional,
    I have tried to use the DTW Good Receipt Template (oInventoryGenEntry) to unpload the initial open on-hand inventory into B1.
    However, no matter the DocDate (Posting Date) and TaxDate (Doc. Date) I have entered into the Document Template, the system still set "Today" as both Posting Date and Doc. Date after completed uploading the inventory on-hand, is there anything can help to solve or something I missed ??
    Thank,
    Deckard

    Dear Deckard,
    When I did the this DTW, I found the same issue.  B1 probably not allow to import back dated Good Receipt transactions by DTW.
    Thanks,
    Gordon

  • Error while posting data from SCM to XI

    Dear Expertise,
    I got a requirement where I need to post data from SCM to XI server. From SCM
    side it is an ABAP proxy. When I tested the scenario and checked in the MONI of
    SCM I got an error. But SCM is correctly configured pointing to XI under Tcode
    SM59 (SM59 --> Connection Type H (HTTP Connection to ABAP System) -->with
    correct user credentials and PIPE line URL of XI server).
    Please let me know is this the correct settings for ABAP proxy for connecting
    from SCM system to XI system.
    Error Dump in SXMB_MONI:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Integration Server
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>
      <SAP:P1>401</SAP:P1>
      <SAP:P2>Unauthorized</SAP:P2>
      <SAP:P3 />
      <SAP:P4 />
    <SAP:AdditionalText><!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01Transitional//EN">
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>HTTP response contains status code 401 with the description Unauthorized Authorization error while sending by HTTP (error code: 401, error text: Unauthorized)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Thanks in Advance,
    Gujjeti

    HI
    Check these
    For Error: HTTP_RESP_STATUS_CODE_NOT_OK 401 Unauthorized
    Description: The request requires user authentication
    Possible Tips:
    • Check XIAPPLUSER is having this Role -SAP_XI_APPL_SERV_USER
    • If the error is in XI Adapter, then your port entry should J2EE port 5<System no>
    • If the error is in Adapter Engine
    –then have a look into SAP note- 821026, Delete the Adapter Engine cache in transaction SXI_CACHE Goto --> Cache.
    • May be wrong password for user XIISUSER
    • May be wrong password for user XIAFUSER
    – for this Check the Exchange Profile and transaction SU01, try to reset the password -Restart the J2EE Engine to activate changes in the Exchange Profile After doing this, you can restart the message

  • IOException: Premature end of POST data

    Hi, I have a web application with Java 5 / Struts 1.2.4 running on OAS 10g. I have this error when I tried to get any option of the application. The application is deployed in Tomcat, Websphere, JBoss, Glassfish but it fails only in OAS.
    This is the error trace:
    es.IOException: Premature end of POST data
    es.class.java.lang.IllegalStateException
    es.com.megasoft.erp.seguridad.acceso.MenuLauncherAction.execute (MenuLauncherAction.java:63)
    +...+
    +...+
    This is the code of MenuLauncher.java:
    public class MenuLauncherAction extends GenericaDispatchAction {
        private final static String SHC_LOG = "<L>";
        private final static String SHC_CVS = "<V>";
        private final static String FWD_ERROR = "error";
        private final static String FWD_DEFAULT = "default";
        private final static String FWD_MODULOS = "modulos";
        private static final String FWD_APPLOG = "appLog";
        private static final String FWD_CVS = "controlVersion";
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
            Connection conn = null;
            // El forward corresponde a posicón 0 url a donde debe ser enviado o FWD_ a traducir el campo 1 indica si debe mapearse o no.
            String[] forward = new String []{FWD_DEFAULT, "S"};
            try {
                initLog(request);
                String sessionId = request.getSession().getId();          
                conn = UtilDAO.getConnection(getActiveDataSource(request));
                UserPrincipal principal = UserEnvironment.getPrincipal(request);
                String grupo = request.getParameter("grupo");     /*APPLICATION FAILS IN THIS LINE*/
                String modulo = request.getParameter("modulo");
                String permiso = request.getParameter("permiso");
                String shortcut = request.getParameter("shortcut");
                String usuario = UserEnvironment.getLogin(request);
                Integer empresa = UserEnvironment.getEmpresa(request).getCodigo();
                if (!ApplicationUtil.nullOrEmpty(grupo)){
                    SeguridadService segService = (SeguridadService) getServiceLocator().getService(SeguridadService.class);
                    segService.modifyEmpresaPerfil(principal, shortcut, grupo, log, conn);
                    ApplicationEnvironment.addUsuarioPerfilCache(usuario);
                boolean isModulo = !nullOrEmpty(modulo);
                boolean isPermiso = !nullOrEmpty(permiso);
                boolean isShortcut = !nullOrEmpty(shortcut);
                if(isPermiso) {
                    forward = per(empresa, usuario, permiso, principal, sessionId);
                } else if(isModulo) {
                    mod(empresa, usuario, modulo, principal);
                } else if(isShortcut) {
                    forward = shc(empresa, usuario, shortcut, principal, sessionId, conn);
                } else {
                    throw new ValidationException("Parametro incorrecto", "error.menuLauncher.parametros", null);
            }catch (ValidationException e) {
                log.addMessage(e.getKey(), e.getParams(), ApplicationLog.MSG_USER);
            } catch(Exception e) {
                log.addException(e);
            } finally {
                UtilDAO.closeConnection(conn);
                saveLog(request);
            return new ActionForward(forward[1].equalsIgnoreCase("S")?mapping.findForward(forward[0]).getPath():forward[0]);
    I have a javascript code that builds all urls of the application, this is the javascript code:
    function loadOptionMenu(context, grupo){
         var cargarUrl = false;
         var urlTpw = document.getElementById("urlTpw");
         var btnShortcut = document.getElementById("btnShortcut");
         var url = context + "/menu.do?";
         if (urlTpw!=null && urlTpw.value!=''){
              url =  urlTpw.value + '&';
         if(btnShortcut.value!=""){
              cargarUrl = true;
              url += "shortcut=" + btnShortcut.value.toLowerCase();
         if (grupo!=null && grupo!=""){
              url += "&grupo=" + grupo;
         //alert('URL a cargar: ' + url);
         if (cargarUrl){
              cargar(url, true);
    }Finally code above builds an url in this way:
    http://localhost:8080/neon/menu.do?shortcut=con&grupo=ADMCONTRATO
    I had been googling about error, in this post http://en.allexperts.com/q/JSP-Java-Server-3299/Question-request-class.htm answered a possible solution. I don't know if the order of the parameters in the url and the way that it were called is important. it must be? may be another cause?
    Thanks for your help
    Fernando G.

    what does "initLog()" do with the request object (or any of the other calls which take the request instance)? are any of them looking at the stream/reader associated with the request?
    Edited by: jtahlborn on Aug 10, 2011 4:54 PM

  • How to Record HTTP Requests and POST data

    Hai all..
    Can anyone help me to solve this issue..
    How to Record HTTP Requests and POST data by using java..
    regards
    Ranjith Nair

    You should read about TCP and splitting data stream into packets and learn how to understand packet header to assemble stream from packets.
    Actually there are few different stages:
    1. detect handshake to start new empty stream within your code;
    2. detect subsequent packets and assemble stream (there are counters within packet header and they will help).
    After creating start of TCP stream (usually 1KB is enough) you'll be able to detect is it HTTP request/header or no and start logging or ignoring packets for this connection.

  • Is it possible to send data to ITS via POST?

    Hi guys!
    I need to call SAP transaction via thin client and I need to make a call via POST, cos' I need to send there some data to process. Is it possible?
    Thanx, Peter

    Hi Peter,
    First some information about parameter transfer with ITS in general.
    http://server:port/scripts/wgate/<service name>/!?transaction=<transaction_name>&<inputfieldname1>=<value1>&<inputfieldname2>=<value2>&okcode=<okcode>
    The parameters can als be transferred as POST parameters. For this you need a form e.g.
    <form name="<form name>" method="post" action="`wgateURL() ...
    You might get some ideas by studying the login.html in the templast folder system of your ITS instance.
    Thanks and regards,
    Dieter

  • Calling a new browser window with WD Abap and passing data via POST

    Hi there,
    does anybody know whether passing data via POST method is possible when opening a new browser window from within a Web Dynpro Component? In my case I use method IF_WD_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW for opening a new browser window. Now I want to pass a big amount of data which is only possible via POST method. How can I achieve that or is it not considered inside the Web Dynpro Framework?
    Kind regards,
    Albert

    Hi Priya,
    can you please explain a little bit more what you mean? I didn't get it..
    Kind regards,
    Albert

  • Error adding Sales order via DI-SERVER Posting Date deviates from the defin

    When adding a sales order via the DI-API we have started receiving the following error:
    Error: Posting Date deviates from the defined range. To complete the operation, define the posting period to match the entered Posting Date. [(----) 131-204]
    I have verified that the posting dates within the document exist within the defined posting periods in SAP and that the posting period in question is unlocked.
    I can add the document within the SAP B1 interface without any issues.
    This process and code was also working up until the start of the new financial year.  There have been no changes to the code or the financial periods in the new year.
    There is a  peculiarity with the financial periods for this company in that they have moved from calendar periods in the past to financial periods.  Has anyone come accross any issues with posting dates and the DI SERVER API?
    The dates in the XML document that we are trying to add are shown below.
    <Documents>
    <row>
    <DocDate>20100310</DocDate>
    <DocDueDate>20100310</DocDueDate>
    <CardCode>C9999</CardCode>
    The following are the financial period values from OFPR
    Posting Date From/To:       06.03.10     02.04.10
    Due Date From/To:            01.01.10     01.04.11
    Document Date From/To:  01.01.10     02.04.10
    Start of Fiscal Year:         01.01.10
    Regards,
    Sean

    Hi Gordon,
    Our customer has moved their financial year end from 1 April / 31 March using calendar months to a 4/4/5 financial period model with a year start date from Jan.
    This was necessary after the company was purchased by a US firm that wanted to align the reporting calendars.
    Under the 4/4/5 model their financial year start date does not start 1st January. Hence the 3/1/2010 being the first date of the January period.
    No matter how the periods are setup the financial year start date in SAP Business One cannot be anything other than the 1st of the month.
    All posting within SAP appears to be working fine, it is only via the DI SERVER requests that we seem to be having problems.
    However, we suspect that the issue may be unrelated to the posting periods due to some other testing performed.
    Regards,
    Sean

  • Payment engine posting date automatically set at today

    Good evening folks,
                                 I've a problem with Payment Engine and the bank statement reconciliation.
    I'm using SAP 2005 SP01 PL46 on SQLServer 2005. This is the scenario:
    The bank statement that I use has all the dates set to 26 January 2009. Suppose that I do the import today, 29 January 2009.
    I import the file with the Process External Bank Statement; the field Date, that is the Due Date, shows 26.01.2009 for all my lines.
    Then I flag the Create Payment and press the Update button. Now I go in Incoming Payments to see the posting and I find that the Posting Date is 29.01.2009.
    Now the question is: There is a way to have the Posting Date equals to the Due Date, so that both date will be 26.01.2009?
    I'm asking this because our Account Manager tell me that the posting date has to be the same of the due date sent by bank.
    Best Regards
    Alessio

    Dear Sir:
    The functionality 'proces external bank statatement' was highly improved with the add on payment engine , why do not use the module 'Cash and bank'?
    The module cash and bank allows you to decide the posting date.
    I would recommend you to read the On line help of the Add on, the part related to 'processing bank statements -Examples -> 'Payment from Customer with reefernce number'
    Kind regards
    Jose Antonio Castillo
    SAP Business One Support

  • Call Dynamic Form Wizard via a POST data

    Is it possible to call a Dynamic Form Wizard form via POST from another form?
    I can get my form to work for an Update and Delete transaction, but I can't get it to work with an Insert - I can't prime fields.
    Conversely, I can get it to work with an Insert transaction, but then it stops working for Update and Delete transactions!!!!
    Calling a form with URL parameters is really frowned upon these days and ADDT needs to be updated to allow for the POST technique!

    Hi Steven,
    "order" is one of MySQL´s "reserved words", means you´ll have to rename this column to something else.
    Günter Schenk
    Adobe Community Expert, Dreamweaver

Maybe you are looking for

  • Problem scenario to XI to Idoc (R/3)

    Hello all, please help me for this problem i would like to send idoc to system R/3 and I have a message error. I'm sure to load in XI idoc PORDCR01.Thanks for your reply <b>- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://s

  • SAP CRM with multiple MS Exchange Servers

    Hi all, I would like to use a SAP CRM 7.0 system with multiple MS Exchange servers. It is possible to forward emails from these Exchange servers to the SAP WAS via SMTP, so that SAP ERMS functionalities can be used to process the emails? Thank you, T

  • How to get the location of the last click.

    What I can't seem to figure out how to do is get the location of the last click. I'm not setting anything by using the click im using the click to test boundaries. Basically if I click within this area this happens if i click within this other area s

  • Has anyone managed to change the battery in a creative Zen MX

    =i bought a 6gb zen MX? in November 2007 and have used it every day since. The battery is now in a sorry state and doesn't hold a charge for more than about 4 hours. After fully charging it, if you then leave it overnight the battery almost totally d

  • ABAP Report duplicating IDOC

    Hello has anybody of you an ABAP Report, that is able to duplicate IDOCs? Regards Mario