JSP getting machine name and web app, component gettting package name

Hi!

How can I have a JSP get the machine name of the server it is running on?

Similiarly, how can the JSP find the name of the WebApplication it is
running in?

How can a component find out the name of the package it is contained in?

Thanks!

D


0
Daniel
12/5/2002 1:24:09 PM
sybase.easerver.general 7903 articles. 0 followers. Follow

5 Replies
527 Views

Similar Articles

[PageSpeed] 27

In article <58127PGnCHA.329@forums.sybase.com>, 
daniel@N.0.S.P.A.M.infrontsoftware says...
> Hi!
> 
> Similiarly, how can the JSP find the name of the WebApplication it is
> running in?

Check out getRequestURL in HttpServletRequest API docs. 

> 
> How can a component find out the name of the package it is contained in?

JContext.getPackageName() + "/" + JContext.getComponentName();

HTH
Mark

-- 
Mark Pfeifer[TeamSybase]     Corporate Technology Partners, Inc.
mpfeifer_ng at sprynet.com      Emerging Technology Solutions
                                    www.ctpartners.com
0
Mark
12/5/2002 3:23:57 PM
Here's a solution to finding the name of the machine it's running on:


s_jaguarServer = System.getProperty("JAGUAR_HOST_NAME");


(This only seems to work in 4.1)


"Daniel Coppersmith" <daniel@N.0.S.P.A.M.infrontsoftware com> wrote in
message news:58127PGnCHA.329@forums.sybase.com...
> Hi!
>
> How can I have a JSP get the machine name of the server it is running on?
>
> Similiarly, how can the JSP find the name of the WebApplication it is
> running in?
>
> How can a component find out the name of the package it is contained in?
>
> Thanks!
>
> D
>
>


0
Daniel
12/5/2002 8:51:21 PM
Mark,

I should have specified a PowerBuilder component....

Any ideas there?

D

"Mark Pfeifer[TeamSybase]" <see_msg@sprynet.com> wrote in message
news:MPG.1859399751ececdc9897f8@forums.sybase.com...
> In article <58127PGnCHA.329@forums.sybase.com>,
> daniel@N.0.S.P.A.M.infrontsoftware says...
> > Hi!
> >
> > Similiarly, how can the JSP find the name of the WebApplication it is
> > running in?
>
> Check out getRequestURL in HttpServletRequest API docs.
>
> >
> > How can a component find out the name of the package it is contained in?
>
> JContext.getPackageName() + "/" + JContext.getComponentName();
>
> HTH
> Mark
>
> --
> Mark Pfeifer[TeamSybase]     Corporate Technology Partners, Inc.
> mpfeifer_ng at sprynet.com      Emerging Technology Solutions
>                                     www.ctpartners.com


0
Daniel
12/5/2002 9:41:49 PM
I got it from the component property ".name", but I'm not sure that's the
best way....

"Daniel Coppersmith" <daniel@N.0.S.P.A.M.infrontsoftware com> wrote in
message news:4Sa0CmKnCHA.329@forums.sybase.com...
> Mark,
>
> I should have specified a PowerBuilder component....
>
> Any ideas there?
>
> D
>
> "Mark Pfeifer[TeamSybase]" <see_msg@sprynet.com> wrote in message
> news:MPG.1859399751ececdc9897f8@forums.sybase.com...
> > In article <58127PGnCHA.329@forums.sybase.com>,
> > daniel@N.0.S.P.A.M.infrontsoftware says...
> > > Hi!
> > >
> > > Similiarly, how can the JSP find the name of the WebApplication it is
> > > running in?
> >
> > Check out getRequestURL in HttpServletRequest API docs.
> >
> > >
> > > How can a component find out the name of the package it is contained
in?
> >
> > JContext.getPackageName() + "/" + JContext.getComponentName();
> >
> > HTH
> > Mark
> >
> > --
> > Mark Pfeifer[TeamSybase]     Corporate Technology Partners, Inc.
> > mpfeifer_ng at sprynet.com      Emerging Technology Solutions
> >                                     www.ctpartners.com
>
>


0
Daniel
12/5/2002 9:49:57 PM
> 
> I should have specified a PowerBuilder component....
> 

integer i
ContextKeyword lcx_key
String ls_name[]

this.GetContextService("Keyword", lcx_key)
lcx_key.GetContextKeywords("com.sybase.jaguar.component.name", ls_name)

IF UpperBound(ls_name) = 1 THEN
    // extract the package name without the component name
    i = POS(ls_name[1], "/")
    zis_packageName = MID(ls_name[1], 1, i - 1)
ELSE
    zis_packageName = "?"
END IF

zis_componentName = ls_name[1]


Bye.
-- 
| Real Gagnon  from  Quebec, Canada
+ LookingForJavaOrPowerBuilderSnippets? VisitReal'sHow-to
| http://www.rgagnon.com/howto.html

