IP address
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 2
- Joined: Wed Sep 26, 2007 7:15 am
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
First thing that comes to mind is using the environment variable "remote_addr".
To use env. vars look in the (3.4.x) online documentation for page: /doc/Environment_variables.htm
Perhaps someone has created a customfunction for this, so we don't have to amend the web.xml file. I would be interested in this :)
To use env. vars look in the (3.4.x) online documentation for page: /doc/Environment_variables.htm
Perhaps someone has created a customfunction for this, so we don't have to amend the web.xml file. I would be interested in this :)
0 x
-
- Ebase User
- Posts: 2
- Joined: Wed Sep 26, 2007 7:15 am
The web.xml is the file where you can find descriptions of the servlets and components that make up the application, UFS in this case. So, though these are also environment variables, they are related to the environment of the servlet. I think that what I am looking for are environment variables that relate to the session that is created within the servlet. Is there a way to get to those?
0 x
-
- Ebase Developer
- Posts: 27
- Joined: Tue Sep 18, 2007 3:21 pm
I'm sorry, but there is no easy way to do this at the moment.
A custom function is probably the best way to do this. The problem is you need access to the javax.servlet.ServletRequest object, but the only sensible way to do this is undocumented and secret. (We really should put it in UFSFormInterface).
In FPL, it would be something like:
SET USER_IP = getUserIPAddress();
If you are interested, I will make the function and post it here. It will also get added to the library of "Additional Supplied Functions".
A custom function is probably the best way to do this. The problem is you need access to the javax.servlet.ServletRequest object, but the only sensible way to do this is undocumented and secret. (We really should put it in UFSFormInterface).
In FPL, it would be something like:
SET USER_IP = getUserIPAddress();
If you are interested, I will make the function and post it here. It will also get added to the library of "Additional Supplied Functions".
0 x
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
Please do. I'm interested.Ben wrote:If you are interested, I will make the function and post it here. It will also get added to the library of "Additional Supplied Functions".
It would be very nice if I could just use a "getEnv(String)" method. As string I'd use "REMOTE_ADDR", "HTTP_REFERER" or "SERVER_PORT" to get to the various environment strings.
0 x
-
- Ebase Developer
- Posts: 27
- Joined: Tue Sep 18, 2007 3:21 pm
I have put a jar containing the custom function in http://www.ebaseftp.com/forum/forumfile ... operty.zip. At the moment it is called requestproperty.jar, but it will become part of the standard distribution in the next release.
The requestProperty custom function provides access to various properties
in the HTTP request (including the calling ip address).
To register the custom function with Ebase, put requestproperty.jar in
your WEB-INF/lib directory (/UfsServer/tomcat/webapps/ufs/WEB-INF/lib) and restart your tomcat server. In Designer, go to the menu, 'tools/Maintain Functions...' and add the new function:
name: requestproperty
class: com.ebasetech.ufs.customfunctions.RequestProperty
return type: char
it has one char parameter. This represents the property name.
The available properties are all of the get methods in javax.servlet.http.HttpServletRequest that take no arguments.
http://java.sun.com/j2ee/1.4/docs/api/j ... quest.html
Some of the more useful ones are
serverName
serverPort
remoteHost
remoteAddr
requestURL
servletPath
To use it in FPL the command is something like:
SET IPADDRESS = requestproperty('remoteAddr');
'Referrer' is a request header property. I'll need to make a slightly different function to get at it. (requestHeaderProperty?)
The requestProperty custom function provides access to various properties
in the HTTP request (including the calling ip address).
To register the custom function with Ebase, put requestproperty.jar in
your WEB-INF/lib directory (/UfsServer/tomcat/webapps/ufs/WEB-INF/lib) and restart your tomcat server. In Designer, go to the menu, 'tools/Maintain Functions...' and add the new function:
name: requestproperty
class: com.ebasetech.ufs.customfunctions.RequestProperty
return type: char
it has one char parameter. This represents the property name.
The available properties are all of the get methods in javax.servlet.http.HttpServletRequest that take no arguments.
http://java.sun.com/j2ee/1.4/docs/api/j ... quest.html
Some of the more useful ones are
serverName
serverPort
remoteHost
remoteAddr
requestURL
servletPath
To use it in FPL the command is something like:
SET IPADDRESS = requestproperty('remoteAddr');
'Referrer' is a request header property. I'll need to make a slightly different function to get at it. (requestHeaderProperty?)
0 x
-
- Ebase User
- Posts: 97
- Joined: Thu Sep 13, 2007 6:07 am
- Location: The Netherlands
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
-
- Ebase User
- Posts: 9
- Joined: Mon Oct 08, 2007 10:18 am
Quote:
'Referrer' is a request header property. I'll need to make a slightly different function to get at it. (requestHeaderProperty?)
Please can you tell me if REFERER property is now available to reference in FPL ... it would be so useful.
Genral criticism of Ebase:- that a lot of standard functions like these should be out-of-the-box
Sanjay
'Referrer' is a request header property. I'll need to make a slightly different function to get at it. (requestHeaderProperty?)
Please can you tell me if REFERER property is now available to reference in FPL ... it would be so useful.
Genral criticism of Ebase:- that a lot of standard functions like these should be out-of-the-box
Sanjay
0 x
- Sarah
- Ebase User
- Posts: 63
- Joined: Fri Sep 07, 2007 2:42 pm
- Location: Sandy, UK
- Contact:
First item: No, it is not currently available in FPL.sjethwa wrote:Quote:
Please can you tell me if REFERER property is now available to reference in FPL ... it would be so useful.
Genral criticism of Ebase:- that a lot of standard functions like these should be out-of-the-box
Sanjay
Second item: Custom functions that are written to extend the functionality of Ebase are included in future service packs as and when possible. It is not always possible to include them in the Ebase application.
0 x
-
- Ebase User
- Posts: 11
- Joined: Thu Oct 16, 2008 11:33 am
- Location: Mumbai, Currently in Croydon
about remoteHost property
Hi,
Whether "remoteHost" expected to return the remote host name or IP address as I am getting the IP address in remoteAddr and remoteHost
Please advise.
Regards,
Sid
Whether "remoteHost" expected to return the remote host name or IP address as I am getting the IP address in remoteAddr and remoteHost
Please advise.
Regards,
Sid
0 x
- Joost
- Ebase User
- Posts: 49
- Joined: Fri Sep 14, 2007 6:14 pm
- Location: The Netherlands
Re: about remoteHost property
It probably has something to do with your server not resolving the ipaddress to a hostname. Perhaps the following links may help you:sid_nadgeri wrote:I am getting the IP address in remoteAddr and remoteHost
IIS
http://metasun.net/node/74
http://classicasp.aspfaq.com/general/wh ... dress.html
Java/Tomcat
http://old.nabble.com/enableLookups%3Dt ... 96774.html
http://objectmix.com/java/71883-client- ... -name.html
0 x
Who is online
Users browsing this forum: No registered users and 139 guests