How to get HTTP session in Applcation Module IMPL file

Hi Guys,
Can any one tell me how to get HTTP session in Applcation Module IMPL file ?
thnks

You can, but that's not a best practice.
Re: How to reach HttpContext from model Project

Similar Messages

  • How to get the Grand Total in Module pool Screen

    Hi Frds.
         How to get the Grand Total in Module pool Screen
    Example i have 10 different materials
    for each matarial has different moving . But in my case matarials is doesnt matter here
    10 material Moving Average price to do Frand total and display in one column...
    Please Help me out Frds.
    Regards,
    Kabil

    Hi
    You need to calculate the total in a module of PAI (or PBO) event:
    PROCESS PAI.
       LOOP.....
       ENDLOOP.
      MODULE CALCULATE_TOTAL.
      MODULE CALCULATE_TOTAL.
        GRAND_TOTAL = 0.
         LOOP AT ITAB,
            GRAND_TOTAL = GRAND_TOTAL + ITAB-PWB.
        ENDLOOP.
    ENDMODULE.
    In this way the grand total will be calculated as soon as the user presses enter or another command.
    You can't insert the calculation in the loop of table control, because this loop runs the visible lines only, so it's better to calculate the total out of those loop,

  • How to get transacted session in direct mode with jmsra adapter

    Hi,
    I use MQ 4.4u1 release with GF in EMBEDDED mode. I configured several connection factories with NoTransaction/LocalTransaction/XATransaction support. In my app I get a connection factory from JNDI tree, create connection/session/producer and send several messages to queue. Everything works fine when I don't use transactions. But, when I want to send messages in one transaction, the connection always provided to me non-transacted session. The session created via
    Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
    request. I check the session transacted state and acknowledge mode right after i get it:
    log.fine("Session: " + session + "; transacted: " + session.getTransacted() + "; ackMode: " + session.getAcknowledgeMode());
    The log shows me that the session is not transacted and ackMode is 0 (DUPS_OK_ACKNOWLEDGE). If I try to commit the session after messages were sent I get the correct exception:
    javax.jms.IllegalStateException: MQJMSRA_DS4001: commit():Illegal for a non-transacted Session:sessionId=3361979872663370240
    Does anyone know how to get transactional session in direct mode?
    Thanks, Denis.

    I mentioned LOCAL because I misread your post and thought you were suggesting that LOCAL mode behaved differently.
    If you want to send messages in a transaction from within a Servlet then I think you're expected to use a UserTransaction: Here's an example that worked for me:
            Connection connection = outboundConnectionFactory.createConnection();
            Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
            userTransaction.begin();
            MessageProducer producer = session.createProducer(outboundQueue);
            int numberOfMessages = 10;
            for (int i = 0; i<numberOfMessages; i++) {
                Message message = session.createTextMessage("Hello world");
                producer.send(message);
            userTransaction.commit();
            connection.close();I obtained the UserTransaction with this resource declaration:
        @Resource(name = "java:comp/UserTransaction")
        private UserTransaction userTransaction;The EJB spec explicitly states that local transactions aren't supported in EJBs; I haven't found such an explicit statement for Servlets but suspect that JMSRA is taking the same approach.
    As for imq.jmsra.direct.disableCM property - this appears to disable connection pooling and from your post changes other behaviour as well. How did you find out about it (other than by examining the code)? As far as I can see this is not a documented feature and is not necessarily tested or supported.

  • How to get the session name of a batch input

    hi everybody
    does anybody know how to get the session name of a batch input?
    I have to put the name of the session at the end of my program so that the user can click on the session name to go directly to SM35 to run the batch input when the program ends

    Hi sia,
    1. Table is APQI
    2. field name for session name is GROUPID
    regards,
    amit m.

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • How to get the attribute value of an XML file??

    How to get the attribute value of an XML file??
    For example, how to get name and age attributes?
    <student name="Joe" age="20" />

    What are you using to read the XML file??
    On the assumption of JDOM - www.jdom.org. Something along the lines of:SAXBuilder builder = new SAXBuilder(true);
    Document doc = builder.build(filename);
    Element root = doc.getRootElement();
    List children = root.getChildren();
    Element thisElement = (Element)children.get(n);
    String name = thisElement.getAttributeValue("name")
    try
         int age = Integer.parseInt(thisElement.getAttributeValue("age"));
    catch (Exception ex)
         throw new InvalidElementException("Expected an int.....");
    }Ben

  • How to get list of drives present in local file system?

    Hi all,
    I want to show all drives and their contents using JTree.
    Does anybody know how to get list of drives present in local file system?

    Thank you!
    I have new question.
    I want to disply size and file type. Can you give ur suggestion in order to do that?
    I want to provide following using JTree
    + root <Dir> 50KB
    - file1 <txt> 10KB
    - file2 <bmp> 20KB
    + root2 <Dir> 200KB
    -file1 <jpeg> 50KB
    Is this possible?
    Plz reply..........
    bye

  • How to know Http Session Id from Application Module ?

    Hi All,
    Our app has requirement to maintain state across many root AM, by storing it in DB on UserId+HttpSessionId.
    (or is there any other way to do this ? )
    So in prepareSession in each root AM I need to query to DB by UserId+HttpSessionId then store the result in transient VO.
    The question is : how to get to know the HttpSessionId from within AM ?
    Thank you very much for any help,
    Krist

    Hi Steve,
    Yes we use JAAS, and we have used getUserPrincipalName() .
    But, we not only need username, that is not enough, because one user can log-in from different machine concurently, that is the requirement.
    That is why we need the HttpSessionId.
    During log-in user "right after" autenticated user will choose some values from drop-list below the login Form, it is those values that we have to maintain in session scope until he/she logout. And the "same user" may log-in from another machine and choose another values.
    That is why we need to either :
    - store those values within HttpSession and access it from AM
    or
    - store those values in DB with key = user+HttpSessionId, and query it from AM.prepareSession() -> this is why I need to pass HttpSessionId to am.prepareSession()
    Thank you for your help,
    xtanto

  • How to get apex session id to insert into a table....mimic of a global temp

    Hi,
    I want to mimic the beavior of a global temporary table by using a regular table and feed a column that will contain session id...but i don't get how to obtain the session id in APEX ?
    Any suggestion ?
    Regards.

    You can use the APP_SESSION variable.
    See:
    http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/concept.htm#BEIEHEJI

  • How to get a session identifier in Model project

    How can I get any web session context identifier in a ViewImpl class?

    Tee hee hee deadlock.
    Gho - there is no direct way to do so; perhaps you can explain the use case you are trying to achieve (for example, if you need the user name, there might be a quick and easy answer for you). The general answer is that you would pass in the information needed from the view layer (which does have access to the http session). If it's a bind variable you're trying to set, you can use an ExecuteWithParams binding in the view layer.
    For more information, please provide your use case, and we'll try to help.
    john

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • How to get second session in second browser

    I have got an B2B application that has 3 types of users - [System]Admin , Vendor & Clients.
    In one of the use cases an 'Admin' user can launch a new window [browser] on behalf of client or a vendor and do whatever he wants . All the while, his ie. admin user's ID is maintained in the first browser.
    The issue I am facing is when I open a new/second browser [on clicking of a link] on behalf of vendor /client, my admin user ID is getting replaced with Vendors/Client in the first browser as well. Mean to say, I am able to open a new browser, work on behalf of a client /vendor but when going bak to the first browser[admin's] user ID and other admin user related information is not available and are found to be replaced by the vendor/client information
    FYI: User ID is fetched/maintained from Session.
    Can anybody tell me how to create a seperate session for the second browser so that I can parallely work on behalf of my ownself[as a Admin user] and also on behalf of a Vendor/Client user on two different browsers.
    Message was edited by:
    Venkyt

    Should i use target "new" instead "invoice"?Doesn't matter. Managing the sessions as I said it is the safest way IMO. From the first request, get the session ID, add it to a hidden input field and then go by that, instead of asking for a session ID that maybe has changed.
    Or use a cookie, or simply continue working in the same window.

  • How to do http session stickiness based on URL patterns?

    Is there a feature within the WL plugin for Apache that would allow me to emulate the "jvmroute" session stickiness behaviour as provided by Tomcat and its plugin. I would like to have the control to tie requests from http clients to particular WLS servers in a cluster depending on the URL. For example http://foo.com/web01 requests would be forwarded to an appsererver app01 and so on. For all other requests (e.g http://foo.com/web), the WL plugin would do its normal load balancing ignoring the stickiness. From my understanding the WLS inbuilt http session stickiness is based on JSessionIDs which are exchanged using cookies - which is something i cannot use in my case since i want the stickiness based on URL patterns.
    I am using WLS 10.0 with Apache 2.2.4 on Linux.
    Thanks
    Ramdas

    Session is not replicated across all the servers in the Cluster.
    Apache knows which server to go using the JSession ID.
    There is a concept of primary and secondary, secondary is selected based on the replication groups there are configured in the cluster.
    you can configure the cluster so that /web01 requests go to different cluster, and /web requests go to different cluster.
    but you can get all the funtiionalities from the single cluster.
    Do you have any java caching that you are not able to replicate across the cluster ?(I know this can be done too).
    let me know what you are actually trying to solve by doing the behavior you explained.

  • How to get an session BackingBean out of the FacesContext

    Hi,
    I want to make my appliction userdependent (each user only see's his own data).
    There fore I created a UserBackingBean with a session scope.
    An attribute of my other backingbeans is the User object. In my UserBackingBean I want to create a static method that returns the current user. Only I don't know how to get the UserBackingBean from a FacesContext.
    Please help?
    Romano

    ... and if you decide there MAY be several users logged in simultaneously, you can get the user associated with the current session by doing :
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    Map sessionMap = externalContext.getSessionMap();
    UserBackingBean userBackingBean = (UserBackingBean)sessionMap.get("userBackingBean");assuming you labeled your UserBackingBean managed bean "userBackingBean" in your faces-config.xml

  • How to get HTTP headers from Data Provider Class?

    Hi,
    I'm the beginner in SAP NetWeaver Gateway. Using Service Builder I created CRUD OData web service and implemented CRUD operations in Data Provider Class. Data Provider Class has methods like MYENTITY_GET_ENTITYSET, MYENTITY_GET_ENTITY, MYENTITY_CREATE_ENTITY, MYENTITY_UPDATE_ENTITY. How can I get HTTP headers from the methods of this Data Provider Class?

    You can do so by using the following code in DPC
    Data :  Lo_facade type ref to /IWBEP/IF_MGW_DP_INT_FACADE.
    lo_facade     ?= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
    lt_client_headers = lo_facade->get_request_header( ).
    Regards,
    Atanu

Maybe you are looking for

  • Xp_logininfo Installation problem

    Hello gurus, I'm facing the same problem as described in this link: Re: xp_logininfo "Installation problem on windows 2003 with Sql 2005" the error I get is similiar: <i>The below message comes from executing the command master..xp_logininfo '<domain

  • I am unable to create a new Citadel database

    I am using DSC module 8.5 and am trying to create a new database using MAX.  I am following the instructions, but when I select "Finish" to create the database, the progress meter pops up and stays at 0%.  I should add that there was not a default da

  • MacPro6,1 - Failing to wake from 'sleep'

    I have a MacPro6,1 which keeps failing to wake from 'sleep' is there a solution to stop this or is it a fault? considering I've only had it a few months i'm not impressed!

  • DG4ODBC - MySQL in 11.2.0 or 11g XE

    Hi - I've been struggling on and off for weeks with this - so fed up with ODBC connectivity!!! 4 years ago I was finally able to get heterogeneous connectivity on 10g/Windows to SQL Server using HSOLEDB but that's apparently not an option anymore as

  • PU12 - File Layout

    Hello Experts we are trying to use PU12 to send our wagetype amounts to our payroll provider, however we need to send them in a particular order Basically depending on the wage type the value will go into a particular position say final layout should