Getting the NT username of the viewer of the JSP page..

Hi.
          I was wondering if it is possible to get hold of the client's NT username
          from within a JSP or servlet. All I want is the current logged in username
          of the viewer of the page. Is there any way to do this in Java at all?
          It is possible in ASP + IIS and I guess I could forward the username for an
          ASP-page, but I don't think that is a very clean way of doing it.
          If I use '<%=java.lang.System.getProperty("user.name")%>' in a JSP-page I
          will only get the user of the server where the JSP is running:
          Any suggestions?
          - Oystein Saebo -
          

I was wondering if it is possible to get hold of the client's NT          username
          > from within a JSP or servlet. All I want is the current logged in
          username
          > of the viewer of the page. Is there any way to do this in Java at all?
          If you use IIS as http proxy to WLS you can call the getRemoteUser()
          method. On WLS6.0SP1 you get the NT domain\user back.
          Regards,
          Merg
          

Similar Messages

  • How to get the jsp page name in jsp?

    how to get the jsp page name in jsp? how the jsp get the jsp page name dynamic.
    thanks in advance.

    Try request.getServletPath()

  • Getting troubles in getting the JSP page

    hi friends,
    Let me tell u first i m using Tomcat 5.5 and Internet Explorer .
    I think i have some problem in Tomcat. Coz I have made an JSP page which has a simple coding as follows
    <%@ page language="java" contentType="text/html" %>
    <html>
    <body bgcolor="green">
    <font size=5 color="red">
    <%! int i=5%> <%= "The i value is  "+i %>
    <h1>Let's cheak if its working or not. </h1>
    </font>
    </body>
    </html>Let me tell u i don't want to do anything ,except getting valid response from a JSP page.
    i believe nothing is wrong with this page but when ever i m giving request for JSP page i m getting a blank page(a page of white colour though i have set bgcolor to be 'green'). But if i m giving request for Servlet and HTML pages then it's running fine . Can anyone advice me what to do.
    Let me tell u one more thing i.e when i m giving request 4 a JSP page the corresponding Servlet (the java file as well as .class file) is being formed by Tomcat. But still i m not getting my output.
    I hope i m clear in communicating my problem.
    Please suggest some solution what to do.
    with regards
    Arunabh

    save the above as test.jsp ..place it in webapps....
    important thing is check the path name u give in ur
    url
    http://10.32.246.55:8080/Activit/tex.jsp... in
    my system i have a folder called Activit in webapps
    so no need to mention webapps in url.... mention the
    ip address ..if u r runnin the application on the
    system where tomcat is installed then instead of ip
    address u can mention as localhost .. do
    mention port no. also ... think by default port no is
    8080...
    it should work cauz it worked in my systemIf it worked in ur system then i suppose somthing is wrong with my tomcat. Is it so ?????
    Arunabh

  • How can I view a PDF file on my IPad? I only get the first page.

    How can I view a PDF file from my Ipad, both in email and Internet links? I only get the first page.

    Support for viewing PDFs in emails and web-pages is built in to the iPad. You need not have bought an app for that.
    There are PDF apps that provide more features than the built-in functionality, but for basic viewing of multi-page PDFs no app is required.

  • TS1398 I can't get the authentication page to load to input a username for wifi network

    I can't get the authorization page to upload so I can enter wifi network username &amp; password

    Whenever I log into icloud.com
    Using what version of which browser?
    iCloud.com requires Safari 6 or later, Firefox 22 or later, or Google Chrome 28 or later. Have you tried all of those?
    If you have, have you tried clearing your browser cache and cookies?
    For the first tine since 1989 I'm thinking about buying a PC.
    You'd have exactly the same problems on an 8 year old PC too. It's a bit unreasonable to expect such an old Mac to continue to be compatible as software is constantly updated.
    Saying that, I'm still able to access iCloud.com successfully in Safari v5.0.6 on a PowerPC Mac running Mac OS X 10.5.8, so the problem you're having is likely to be a browser issue, not something inherently wrong with the computer.
    Since all this crap started, Mail won't download my Mac.com or me.com email.
    The iCloud.com website is totally unconnected to Mail's ability to download email via IMAP. Have you checked the mail server settings are correctly setup and up-to-date?

  • Using Acrobat Reader activeX to get the current page views in a document

    Hello,
    I'm using the Acrobat Reader ActiveX control.
    How can I use this API (or any other way) to get the current page of the PDF document inside the Acrobat reader ActiveX control ?
    Thanks
    Ariel

    Aandi,
    I reckon that you might be right.
    But as side note, maybe Adobe will lose me and others as contributers for her PDF oriented solutions for other formats.
    In the long run experts can tell which approach is better: a .Net like approach (no limitations upon development issues for ) or this kind of an approach.
    Thank you very very much for you help!
    Ariel

  • Help needed urgently to get the values from the jsp page.

    hi,
    I am badly stuck into this problem.Please help me and find a solution.
    I am using ms-access and jsp.
    my database structure is as given below:
    m_emp_no | from_date | to_date | approver| status |
    1002 | 22/9/2008 | 23/9/2008|1003 |pending
    1004 | 29/9/2008 | 30/9/2008|1003 |pending
    2044 | 15/9/2008 | 16/9/2008|3076 |pending
    now this is exactly a leave apply scenario where a page is displayed and the user has to fill in the details to apply leave.then the approver has to approve that leaves so even, he should get the details in his account.
    for example here 1003 has to approve leaves for 1002 & 1004.i am able to fetch data from database for the particular approver here is the coding:
    <html>
    <body>
    <h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
    Approval Requests</font></span></b></u></h2>
    <form method="POST" name="f1" action="update.jsp">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
    PreparedStatement p=null;
    p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
    ResultSet r=p.executeQuery();
    while(r.next())
    %>  <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
        <tr>
          <td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
        </tr>
      </table>
      <table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
        <tr>
          <td width="100%" height="165" valign="top">
            <p align="left"><b>User ID</b>        :
    <input type="text" name="id" value="<%=r.getString(1)%>"  size="4   
         <b>status</b>:<%=r.getString(5)%</p>
    <p><b>Leave From</b> : <%=r.getString(2)%></p>
    <p><b>Leave From</b> : <%=r.getString(3)%></p>
    <p><b>Approve</b> : <select  size="1" name="approved">
            <option value="Approved">Approved</option>
            <option value="Cancelled">Cancelled</option>        </select></p>
    <%
    con.close();
    %>
      <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
              <tr>
                <td width="100%" bgcolor="#999966">
                  <p align="center"><input type="reset" value="Clear" name="B1"> 
                  <input type="submit" value="Submit" name="B2"></td>
              </tr>
            </table>
            </td>
        </tr>
      </table>
    </form>
    </body>
    </html>{code}
    this will display both the rows but when i try to retrieve the values into update.jsp using the code given below it gives me only one value which is the first 1002.
    {code}approved=(String)request.getParameter("approved");
    id=(String)request.getParameter("id");{code}
    but i need both the values to be inserted into the update.jsp only then the approver will be able to approve the leaves individually with respect to the m_emp_no.
    please help me out.
    thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My comments below are all between (((((( and ))))))
    <html>
    <body>
    <h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
    Approval Requests</font></span></b></u></h2>
    <form method="POST" name="f1" action="update.jsp">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
    PreparedStatement p=null;
    p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
    ResultSet r=p.executeQuery();
    while(r.next())
    %> <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
    </tr>
    </table>
    <table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" height="165" valign="top">
    <p align="left"><b>User ID</b> :
    <input type="text" name="id" value="<%=r.getString(1)%>" size="4   
    ((((((( in the statement above, name="id" should be changed to something like name="id"<%=ii%>
    Where ii is a counter that tells you how many times you have gone through the loop so far.
    The reason for this is that each textfield you generate must have a unique name rather than all have the same name
    such as 'id'. This change will give them names such as id0, id1, id2. Then when you submit the page, you can uniquely
    identify each input textfield.))))))
    <b>status</b>:<%=r.getString(5)%</p>
    <p><b>Leave From</b> : <%=r.getString(2)%></p>
    <p><b>Leave From</b> : <%=r.getString(3)%></p>
    <p><b>Approve</b> : <select size="1" name="approved">
    (((( the above select also has to have a unique name for each time through the loop. Change it to name="approved"<%=ii%>
    <option value="Approved">Approved</option>
    <option value="Cancelled">Cancelled</option> </select></p>
    <%
    con.close();
    %>
    <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" bgcolor="#999966">
    <p align="center"><input type="reset" value="Clear" name="B1">
    <input type="submit" value="Submit" name="B2"></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    (((((((note you would be better off long term to put your business logic in a servlet and dispatch to the JSP page which will only have the responsiblity to display the data.
    Also, connection pooling is better than the above.

  • How to get the Empty page in Webi report

    Hi,
    I have to insert the charts in the report but i don't have the space to insert the charts in same page so i need one more page how to get the blank page in report
    thanks,

    turn your report from Page Layout to Draft Mode. Than you will be able to insert chart in it.
    You can view Web Intelligence reports in different modes depending on how you want to work with data and how you want the data to appear.
    1. In Web Intelligence Interactive, select the report tab of the report you want to view.
    2. Click the arrow next to the View button on the main toolbar above the report.
    3. Select the viewing mode.
    4. In the Java Report Panel or Web Intelligence Rich Client, use Switch Page/Quick Display on the Reporting toolbar to alternate between Page mode and Quick Display mode.
    Edited by: srrachna on Apr 22, 2011 2:25 PM

  • HT204416 safari though I blocked the pop tabs I keep getting the home page is always unconfigures and does not let me banks I do?

    safari though I blocked the pop tabs I keep getting the home page is always unconfigures and does not let me banks I do?

    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.Safari.plist. Move the .plist to your desktop.
    Restart the computer, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.

  • Not able to get the login page after installing 12.1.1

    HI,
    i am not able to get the login page after installing in the 12.1.1. when i accessed from client machineo.Please help me in fixing out this problem.
    Thanks,
    venkat.

    Hi,
    What is the OS?
    What is the error message?
    Any errors in Apache/Database log files?
    Thanks,
    Hussein

  • Cannot log in to Nationwide internet banking in Firefox. I get the front page but Login says internet banking is not working. Next screen says it's ok and sends you back to the first screen, which says it isn't. Works throughInternet explorer

    Question
    Cannot log in to Nationwide internet banking. I get the front page but Login says internet banking is not working. Next screen says it's ok and sends you back to the first screen, which says it isn't. Works throughInternet explorer

    That issue can be caused by corrupted cookies.
    *https://support.mozilla.org/kb/Cannot+log+in+to+websites
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"

  • When a pop up window comes up it is - search bookmarks and history window! I cannot log into my bank as login button should open new window to log in but I get the search page. I cannot see larger images as again I get the search bookmarks and history pa

    When a pop up window comes up it is - search bookmarks and history window! I cannot log into my bank as login button should open new window to log in but I get the search page. I cannot see larger images as again I get the search bookmarks and history page etc. Happens on all options that should open new page. I am so frustrated, this has been happening since Firefox updated itself 2 days ago to Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0C) was fine before that. using windows vista. Can you please advise what I should do? Also can you go back to previous version? Error console eg
    Warning: Error in parsing value for 'cursor'. Declaration dropped.
    Source File: https://ib.nab.com.au/nabib/styles/menu_nab.css?id=009
    Line: 116
    ib.nab.com.au : server does not support RFC 5746, see CVE-2009-3555 and Warning: Selector expected. Ruleset ignored due to bad selector.
    Source File: https://ib.nab.com.au/nabib/styles/nabstyle.css?id=014
    Line: 837
    == This happened ==
    Every time Firefox opened
    == 2 days ago after update.

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • How to get the last page  SAP Script form

    How to get the last page  SAP Script form.
    I want to print a specific information in the last page of SAP form (Script). Please tell me how to get the last page number.
    Regards

    Hi
    You have to check the system variable &NEXTPAGE&, if it's 0 it means you're in the last page.
    From SAP Help:
    This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .
    Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.
    /: IF &NEXTPAGE& = '0'
       Last page
    /: ENDIF
    Max

  • Anytime I try to print in Firefox a Microsoft KB article that is 1 page, I always only get the first page.

    Anytime I print any Microsoft KB article, I only get the first page worth of text. This is very troubling because the articles are typically long, and I only get 1 page. The second page always comes out blank (even though in IE it will print out multiple pages with all the text).
    My specific example today is listed in the URL below. This example will only print to the "DIR" command, I don't get the full page printed out.
    Anyone else have this problem? Anyone have a resolution? I hate having to hit up IE just to print a single article.
    I updated to FF 8.01 just to make sure, and I have tried different printers and even computers, to no avail. Even the print preview has the issue, only the first page worth of text is printed and the second page is always blank (even if there are 3, 4, 5, etc pages of data to be printed).
    I have also tried the Firefox Menu -> Print command, and the "on-page" print command. I have seen moderate success with highlighting all the text that I want to print and going to "Print-Selection" but it is ugly.
    Any feedback or assistance is greatly appreciated.

    '''Try the Firefox Safe Mode''' to see how it works there. The Safe Mode is a troubleshooting mode, which disables most add-ons.''
    ''(If you're not using it, switch to the Default theme.)''
    * You can open the Firefox 4.0+ Safe Mode by holding the '''Shift''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Don't select anything right now, just use "'Start in Safe Mode"''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shift key) to open it again.''
    '''''If it is good in the Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one.
    Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

  • How can I print Double A4 with HP Officejet 6500? I only get the first page...

    I try to print a large photo in "landscape" Double A4 with my HP Officejet 6500.
    I can select "Double A4" to print but I only get the first page. So I only have  half a photo.
    What should I do?

    chris
    You can not attach a multi-page .pdf document to Pages.
    Just create a folder in which you enclose both your Pages letter and the .pdf.
    Peter

  • I have recently had a problem when turning my iPad on from shutdown, in that it takes at least four attempts to slide my finger across to get the home page. The screen is clean, and when I do eventually get the home page it all works perfectly. Any ideas?

    I have a problem getting my IPad to start from shutdown. I get the Apple logo then when it is ready for me to slide my finger across the lower part of the screen to get the home page, it takes at least four attempts. When it does eventually open the home page, all works perfectly well. The screen is clean so I cannot see any reason for this annoying problem. Any suggestions will be gratefully received. Thank you. Colin.

    i would reset it, then restore as new

Maybe you are looking for

  • Airport Extreme printing problem w/ HP7 410 all-in-one

    I just purchased a HP officejet 7410 all-in-one. I can print using USB cable connected to printer. However, I CANNOT print connecting the USB cable from printer to Airport Extreme and using Bonjour printing? The print job spools than just stops? Any

  • Can't View text Message on PC suite 6.86.9.0

    Phone: N82 OS: Windows XP Media Edition SP2 Connectivity: USB with CA-101 Cable i'm been using PC suite 6.85.14 from past 3 months.. everything works fine, recently new update to ver 6.86.9.0. i start having problem reading & Send text message from P

  • Can't Get Folder Action To Work...

    Hi guys.  I'm working on an Applescript -- a Folder Action, to be precise -- which will, when files are dropped onto or added to my Downloads folder, automagically sort them into pre-existing folders, depending upon what kind of file they are.  But f

  • How to get complete path when uploading a file in Mozzila

    Hi I was trying to upload a file using html code <input type="file" name="cdrfile"> then I wrote <% = request.getParameter("cdrfile")%> trying to get the path and the file name. But Mozilla doesn't return me the complete path only the file name. Does

  • Ipod shuffle does not repond any more

    The ipod has worked for four months, though i havent used so frequently. And to day it does not respond any more or can not be found when inserted in may mac (OSX) or my pc (XP), they have both "high-power USB" and "high-speed USB", have also tried i