Finding out the userid from a JSP or servlet. (9.0.2)

Hi Again!
I have a JSP in the htdocs directory of my portal which fetches binary objects
from a content repository. I use this binary.jsp to display images embedded
in a content portlet shown within the portal. So as far as the browser gots
the portal page it starts to fetch the images with an ordinary get operation
to a given URL of the binary.jsp.
Now I want to be able to find out if the current user is allowed to see the
image from the content repository, so I have to find out the userid within
the JSP. But I couldn't find any way to do this. Since the binary.jsp is
not loaded in the context of the portal, it doesn't know anything about
the PortletRendererRequest, so thi code returns null:
PortletRenderRequest oraRequest = (PortletRenderRequest)
request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
if ( oraRequest == null ) {
makeLog ("Could not get PortletRequest!");
} else {
oracleUser = oraRequest.getUser().getName();
So I've tried to put the userID into the servlet session like this
request.getSession().setAttribute("iASUserName", oracleUser);
but obviously the binary.jsp doesn't share the same http session object,
so this code returns null within the binary.jsp
request.getSession().getAttribute("iASUserName");
We allready done this with the old version of PDK and JServ and
everything was OK, except that we used the deprecated API
request.getSession().setValue("iASUserName", oracleUser);
request.getSession().getValue("iASUserName");
No both ways doesn't work, since we are using Orion-Appserver
and PDK 9.0.2 :-(
Is there anyone out there with an idea how we can solve
this problem?

I could understand what you are lookig for. We can probably relie on cookies to share user information between portal & non-portal resources.
Example :
Lets say we have a contributor.jsp viewed through portal. This sets up a cookie in the client machine which carries portal user name. It persists till the end of user session.
contributor.jsp
<%
PortletRenderRequest pr =
(PortletRenderRequest)request.getAttribute(HttpProvider.PORTLET_RENDER_REQUEST);
String pUser = pr.getUser().getName();
/* Customize these strings to suitable names. */
String pUserKey = "CUR_PORTAL_USER";
String pDomain = ".oracle.com";
%>
<SCRIPT language="JavaScript1.2">
var today = new Date();
function setCookie(name, value, domain)
document.cookie = name + "=" + escape(value) +
"; path=/" +
"; domain=" + domain;
</SCRIPT>
<BODY onload="javascript:setCookie('<%=pUserKey%>', '<%=pUser%>', '<%=pDomain%>')"/>
This cookie now will be set in the client machine and any JSP in the same domain will be able to access it.
Let me know if it offers any help to your problem.
Thanks,
Amjad.

Similar Messages

  • How to find out the user from the Jobs queue in Report server

    Hello All!
    I have a doubt about finding out the user from the scheduled jobs queue. Say I go ahead and schedule a report on Reports Server how can I find out the user name. When I view the jobs using showjobs I could see that the DBMS_JOBS table has a column under "Job Owner". But it invariantly shows it is "rwuser". So is there a way to find out which user has scheduled which job?
    Regards
    Shobha

    hi,
    The below tables will give only the name .
    USER_ADDRS
    USER_ADDR
    USER_ADDRP
    USR02
    i think you need email address .
    you can use this Tcode : su01d
    and give the user name and excute it
    i hope it will help you.
    Ram
    Edited by: Ram velanati on Jun 30, 2008 6:57 PM

  • How to find out the path of current jsp

    Hi all.
    I was wondering if someone could help me figure this out: how can I programmatically find out what path a given jsp is in from within the jsp?
    if I use currentPath = new File("./"), it defaults to the /config folder (Iplanet WS).
    Any advice is appreciated.

    Try using a combination of javax.servlet.http.HttpServletRequest.getServletPath() and javax.servlet.ServletContext.getRealPath() in your JSP. Like...
    appplication.getRealPath(request.getServletPath());I haven't tested it though.

  • How can I find out the place from where a record is being inserted in table

    Hi,
      I want to find out the exact code statement from the SAP code from where record is being inserted into a SAP table. I tried ST05 SQL trace but it seems to only give the SQL statement and not the program from where it is being fired (unless you guys can show me a way to find it from the trace)
      I m trying to see that when sales order is changed in VA02, from which piece of code in SAP the tables CDHDR and CDPOS get update. Also I tried using SE30 but it doesnt seem to give the results properly. Please help.
    Thanks for reading

    Hello Srikrishna,
    Did you try the following?
    In your trace with ST05:
    i) Find the line that you are interested, right-click and select 'Display ABAP Source'.
    OR
    ii) Go to Trace List menu and click 'Summarize Trace by SQL Statement'. Then here, select the line you want and again right click to see 'Display ABAP Source'.
    Regards,
    Guven.

  • How to find out the metachian from subchain

    hello friends,
    could you please let me know , how to find out the meta chain from subchian .
    I know the subchain name and wanted to check that this chian is included in which meta chian ,
    actaully here so many chain , so its confusing .
    Is there any way ?

    Hi,
    Pls chk this links,
    Re: Meta chains - how to create n example scenerios
    Re: How to create process chains, infopackage groups & Meta chains
    Hope this helps,
    regards
    CSM reddy

  • How to find out the tables from extract structures

    Hi All,
    As I know my data sources are 2lis_04_p_matnr,2lis_04_p_comp,2lis_04_p_arbpl.
    How to find out the tables concerned with the fields in the extract structure.
    Thanks

    Pl check this link:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/29/79eb3cad744026e10000000a11405a/frameset.htm
    OR navigate to: help.sap.com - netweaver - bi content - supply chain - look for your application area and the extractor and you will see the source tables and fields.
    Ravi Thothadri

  • How to find out the userid  is ddic,  how to find out thepassword for this.

    hi
      i am mohan. We user-id is DDIC. we forgot the password for this user id. how to find out the password for this. we find the table for this usr02. but it is hexa decimal code. how to find that code

    hi
      check these threads
    Re: Check SAP username and password.
    Re: Validation of user name, pwd  in ZXUSRU01 exit
    if helpful, reward
    Sathish. R

  • How to find out the table from the field.

    Hi Friends,
    I want to know the table name from the field.
    I mean i know the field with which i want to know the table. I tried but could find the structure only but how can i find the table.
    Please guide me.
    siva.

    Hi Sivakumar,
    Using DD03L (in SE16, SQVI) you can list the tables & structures which contain the desired field.
    (If it's a very common field [e.g. MATNR] you'll get a huge amount of hits...you can also use 'F1' + 'Technical information' [in the transacton you are] to get information on table & field as mentioned before)
    http://www.erpgenie.com/abap/tables.htm
    BR
    Csaba

  • Finding out the percentage  from 2 different reports

    Hello Friends,
    I am using OBI 10g. I am trying to divide values from one report which has a total count with another report which has a count with a particular criteria. For example, one report has count of people living in various states and the other report has a count of people who are above 60 years living in those states. Now I want to calculate the percentage. Say 80 people are living in Florida and number of people over 60 years living in Florida is 40, so I have these 2 reports already on my page. I want a 3rd report which gives the % of these two reports ie (40/80)*100 = 50. I want to use this 3rd report on the same page. Please let me know how to accomplish this. Also, let me know if you need any other information.
    Thank You.

    Hello Srini,
    Thank You for the reply. Here the report for people over 60 years living in Florida is the result of combination of 6 reports (*using combine with another request*). I am not able to figure out how to pull people over 60 years living in Florida and
    people living in Florida in the below formula
    FILTER(Fact."# People" USING ( people over 60 years living in Florida))/FILTER(Fact."#People" USING ( people living in Florida))*100.0
    It will be helpful if you can advice me in this regard.
    Thank You

  • Need to find out the changes from Apps 10.7 to the present release 11. x.x

    Hullo,
    I saw a link on one of the blogs that a presentation on improvements/changes/features from 10.7 onwards was available on www.oracle.com/appsnet/technology/upgrade/docs/features.html. This page is no longer available.
    Does anyone know another link where this or similar information is available?
    Salim.

    Oracle Applications Upgrade - new functionality added since 10.7 and 11
    This post contains a link to the Oracle page which will provide you with a functionality comparison between the different releases of Oracle Applications.
    If you are still on Oracle Applications R10.7 or R11 and are considering an upgrade to R11i, this Oracle Appsnet page will provide you with an understanding of what new features and capabilities have been added to Oracle E-Business Suite since R10.7 and R11. The site lists the changes by major release and by module and is very useful in understanding the differences between each major release of Oracle Applications.
    Comments:
    Hi
    The link is broken it seems
    http://www.oracle.com/appsnet/technology/upgrade/docs/features.html
    Choudhary
    Posted by Sunil on 04/26 at 12:00 PM
    Yes, Oracle re-organised their site and have moved this page without providing a redirect. If anyone know’s where this page has disappeared to please let me know as it contained some very useful content.
    Posted by Richard Byrom on 04/26 at 01:01 PM
    Does anyone know where the information now is?

  • Find out the relation from vbrk and ekpo

    hi
    i want the relation field from vbrk and ekko or ekpo apart from kunnr and lifnr.
    ple give me the field

    Check ThisLink
    Relation between the tables ekko and vbrk
    Ranga

  • HT4314 I remember my Game Center nickname but not the email address I used to create it.  I have tried every email address I could have used and none are correct - is there no way to find out the info from Apple? Seriously?? Because that's crazy.

     

    Because it isn't my Apple ID. Each of our iThings has a different Game Center account and only one uses our real ID. Thanks, though.

  • How can I find out the mail server from email address?

    Hi:
    How can I find out the mail server from email address?
    for example: If I know the email address is [email protected],
    how to find the pop3 and smtp mail server?
    THANK YOU

    You can't tell by the email address since you can pretty much put whatever you want in there (especially if the SMTP server is not filtering anything).
    The header may be able to tell you something. There is a Received header value which looks like it has the routing information although I am not sure if this is a complete trace or just the last hop the message took.
    Sean

  • How to find out the URL of the user coming from?

    Hi folks,
    From the HttpServletRequest, is there a way to find out the URL of the user coming from?
    Thanks in advance!
    Billy

    It is strange. The link is on a different http site eg. http://www.othersite.com. The link is pointing https://www,mysite.com/index.html. I put the alert(document.referer) on the index.html. Using FireFox will show the alert http://www.othersite.com every time. However, on IE, the first time is empty. The second time I click on the link, it will show http://www.othersite.com. Very consistent.

  • How to find out the table, data for the IDOCS is pulled from?

    HI
    The ZFPH9999397 VENDOR FEED job runs the RBDMIDOC program with the variant Z9999_397.  This creates IDOCS that are sent out and eventually wind up in IMOS.
    The IDOC Type is CREMAS.
    Can you tell me which table or tables the data for these IDOCS is pulled from?
    Or tell me the procedure to find out the table name.
    Thanks,
    das.
    Edited by: sathish dasari on Dec 10, 2009 11:54 AM

    You can use Transp. Table      TBD62 .
    enter Message Type                      CREMAS
    you will get the list of tables and the fields from which data is pulled based on the change pointers in Transp. Table      BDCP.

