Accessing Portal session in JSP

Hi
How can I access session parameters set via wwsto_api_session in jsp portlet.
Regards,
Vikas.

Hi,
If you want to access the procedures in wwsto_api_session package from a JSP, you can use JDBC calls.
Otherwise, if you need the Httpsession specific information you can use the ProviderSession class in JPDK. You can obtain an instance of this using PortletRenderRequest object.
thanks,
Sriram

Similar Messages

  • Problem with Sessions in JSP

    Hi,
    I am working on a JSP based website, where I am facing problem with sessions. The user is asked to login by providing her id and password. If found correct, a bean is created and populated with all her details and placed in session scope. I plan to use the information stored in the bean on other related pages until she logs out.
    <jsp:useBean id="validUser" scope="session" class="UserBean" >
    <c:set target="${validUser}" property="userId" value="${fn:trim(dbValues.UserId)}" />
    <c:set target="${validUser}" property="userName" value="${fn:trim(dbValues.UserName)}" />
    </jsp:useBean>
    <c:redirect url="userHome.jsp" /> The user is presented her homepage - 'userHome.jsp', where she can find various links, like 'Update Profile', 'Pay Registration Fees', 'Book Room' etc. The information stored in the bean is available on 'userHome.jsp'page.
    <A HREF='userHome.jsp'>Home</A>
    <A HREF='editPersonal.jsp'>Update Profile</A>
    <A HREF='registrationFee.jsp'>Pay Registration Fees</A>
    <A HREF='bookRoom.jsp'>Book Room</A>
    <A HREF='logout.jsp'>Logout</A> The problems are:
    1. Whenever user clicks on any of the above mentioned links and moves to any page, the bean comes out as null.
    <%-- Verify that the user is logged in --%>
    <c:if test="${validUser == null}">
    <jsp:forward page="loginForm.jsp">
    <jsp:param name="origURL" value="${pageContext.request.requestURL}" />
    <jsp:param name="errorMsg" value="You must be logged in to access this site." />
    </jsp:forward>
    </c:if> 2. The URL shows an additional jsessionid, which my client doesn't want to see.
    3. On every click on any link, the value of this jsessionid changes.
    What I presume, when I am clicking on different links, my session changes, and so I am seeing a different jsessionid. And since session is changing, therefore the bean is not available in a different session.
    All this works fine with localhost, problem comes into picture, when I upload my pages to the server.
    Puzzled, can anyone help, where am I going wrong? Let me add here, I am new to JSP and hence don't have much resources with me.

    There are several ways sessions can be exchanged between the browser and the server in a j2ee web application.
    1. The default is through cookies. However when the client does not accept cookies, the server appends the session id to the url.
    2. Some servers also facilitate session information exchange using session id in the url even if the client does accept cookies. This is usually ahieved through a setting in some server configuration file.
    You will have to find out why the server in your application is appending the session id to the url.
    Whatever be the case, the server should be able to look up the session from the incoming request (be it from the session id in the url or a session cookie).
    When session information is exchanged through the JSESSIONID in the url, you should ensure that each and every url that goes to the server has this input parameter. To do that all links and form post urls in your servlet/jsp should be treated with a call to encodeURL().
    For example, in a jsp
       <a href = "<%=response.encodeURL("/nextJsp.jsp")%>">Click here </a>
    or
       <form action = "<%=response.encodeURL("/nextJsp.jsp")%>">
       </form>etc.
    ram.

  • Portal Session content in BSP

    Hello,
    My BSP inside an iView is located in the xRPM content. What I now try to achieve is, to hand over the chosen project-id from the portal to the BSP - iView.
    request->get_cookies provides me with the cookie "sap-appcontext", which I think contains the portal session-id. Since BSP has it's own session-id, I somehow have to get the session - content of the portal, where I hope, the chosen project-id is stored.
    Am I on the right way?
    I would appreciate any help or suggestions.
    Thanks in advance.
    Daniel

    <i>How can I register such an event inside xRPM-content without modifying the standard-source? Or how can I find out, if there's an event fired I could use?</i>
    I see no real easy way. I have never seen the source code of xRPM, and know no developers inhouse to ask directly. Effectively portal eventing is just JavaScript code. To see if xRPM supports any events, why not look at the outputted HTML. Look for anything to do with EPCM, or search for events.
    <i>It's hard to understand, why it's not possible to access session-information of the portal from a BSP started in the same page...</i>
    What exactly session information do you wish to know. From my understanding, you have a BSP running inside the portal. Inside this BSP application you wish to know something. I assume not exactly session ids, but some other information from the portal. Maybe this helps us.
    At the low level of HTML is might be easier to understand. The portal renders the HTML page, and then starts the BSP inside an <iframe>. The BSP does not know anything about the surrounding environment. Of course you could use JavaScript to walk up the dom (document.parent) and look at things inside the other frames. But keep in mind you are in the browser, and not on the portal server, not in the ABAP stack (where BSP is). So you can only look at rendered code. And this can (and will) change per SP.
    At the end of the day it is all plain HTML in your browser, and this are what sets your limitations.
    brian

  • How to access java method in JSP

    Hi all,
    I need to access java class (abstract portal component) method doContent() in a JSP which is under PORTAL-INF/jsp folder.
    I did
    <%@ page import = "com.mycompany.Aclass" %>
    <%com.mycompany.Aclass a = new com.mycompany.Aclass (); %>
    Aclass is coming as autofill/prepopulated with cntrl+space
    Till this time, it is working. no errors. But when I do
    a.
    a. (a dot) no methods are populating (autofill..cntrl+space) or If I forcebly add method a.doContent(req,res)... at runtime its giving error.
    It's not only with doContent method... Its with any simple methods in that class or any other class.
    (Other than doContent method in the APC java class are prepopulating/autofilling but giving error in runtime)
    Can anyone help me... how to access java method in JSP.
    I already gone through many SDN forum post... and implemented too---but no use I refered below forum thread
    Retrieve values from Java class to JSP
    URGENT! How to call a java class from JSP.
    Calling a java method from jsp file -
    this thread is same as my issue
    Thanks,
    PradeeP

    1st. The classes must be in packages. 2nd, the package that they are in must be under the WEB-INF/classes directory. 3rd Look on google and/or this site for web application deployment

  • Facing Issues in accessing Portal through IP

    Hello Experts,
    When i access Portal site through Hostname of the server it works fine,but when through IP ,nothing show up in Content Area and Navigation Panel.also certain other misbehaviour of the application is shown. In SAP documents also wt i hv read is to accessPortal site through Hostname but nowhere read abt accessing it through IP.Can somebody plz clarify can't we access Portal through IP,is it standard recommendation for Portal to access it through Hostname? If we can access then y iam facing all these problems and how to resolve them?Someone plz suggest? My Email Id is [email protected] .
    Regards,
    Saumya

    Hi Somya,
    you should always request your portal by full qualified domain name (fqdn) which means:
    http(s)://<servername>.<domain>(:port)/...
    An example:
    do not: http://myserver:50000/irj or http://127.0.0.1/irj, etc.
    do: http://myserver.mydomain.com:50000/irj or
    http://myserver.mydomain.com/irj
    If you do not like suggested, you'll get problems:
    - top levbel navigation may break after session time out using sso with os
    - navigation (javascript issue) may not work properly
    - SSO with other application (e.g. using BP's) does not work
    Greetings,
    Carsten

  • Portal Session Timeout Setting

    There is a JServ session and a portal session. I know how to control session timeout and session clean up frequency in JServ - that's in zone.properties. But, I dont know how to set timeout for portal session, i.e., I'd like to have the user be forced to login again when he has been idle for 15 mins - and only if he has been idle. Jserv session settings are not sufficient for this because Portal has it's own session that must time out.
    How to set this timeout value (I'm using my own provider which has a timeout setting in zone.properties and includes a bunch of JSP portlets)? Also, is there a clean up thread for which the frequency has to be set?

    I've contacted metalink weeks ago, and this is NOW, a know bug...
    Incredible... Oracle just DO NOT TEST their products... Even a simple SESSION timeout do not work. Also, if I click back after "I log In and Log out" ... Session still up without have to login again!
    BUG 2442268

  • Accessing another par file jsp pages

    Hi
    i need to access another par file JSP pages from my par file, what all i need.
    any help is appreciated.
    Thanks,
    Damodhar.

    Gandhi,
    Well..there is a very good article on how to use resources(watever resources u mentioned) of one par inside any other par file on SDN:
    Here is the document:<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b3c1af90-0201-0010-c0ac-c8d802d264f0">JSPs, Resources...</a>
    Xml files i worked were not property files of an iview.
    They were application specific xml files.I read these xml files on a different par(or iview).For that matter, they don need not be of type xml,could be any type of resource.
    Regards,
    P.

  • Plugnav: Access to session state

    We have customised the horizontal dropdown scheme, and want to add an "Applications" dropdown, where each entry is a link to a citrix NFuse published application. (We want the user to access everything from the portal, even word, excel....).
    I have the customised NFuse code to return my links, but retrieving these is slow, so I only want to do it the first time a user enters the portal session.
    Does anyone know how can I store the link details in viewstate or session state (or any other way) so I can get my scheme to create the dropdown on subsequent refreshes without requerying the Citrix database.

    Session data is accesible by the session, that why is "session scoped" (obviusly).
    If you need to access such data from other session you can putting the bean in the application context.
    Could you explain a little to undestand why you need that?
    Regards,

  • Invalid Portal Session

    While browsing through the forums, I got the message below :
    Invalid Portal Session*
    An error was encountered while processing your Portal request, because your portal session is no longer valid. You have been logged out and you will automatically be redirected to the OracleAS Portal home page in 30 seconds. Click OracleAS Portal home page to go directly to the OracleAS Portal home page, or if your browser does not automatically redirect you. If you continue to have problems while accessing OracleAS Portal, close all your browser instances and try again.
    Nicolas.

    user11945767 wrote:
    Hello,
    In our case, I have tried Opera, Safari, Chrome and Mozilla browsers and none of them show 'Invalid Portal Session' error. It only occurs with Microsoft Internet Explorer. And this happens consistently with IE. Not a single time it succeeds unless F5/Refresh is hit.
    What could be the reason for this and how can it be resolved. We are running Oracle 10.1.2 AS.
    Thanks.Nicolas asked the question about the Oracle Forums. Since this is a Forums Community issue, he correctly asked it in the "Community Feedback and Suggestions (Do Not Post Product-Related Questions Here)" Forums area.
    You seem to be asking the question about the Oracle Application Server Portal product. Even though it appears your question and Nicolas' may be related, you are probably asking the question in the wrong area.
    Your question is likely better asked
    1) of Support (by opening a service request) and/or
    2) asking in http://forums.oracle.com/forums/category.jspa?categoryID=193 and/or
    3) asking in http://forums.oracle.com/forums/category.jspa?categoryID=196

  • Session from JSP

    Is there any way I can access a session variable of a JSP page from APEX page?
    THanks

    I open a JDBC connection in each JSP page
    which inturn creates Oracle SessionAn oracle session is only really created if you make set autocommit to false for your connection.
    How are you obtaining the connections?
    Using the Drivermanager to get a connection on every page?
    Or a JNDI lookup of a Datasource?
    Do you call connection.setAutoCommit() for a connection? (Defaults to true)
    How do you close your statements? Should be in a finally statement.
    Once java closes the connection, it should no longer be there in oracle. Unless of course you are using connection pooling in some way shape or form.
    Cheers,
    evnafets

  • How to set up reverse proxy to allow user access portal site from internet

    Hi all,
    I have installed 10g(10.1.2.0.2) AS on same machine(single IP for both mid and infra with different users respectively). there is a DMZ on which windows IIS is working through which we need to redirect the request to application server such that users access portal page from internet (within intranet all URLs are working fine). I have went through technet documentation where i found 3 ways : through this link
    http://download.oracle.com/docs/cd/B14099_19/core.1012/b13998/variants.htm
    Section 9.2.1.1, "Configuring OracleAS Web Cache as a Reverse Proxy"
    Section 9.2.1.2, "Configuring the Oracle HTTP Server as a Reverse Proxy"
    Section 9.2.1.3, "Configuring Internet Information Services as a Reverse Proxy"
    I am confused to which option to use. Also i went through the metalink document 270160.1
    Please help me which option to choose to do this.
    Thanks.

    Hi Hozy,
    May be it's too late, I am thinking to go in the same route for our sap portal access to external customers. Please can you share your experience , like what are the challenges have you faced? what is the complexity? what are all the resources we need to configure this?
    I appreciate your feedback.
    Thanks
    Krish

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • Error while accessing portal.....

    Hi Experts,
       We have installed EP 7.0 SP 9.  It's working fine, but yesterday we met the problem, we can't able to access portal.
      After giving username and password, its opening the portal homepage with the following JavaScript Error on the taskbar.
    <b>1. 'disable personalize' is undefined
    2. 'EPCM.getSAPTop().gHistoryFrameworkObj' is null or not an object
    3. 'ActiveTrackingEntryIndex' is null or not an object</b>
      After showing errors above, its showing the portal HomePage.  If we click on any roles is loading with busy symbol, we can't able to navigate to any role or any workset after that.
      Please tell me some solution for this, it's very urgent.
      Points will be awarded.
    Regards,
    Chinnadurai.R.

    I also recieved this error.  It took me a while to discover the problem.  It is caused by the order in which .Net is installed.  If when you go to Applicaiton Pools you do NOT see: 
    - ASP.NET v4.0
    - ASP.NET v4.0 Classic
    If you only see
    - Classic .NET AppPool
    - DefaultAppPool
    - MBAMSitesAndSvcsAppPool
    Then you need to re run the setup of .NET using the commands below:
    Type cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ and press <kbd>ENTER</kbd>.
    Type aspnet_regiis.exe -ir and press <kbd>ENTER</kbd> again.

  • Error while accessing portal via internet

    Hi all,
    I am having problems when accessing portal through internet. I have installed NW04 SR1(WAS, EP & KM). Then I created some iviews and pages.
    Now <u>when I open the portal through internet(using its ip address)</u> and try to access PCD, it is showing <b>undefined</b> in place of the loading message and it is not loading anything. Also <b>the detailed navigation is empty</b> in all pages(eg. System Administration, Monitoring, etc.). But <u>when i access it locally(using machine name) everything works fine</u>. Any idea what the problem is?
    Another problem is with the KM Navigation IView. I have created a custom layout set for this iview. In the iview I am displaying the documents in a folder along with a link for approval process. But <b>when i click on the link, it shows javascript error "Access is denied"</b>. <u>This happens when I access it through internet. When I access it locally, it works fine and show me the context menu for approval</u>. Any idea?
    Please reply fast as it is urgent.
    Thanks in advance.
    Ranjith

    hi
    just check this out
    http://help.sap.com/saphelp_ep60sp2/helpdata/en/37/c1513c388d8f0ce10000000a11405a/content.htm
    http://help.sap.com/saphelp_ep60sp2/helpdata/en/e9/83d5f20ea845b587be83de8554191e/plain.htm

  • How to access Portal Logged in user in Web Service application

    Hi Experts,
    I have created one Deployable Proxy and based on that i have created Web Based (WAR) project. to consume the proxy i have created Servlet based java file which invokes Web services. Based on this WAR project i created EAR application which deploys on J2EE server.
    I am facing issue while accessing Portal Logged in user in my Servlet Class in WAR project so can  you please provide inputs for how we can access Portal Logged in user in our Servlet class? also how we can access LDAP detailes of portal Logged inuser ?
    I tried to fetch the Logged in user from servlet request but i can't access it giving me null value. Following is the method details that i am using in my servlet.
    protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException                
    IUser user = UMFactory.getAuthenticator().getLoggedInUser();
    String strName = user.getFirstName();
             If I checked in LDAP values First name for logged in user is present but in my code its giving Null value.
    Can you please provide your inputs on above issue.
    Regards,
    Rahul

    have you found a solution this problem yet?

Maybe you are looking for