0
Real
12/5/2002 10:07:51 PM
Reply:

Similar Artilces:

Get Web App Name from JSP
In a JSP, how can I easily get the webapplication name that I'm in? so if my URL was this: http:\\server\YADAYADA\hello.jsp I would want to get YADAYADA. Thanks! D Take a look at the HttpServletRequest class. -- Larry Cermak [Team Sybase] Branick Consulting, Inc. www.branick-inc.com EAServer & PowerBuilder Consulting & Training EAServer and PowerBuilder Computer Based Training Courses "Daniel Coppersmith" <daniel_N.0.S.P.A.M_at_InFrontSoftware_D0T_C0M> wrote in message news:437d64bc$1@forums-2-dub... > In a JSP, how can...

How can Java-class component work out its own EAServer package and component name ?
Can anyone please tell me how a Java class, deployed as a component on EAServer, can figure out internally which package and component name it is being invoked as ? I need this to look up its properties in the repository as shown below - for now, I have hard-coded the componentName variable (= "MyPackage/MyComp") TIA James ------------------------------------------------- Properties ORBProps = new Properties(); ORBProps.put("org.omg.CORBA.ORBClass", "com.sybase.CORBA.ORB"); ORB orb = ORB.init((String[]) null, ORBProps); com.sybase.jaguar.system.Re...

Get the component package name
If the Package name is constant, I can get the component's repository by following PB Coding: lp_properties = ln_Repository.lookup("Component","TEST/testingcomponent") However, If the package "TEST" is changed on different EA Server environment, how can I get the package name in PB code? By getting list of all packages and looping Tarik www.hepek.com <Jack> wrote in message news:6F8415BEC33C04200036D0A885256C9F.0036D0BB85256C9F@webforums... > If the Package name is constant, I can get the component's repository by > fo...

Separting the User name from the Machine name in User.Identity.Name
string userNameWithMachineName = User.Identity.Name; string userNameWithoutMachineName = System.IO.Path.GetFileName(userNameWithMachineName); HighOnCodingWanna get high! ...

How to get DNS Name be the DNS Name rather than computer name
In Patchlink associated with computers there is "DNS Name" field. This field seems to be the computer name (netbios name) for windows computers rather than the dns name assocated with the IP address. Is there a way to configure the patchlink server so this field reports the DNS Name rather than the computer name? where is that "DNS name" field? -- Shaun Pond > where is that "DNS name" field? > > -- > > Shaun Pond > > From the web interface: 1) From the Reports ->Computer Status Report the second field ins DSN Name 2) From the Computers ->Click on any computer under Computer Information the first column you will find DNS Name: johnh... in my environment, the ones that do have DNS names show with that name in both those places... -- Shaun Pond ...

accessing ressources in components and web apps using the same name
Hi, I like to reference ressources (images) in a PB component and a web app (the generated HTML page) using the same name. This is easy using an absolute path like t:\images but the source <img src="t:\images\quest.jpg" alt="Picture"> isn't displayed in some browsers (like expected, I'm rather surprised that it is displayed in IE). Using relative pathes fails because the component acts as located in {JAGUAR}\bin, the web app acts as located in {JAGUAR}\Repository\Webapplications\<appName> I hope there is a way to administrative add an externa...

How to edit my Module name and Component name?
Dear all, I am unable to edit the Module name and Component name while reporting a new bug in Bugzilla which by default shows as "Test Component" and "Test Product". Could anyone tell me how to do it? On Aug 30, 11:06=A0am, vaish <vaishuinfot...@gmail.com> wrote: > Dear all, > > I am unable to edit the Module name and Component name while reporting > a new bug in Bugzilla which by default shows as "Test Component" and > "Test Product". Could anyone tell me how to do it? Hi, try out this, http://url/bugzilla/editpro...

ipaddress, machine name, domain name
I need c# code to determine my ipaddress, machine name, domain name Hi, the System.Net.Dns class contains methods to perform address resolving operations. For example, GetHostName() returns the name of the local computer and Resolve() performs a DNS query on a given host name. Some of these methods return a IPHostEntry object, that holds a list of IPAddress objects.Alessandro Gallo | Blog | My book: ASP.NET AJAX In Action...

Bug?: Domain Name= app name
Hi i believe i have a found a bug and want feedback If your application has the same name as the internet domain (eg www.my-domain.com) the registration of a included HTTPmodules failes under condition that a minus is in the domain name Visual Studio makes as root namespace www.my_domain.com so registration in web.config should be <add name="httpModule1" type="www.my_domain.com.httpModule1, www.my-domain.com" /> i am wrong? -Hanneshttp://www.preishuber.net http://weblogs.asp.net/hpreishuber...