Maybe you are looking for

  • Error downloading podcast - part 2

    I've subscribed to a podcast, both via iTunes and the podcast's website, and I keep getting the error message that "There was a problem downloading" the podcast and "The URL"....."could not be found on the server." - +*on my Mac*+. I subscribe to the

  • Idoc-XI-file test scenario

    i m new to XI, i wanna make a test scenario for idoc-XI-file... i donno what an idoc is....... tell me how to create an idoc from the very basics....like message type, segment, partner profile, port creation, etc,..... and how to fire an idoc from th

  • Migration from PowerBook G4 to MacBook Pro - 14-36 hours?

    Just got my MacBook Pro and didn't realize that none of my Firewire 400 cables wouldn't work with Firewire 800. Being it's a Friday and no one within 100 miles stocks a Firewire 800/Firewire 400 cable, I decided to use Airport to do migration (since

  • Need help installing 10.8 on my erased hard drive

    Hi,I bought 10.8 and created a bootable disk on a flash drive.   Then, instead of erasing my drive as part of the installation of 10.8, I booted from the flash drive, the used Disk Utilities to erase the drive.  (I know you don't have to erase your d

  • No sound with certain videos

    Using Firefox I have sound at Youtube but not at a local tv station website. If I try to view the video listed below, I can not hear the voice of the news person but I can hear the commercial before the video plays. It is EXTREMELY frustrating.... ht