Home » Developer & Programmer » Forms » Geting Remote client ip or last proxy that sent the request
Geting Remote client ip or last proxy that sent the request [message #465462] Wed, 14 July 2010 04:44 Go to next message
havok
Messages: 36
Registered: February 2010
Member
I am suffering for a week over a problem in Forms and can not solve it. Sad
This problem: http://forums.oracle.com/forums/thread.jspa?messageID=4416254&#4416254
The main part where "reqest.getRemoteAddr()"
Re: Geting Remote client ip or last proxy that sent the request [message #465611 is a reply to message #465462] Thu, 15 July 2010 00:31 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What was wrong with the "utl_inaddr.get_host_address(sys_context('userenv','TERMINAL'))" in http://www.orafaq.com/forum/m/462573/67467/#msg_462573

Please post your code and explain a bit more about what you ARE receiving.

David
Re: Geting Remote client ip or last proxy that sent the request [message #465615 is a reply to message #465611] Thu, 15 July 2010 00:37 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
v_ip_from_inaddr := utl_inaddr.get_host_address(sys_context('userenv','TERMINAL'));

At this point the error ORA-29257

"sys_context('userenv','TERMINAL')" return me "CAESAR" - right

This is done in a trigger RPE-FORM

[Updated on: Thu, 15 July 2010 00:42]

Report message to a moderator

Re: Geting Remote client ip or last proxy that sent the request [message #465618 is a reply to message #465615] Thu, 15 July 2010 00:45 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
I doubt that it will return me ip of last proxy that sent the request to appserver.
Re: Geting Remote client ip or last proxy that sent the request [message #465620 is a reply to message #465618] Thu, 15 July 2010 00:47 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
http://ora-29257.ora-code.com/ Why caesar is unknow?
Re: Geting Remote client ip or last proxy that sent the request [message #465623 is a reply to message #465620] Thu, 15 July 2010 00:50 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
No. It's not something that I need. CAESAR - server name, and I need a address of client or proxy server, through which the client connects to the appserver

[Updated on: Thu, 15 July 2010 00:51]

Report message to a moderator

Re: Geting Remote client ip or last proxy that sent the request [message #465637 is a reply to message #465623] Thu, 15 July 2010 01:06 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
The client computer connects to the appserver through several networks. And I need to get the address from which the request will go to the appserver. This will be the last proxy server. Webutil and other return address in the local client network.
For example: http://ip-whois.net/ip.php - this page show me not my ip address in local net. But the last proxy, which I connect to this website. I need the same.
Re: Geting Remote client ip or last proxy that sent the request [message #465641 is a reply to message #465637] Thu, 15 July 2010 01:13 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
It sounds as though you need to ask this sort of question in a network 'sniffer' forum and not in an Oracle Forms forum.

Once you have worked out the code you need to run in either C or VB then we can help you run it from within Oracle Forms.

David
Re: Geting Remote client ip or last proxy that sent the request [message #465645 is a reply to message #465641] Thu, 15 July 2010 01:19 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
I have code in java http://www.orafaq.com/forum/t/159633/150363/, and html (use jsp). using "WEB.SHOW_DOCUMENT('http://172.16.1.204:8988/RemouteAddr-remoteIP-context-root/main.jsp', 'blank');" Broser open a new page whis remote IP address. But this is a bad option. I need to get this address in my code in Forms. How can I use this code in Forms?

[Updated on: Thu, 15 July 2010 01:22]

Report message to a moderator

Re: Geting Remote client ip or last proxy that sent the request [message #465649 is a reply to message #465645] Thu, 15 July 2010 01:24 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
Now try to get the result that he must show main.jsp not running it. I use utl_http. But do not get: (
Re: Geting Remote client ip or last proxy that sent the request [message #465652 is a reply to message #465649] Thu, 15 July 2010 01:29 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
Java code:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ExtractRemoteAddr extends HttpServlet 
{
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException 
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        // Write other information if necessary
        out.println(request.getRemoteAddr());        // sets the information in the response flow
    }
}


jsp code:
<%@ page contentType="text/html; charset=iso-8859-1" language="java"  
  import="java.sql.*" import="java.io.*" errorPage="" %>
<html>
<body>
<%
String remoteIP;
remoteIP=request.getHeader("CLIENTIP"); // if we have Webcache active
if (remoteIP==null) 
    remoteIP = request.getRemoteAddr(); // no Webcache 
out.println("Remote address = " + remoteIP);
out.println("Remote host = " + request.getRemoteHost());
out.println("Local address = " + request.getLocalAddr());
out.println("Remote user = " + request.getRemoteUser());

%>

</body>
</html>
Re: Geting Remote client ip or last proxy that sent the request [message #465653 is a reply to message #465652] Thu, 15 July 2010 01:33 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
Certainly, to use java class in Forms is possible. I just do not know how. I think the best and simplest solution to my problem will attach this java class to Forms.
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLEM&id=519298.1 Item 4.
I know how to add to the form JavaBean. And how to take away options. But I can not understand how to use this class.
Unfortunately, I'm new to java, jsp and Forms.
If anybody can help me, I'll be very grateful Smile

[Updated on: Thu, 15 July 2010 01:52]

Report message to a moderator

Re: Geting Remote client ip or last proxy that sent the request [message #465700 is a reply to message #465653] Thu, 15 July 2010 06:08 Go to previous messageGo to next message
havok
Messages: 36
Registered: February 2010
Member
And for all this, I first need to run a form with servlet. And how? Or I can use JSP, but how? )

[Updated on: Thu, 15 July 2010 06:13]

Report message to a moderator

Re: Geting Remote client ip or last proxy that sent the request [message #465964 is a reply to message #465700] Fri, 16 July 2010 02:41 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
It's just a Java thingy isn't it? Search this forum 'java' or 'bean'. There are lots of threads.

David
Re: Geting Remote client ip or last proxy that sent the request [message #467059 is a reply to message #465964] Thu, 22 July 2010 02:59 Go to previous message
havok
Messages: 36
Registered: February 2010
Member
I solved it. Solution here http://forums.oracle.com/forums/thread.jspa?messageID=4446621#4446621
Previous Topic: Use Excel Formulas in oracle forms, report and oracle
Next Topic: Vertical Scrollbal Issue
Goto Forum:
  


Current Time: Thu Sep 19 17:45:11 CDT 2024