How to get Server Name and port. Urgent.....
Hi,
Please let me know how can i get the server name and port without using request object.
I am getting it :- request.getServerName();
But, pl. let me know how can I get it without using this request object.
Waiting for reply..
I don't know of any way to trivially access that, but why do you need to do this? If you need access to that information in a method that can't see your HttpServletRequest, then perhaps your architecture has a flaw, and you'll be better off in the long run restructuring it.
Similar Messages
-
How to get server name and port of OSB server in a proxy service ?
I need to get the server name and port of the OSB server inside a proxy service. How can I get this?
You may use java callout for this purpose -
How to get ServerName and ApplicationName in OSB (ALSB) ?
Regards,
Anuj -
How to get server hostname and port from web form
Hi All,
I need to find out server hostname and port number
from 9i form.
That is if the form was called via:
http://myserver.com:1234/f90servlet?form=test,
i would like to call some
GET_XXX_PROPERTY(SERVER_HOSTNAME) that would return
myserver.com
and
GET_XXX_PROPERTY(SERVER_PORT) that would return
1234
or alternatively
GET_XXX_PROPERTY(SERVER_URL) that would return
complete URL, so that i can parse it myself.
Does anything like this exist? If not,would be
possible to get that information from any Java
function via java importer?
BR,
Robert
BR,
RobertRobert,
I'd add the code as a Java Bean in Forms and get this information from the Forms request URL.
Add the following bean to a Canvas and make it a size of 1x1 pixel so taht it appears hidden
import java.applet.Applet;
import java.net.URL;
import oracle.forms.handler.IHandler;
import oracle.forms.properties.ID;
import oracle.forms.ui.VBean;
public class FrmRequestInfo extends VBean
public static final ID pGetPort = ID.registerProperty("GET_PORT");
public static final ID pGetHost = ID.registerProperty("GET_HOST");
public static final ID pGetProtocol = ID.registerProperty("GET_PROTOCOL");
private String _host;
private String _port;
private String _protocol;
private URL FormsURL;
Applet m_applet;
/*Forms settings*/
IHandler m_handler;
public FrmRequestInfo()
public final void init (IHandler handler)
super.init(handler);
m_handler = handler;
// get the forms applet handler
m_applet = m_handler.getApplet();
// initialize cookie domain to the same domain that runs Forms
// Services
FormsURL = m_applet.getDocumentBase();
_host = FormsURL.getHost();
_port = new Integer(FormsURL.getPort()).toString();
_protocol = FormsURL.getProtocol();
public Object getProperty(ID p0)
if (p0 == pGetHost)
return _host;
else if (p0 == pGetPort)
return _port;
else if (p0 == pGetProtocol)
return _protocol;
else
return super.getProperty(p0);
To get the port number you call
VarcharVariable_Port := get_custom_property('beanblock.beanname',1,'GET_PORT');
for the hostname
VarcharVariable_Host:= get_custom_property('beanblock.beanname',1,'GET_HOST');
Frank
Ps.: just wrote the bean on the fly, without testing - but I am positive that it works as similar functionality works for me in other beans. -
How to get Host name and port inside UDF
Hi,
I want to access the Host and port in UDF to pass it to a link http://host:port/AdapterFramework/ChannelAdminServlet?party=&service=&channel=*&action=status dynamically.
How can I acieve it?
ManishaHi
With this code. I am getting error:
try
java.net.InetAddress addr = java.net.InetAddress.getLocalHost();
String host = addr.getCanonicalHostName();
catch (UnknownHostException e){}
if (ProcessMode.equals("P"))
try{
String xyz="/AdapterFramework/ChannelAdminServlet?party=&service=&channel="Name"&action=stop";
URL server = new URL("http", host, 8XXX, xyz);
tring userPassword =Userid + ":" + Password;
String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
URLConnection uc=server.openConnection();
uc.setRequestProperty ("Authorization", "Basic " + encoding);
BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
while ((inputLine = br.readLine()) != null)
output+=inputLine;
br.close();
catch (Exception e){}
ERROR:
cannot resolve symbol
symbol : variable host location: class com.sap.xi.tf._MM_CommunicationChannel_Stop
_ URL server = new URL("http", host, 8xxx, xyz);
^ 1 error
Any other way to get host and port?
Manisha -
How to get server name and/or IP address from client (10g)?
Thanks.
SELECT SYS_CONTEXT( 'USERENV', 'IP_ADDRESS' ) FROM dual;
SELECT SYS_CONTEXT( 'USERENV', 'HOST' ) FROM dual;assuming you have a two-tier system (i.e. the client is actually making the connection to the database). If you have a three-tiered system, the middle tier would have to pass in this information.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Application server name and port number
Hi
Is it possible to get the application server name(ip) and port number at runtime. Becuase i want to open an html file which is in the application server, when a button is pressed by using web.show_document ();
Can anyone guide me please.
Thanks in advance
geethuapplication server name and port number
-
Getting host name and port number from application
Does anyone know how I would be able to get the host name
and port number from an application launched by java webstart ?
This is the host and port of the URL that this application is launched from.A couple of suggestions:
-The note is about 6.40. Doesn't fit for your server
-Don't!
-Reinstall!
Regards,
Benny -
Getting host name and port number from an application
Does anyone know how I would be able to get the host name
and port number from an application launched by java webstart ?
This is the host and port of the URL that this application is launched from.A couple of suggestions:
-The note is about 6.40. Doesn't fit for your server
-Don't!
-Reinstall!
Regards,
Benny -
Hi,
is there like session/repository variable that holds the server/host name and port? i would like to get these values programmatically.
thanks.In my humble opinion do not see any use in setting up these details on variables. The fact that these could be used only after logging on, which will obviously need these details manually. If you require it for tracking purpose, You could do it manually, as they are going to be static at least for that session.
-
Configuring server name and port number through action links - obiee11g
Is it possible to configure host name and port when using action links ?
Say some session variables hold these values. Is there any way to use these values ?
Thanks
SMAny pointers ?
-
How to get service name and listening host to connect to oracle DB server?
I have successfully installed oracle db client 10g release 2 on my winXP. But when I tried to use Net Congiguration Assistance to connect to oracle db server. I do not know what is the "service name" and listening "host" I supporse to enter. Where can I get the names?
PLEASE HELP! THANKS!machine name or IP = machine name or IP address of the database server
To know the service name do the following on the server :
$ lsnrctl services
LSNRCTL for Linux: Version 10.1.0.3.0 - Production on 30-DEC-2005 00:24:28
Copyright (c) 1991, 2004, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "test10" has 1 instance(s).
Instance "test10", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
$The service name is test10 in my case. Of course you have to use yours. -
Get report server name and port name
J want to know if it is possibile to obtain from a form the name of the report server and the port on work.
Infact if i use two different application server the nae of the report server change and in the script that call the report server is necesseraly using the name of the report server.
Thank'sif your cases are that the dev, test, production servers have different servers and databases, then you may create a table e.g., report_server_profiles(serv_name varchar2(100),ports number), it contains one record ONLY in each server's database, then in your form code only have same code that works for three of them.
If you have two report servers, but have one database, then you may add a flag column in above table and depends on users group to set that report flag. -
How to get the name and value of an attribute on a node/element that is not a child
Hello,
Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
another doc with the same layout, but different content.
I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'. I can only seem to get the node names, but not the attributes on the node. I need the name, because it can be different from doc to doc, so
I can't hardcode this.
Can someone please help with how to retrieve an attribute name/value on a node that is not a child. Here's an example of what
my xml looks like:
DECLARE
@myDoc1 xml
,@mydoc2 xml
DECLARE
@ProdID int
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>2 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "wheel">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first. If they are, then i want to show the difference in the child elements.
This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
...etc...
but that only gives me the node names, and the child elements. It does not give me back the attribute names and values from the node itself.
Thanks in advance for your help.
ceeAre you looking for something like this:
DECLARE @myDoc1 xml
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<Features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>'
SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
T.c.value('.', 'nvarchar(50)') AS value
FROM @myDoc1.nodes('ProductDescription/@*') AS T(c)
Erland Sommarskog, SQL Server MVP, [email protected] -
How to get file name and set it as static text in a dialog
Hi,
I m new to InDesign Programming.
I have a menu that creates a dialog with different controls in it.
The dialog will appear only if there is an open file. I need to display the name of the open file as a static text in the dialog. I know to get the name of the current file but don't know how to pass this each time the dialog is opened.
Can someone help me in doing this?
I m using InDesign CS3 in MAC OS.
Thank You.those are the methods, but you can't use getCharacterEncoding(), actually, cuz it seems it's not necessarily filled in.. or at least that might be on some servers only, like Tomcat 4. As for encodings, you need to do a search for character encoding names and use the appropriate one.
-
WAD: How-to get query name and pass to URL
Hi,
The task: In a BI 7.0 web template - get the technical query name and use that to open a URL in the format http://<MYURL>&DOCUMENTATION=<QUERYNAME>. So:
1) User clicks an icon
2) Get technical name of query
3) Open the documentation for that query using a URL
How can this be done? Do I have to use the Custom Extension web item and implement a new class using the interface IF_BICS_CONS_WEBITEM_CUST_EXIT? If so, do you have an example of how this can be done? OR even better is there an easier way to accomplish this?
Thanks in advance,
JacobHi Daniel,
you could get the query name in ABAP code, also. Here is a snippet from the execute method. The Query name should be in l_sx_view at the end.
best regards
Arne
TYPE-POOLS:
rrx1.
DATA:
l_string TYPE string,
l_xml TYPE string,
l_xml_xstring TYPE xstring,
l_sx_view TYPE rrx1_sx_view,
* Line Feed, CR
c_lf TYPE string,
l_h_lf(2) TYPE x VALUE '0D0A',
l_r_conv TYPE REF TO cl_abap_conv_in_ce.
* Get the line feed and carriage return for unicode
l_r_conv = cl_abap_conv_in_ce=>create( input = l_h_lf ).
l_r_conv->read( IMPORTING data = c_lf ).
DATA:
l_t_data_providers TYPE cl_bics_cons_webitem_util=>tn_t_data_provider,
l_s_data_providers TYPE cl_bics_cons_webitem_util=>tn_s_data_provider,
l_r_variable_container TYPE REF TO if_ixml_node.
CLEAR e_xml.
TRY.
* All data passed to the webitem exit is hold in I_XML using XML.
* The XML is UTF-8 encoded. You can convert the UTF-8 xstring
* to a simple ABAP string by calling the following method:
* ==================================================================
CALL METHOD cl_bics_cons_webitem_util=>utf8_xstring_2_string
EXPORTING
i_utf8_xstring = i_xml
RECEIVING
r_string = l_xml.
* The XML includes sections about the used data provider and about the
* variable container. The following method parses the XML and
* provides the IF_IXML_NODE instances for data providers and for the
* variable container.
* ==================================================================
CALL METHOD cl_bics_cons_webitem_util=>parse_xml
EXPORTING
i_xml = i_xml
IMPORTING
e_t_data_providers = l_t_data_providers
e_r_variable_container = l_r_variable_container.
* 01 Get name of first Data Provider
READ TABLE l_t_data_providers INDEX 1 INTO l_s_data_providers.
CALL TRANSFORMATION bics_cons_webitem_filter_by_dp
PARAMETERS dataprovider = l_s_data_providers-name
SOURCE XML i_xml
RESULT XML l_xml_xstring.
CALL METHOD cl_bics_cons_state_converter=>convert_xml
EXPORTING
i_xml = l_xml_xstring
IMPORTING
e_sx_view = l_sx_view.
Maybe you are looking for
-
Trouble with wireless n and smb shares
I have a bit of a per-plexer here. I have a personal mac that up until a little while ago, ran 1.5.8 flawlessly for six months since i had it. This included a lot of mounting my windows 7 file server and watching movies or listening to music over wir
-
IOS 8.2 and Airplay doesn't work
iOS 8.1 never had any issues with Airplay. I connect to a Airport Express (2nd Gen-7.6.4) that had the mini jack (2.5mm) that I run to my mixer to play break and intermission music at gigs. Now it doesn't work at all since updating to iOS 8.2 which
-
Hi All, I have the records in the following pattern. Key Record REC_KEY1 CLASS1 CHAR1 CHAR_VALUE1 CHAR2 CHAR_VALUE2 CLASS2 CHAR3 CHAR_VALUE1 CHAR4 CHAR_VALUE4
-
Formatting a drive in HFS (Mac OS Standard)?
I pulled my old Mac, an older G4, out of storage to attempt to install Ubuntu linux on it. There seems to be something wrong with the CD drive (DVDs mount, but CDs don't), so installing from the CD is out. I was going to go with the hard drive instal
-
There was an error opening the database for the library "~/Desktop/TEMP_aperture/Aperture Library.aplibrary". I am not able to open my Aperture - I have tried the recommendation from the manual page 839, but I do not get access to the window the manu