SQL: Column names, can ONLY get "name" instead of "table.name"
Hey all, When iterating through column names returned from a query, I need to get "table.name" rather than just "name" Check it out: If I have an SQL statement "SELECT table1.ID, table2.ID FROM table1, table2;" And table1 has a column name 'ID' and table2 has a column name 'ID' aswell, and i run the query, the dataset will contain column names 'ID' and 'ID' instead of 'table1.ID' and 'table2.ID' It is extremely important that I can differenciate between the 2 fields, and know where each of them come from. The same thing happen...

Get package name
Sorry to send the topic again. Last new written >Still 'ContextKeyword', just look up the component name and strip off the package bit. HTH, R. I try to use contextkeywork to get the package name of my component. But I failed. Can you give me some example or where can I find example (I try to find in PB help but failed)? Actually, I have the same name NVO but packing in different package (for different version's NVO). If I use lookup, it may find the NVO which is not belong to the object package? > I try to use contextkeywork to get the package nam...

How to get machine name
I want to know about how we can get the machine name through some API's or some other way. I try to get machine name through GetComputerName and GetComputerNameEx Api's but the problem is that the system crashes when one of these Api was Called. Please give me some suggestion .I am waiting for ur reply. Thanks Regards Muhammad Ali Khan <Muhammad Ali Khan> wrote in message news:3fcd6a03.4516.846930886@sybase.com... > I want to know about how we can get the machine name through > some API's or some other way. > I try to get machine name through GetCo...

How to get the package name?
Hi, How to get the installed component's package name with in the component method ( in which the component is installed under the package). TIA From within your component method, you can call the Jaguar Repository component's lookup method for the package and then get the value for the com.sybase.jaguar.package.name property. Steve Finck Corporate Technology Partners www.ctpartnes.com Let me try that one more time ... Look up the component properties using the repository and then get the property com.sybase.jaguar.component.name and parse out the package...

When does a component get its name?
I'm working on a TGraphicControl component that doesn't have a caption but I'd still like to be able to display the component's name on it. (The component draws it's own text on the canvas.) I've tried picking up the name in the constructor but it seems it's not available yet. constructor create, etc. begin inherited; FText:=Name + 'test'; end; When I run the program the text I get is 'test''. When I drop the component on the form I get nothing. I added a Loaded procedure. {code} procedure TksLabel.Loaded; begin FText:...

Package/Component names
Hi All In the Jaguar CTS exists, for me, one unclear point. As I understand Jaguar on the top level of its hierarchy has the Server entity, Packages, Components and Connection Caches. Inside each Server Jaguar has on the top Packages and Connection Caches. Inside Packages has Components with methods. If, for example, I developed a new Jaguar CTS based application and I exported and sent all my packages to my client. He should import them to the Jaguar CTS. It is OK. But if he has already some packages or components with the same names as mine installed on his Jaguar. ...

Get machine name
Hello, I would like to get the machine name in PowerBuilder 9. How can i do this? Thanks On 15 Sep 2004 01:00:19 -0700, Jean-Louis CANTIN <jean-louis.cantin@jii.fr> wrote: >Hello, > >I would like to get the machine name in PowerBuilder 9. > >How can i do this? > >Thanks Ext Function function boolean GetComputerNameA(ref string lpBuffer, ref ulong nSize) library "KERNEL32.DLL" ------------- boolean rc string computer_name computer_name = space(16) rc = GetComputerNameA(computer_name, 16) Boris Gasin [TeamSybase...

Accessing ASP.NET app on local machine with machine name
With IIS 5 and 6 I could access the local web server on my machine by typingmy machine's name in the browser. With IIS7 in Vista Ultimate the localmachine name does not work.The local machine IP works. Using "localhost" works. Even using my machinename from another computer works but not from my computer. Pinging mymachine name resolves to the proper IP.Any ideas how to get this working?ThanksPerry That is odd. I'm not sure why it's not working, but you can try adding the following to your c:\windows\system32\drivers\etc\hosts file: 127.0.0.1   yourmachinen...

Books name & Author Name required on C#, ASP.Net, Web Design, Web Service..........
Hello, We are planning to have books library in our company on C#, ASP.Net, Web Design, Web Service,  WPF, WWF, WCF and all related books on Visual Studio 2005 above version. Can some one please suggest me, good books name and author for the following types;  Sl No Type Books Name Author Name 1. C#     2. ASP.NET     3. Web Design     4. Web Service     5. WPF     6. WWF     7 WCF     8. Design & Patterns     Many tha...

Getting server name and the name of virtual directory
Hi, I have the following situation: one aspx page of mine, has a link, which upon clicking, invokes the msi on the client side machine. I need a way to get the Server Name and the Virtual directory from which the page came and use it in the msi to update one of the files which it will install in the client machine. Thanks, Vasanth Depends on where you are doing this, but the following assumes you are in an aspx page. Request.Url.Host // This will give you the host part of the uri enteredRequest.ApplicationPath // This will give you the ASP.NET applications virtual application root on the server Thanks for your reply, but that wont work for me, because i need the information on the msi, so that the msi can use it to update one of the files it's gonna install on the client machine.... any idea how to do this?...

Getting server name and the name of virtual directory
Hi, I have the following situation: one aspx page of mine, has a link, which upon clicking, invokes the msi on the client side machine. I need a way to get the Server Name and the Virtual directory from which the page came and use it in the msi to update one of the files which it will install in the client machine. Thanks, Vasanth...

Getting the name of the object (the name of the object in the library)
Is there a way to get the name of an object as named in the library? I have a user object named ucb_user_object.. I put it in a window and I named it cb_1 The ClassName() function will return cb_1 but I want the function to return "ucb_user_object". Any of you have an idea ? Have a look at ClassDefinition, and following the ParentClass attribute up the chain. Extend this enough, and you can identify all descendants of ucb_user_object (I'm guessing that may be your objective). PFC implements something like this in (pfcapsrv.pbl)pfc_n_cst_metacl...

package name alias (for shorter variable name)
i have several "constants" in a package: package Foo::Bar::Constants; $alice = {name=>"Alice", low=>-10, high=>21}; $bruce = {name=>"Bruce Wayne", low=>-17, high=>5}; $charlie = {name=>"Charlie", low=>-3, high=>3}; $devon = {name=>"Devon E.", low=>1, high=>29}; and i want to use them in another package: package main; require Foo::Bar::Constants; use Foo::Bar::Functions; add_foo(\@a1, $Foo::Bar::Constants::alice, 1, 3); add_foo(\@a1, $Foo::Bar::Constants::bruce,...

Error Creating Conrol- Duplicate component name 'ReportViewer1'. Component names must be unique and case-insensitive
Hi, I am facing a weird problem. I am using Visual Studio Express edition to design and code . I have two reportviewers in my application with names ReportViewer1 and ReportViewer2. The problem is that the application works just fine in the browser and displayes the reportviewers with data, but when I switch to design view in VWD, it gives this error in place of reportviewers. Whats going on??? Error Creating Conrol- Duplicate component name 'ReportViewer1'. Component names must be unique and case-insensitive. Can someone help please... thanks, bullpit  Thanks,MaxLet Me ...

getting dw components, name
Is there a way I can get the name of an object that belongs to a datawindow and it's not a column? For ex. I get column name with Describe('colname'.name) How can I get the name of a computed field that belongs to the same datawindow? Thanks.. Wouldn't that just return 'colname'? Describing the name attribute is only useful with the #n column value. You can get a tab-separated list of the names of all the objects in a DW with Describe ("DataWindow.Objects"). "George" <georgep@open-solutions.gr> wrote in message news:7VzJOF...

Web resources about - JSP getting machine name and web app, component gettting package name - sybase.easerver.general

Component - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Waterproof components listed for Galaxy S7 on import tracking site
... at least water-resistant – rumors are starting to look increasingly solid. Import tracking site Zauba has revealed several “waterproof” components ...

Minecraft: Pocket Edition receives a new update with additional Redstone components
... fare like elevators. It definitely opens up the possibilities in the already multi-faceted game. The update adds other Redstone components ...

Video explains a key component of the Galaxy S7’s camera
Samsung called out Apple several times on stage during its Galaxy S7 announcement when it introduced the new phone's camera. Now a video has ...

There's more to Lent than fasting: a look at the 3 components of Lenten observance
If you only paid attention to the mainstream media, you would be forgiven for thinking that Lent is all about fasting in response to Jesus' temptation ...

Iran exports heavy water, a nuclear reactor component, to US
TEHRAN, Iran (AP) — Iran's semi-official ISNA news agency says the country has exported heavy water, a key component for one kind of nuclear ...

House designed by GENS as collage of banal components
One half of this house in northeast France has a tiled roof and rendered walls, while the other is clad in corrugated plastic and has a chamfered ...

PC, handset component suppliers worry about mounting inventories
Suppliers in the PC and handset supply chains have begun to worry about piling up inventories of parts and components as current demand for PC ...

16 Dow Components Set 52-Week Lows Last Week, These 5 That Bounced The Most
The Dow did not set a new 52-week low last week but 16 components did and these five stocks rebounded by more than 6% above their lows.

Tindie Opens a Flea Market for Tools, Components, and other Gear
... of your hands? At launch, the Tindie Flea Market categories will include Adapters and Cables, Audio and Video, Batteries and Power, Bulk Components, ...

Resources last updated: 3/30/2016 10:37:10 AM