Solved

How to find the server OS within the applet

Posted on 2002-03-14
11
155 Views
Last Modified: 2010-03-31
I need to find out the OS of the server hosting the applet. How do I find it out?
0
Comment
Question by:pankaj_garg
  • 3
  • 3
  • 2
  • +3
11 Comments
 

Expert Comment

by:maggari
ID: 6865057
use this:

System.getProperty("os.name");

It will return a string.
0
 

Expert Comment

by:maggari
ID: 6865123
I'm sorry but this returns the operating system information of just the client(i.e the system in which the applet is running). Due to security issues you might not be able to get such an information of another system from an applet( in this case, the client browser is asking the server system's information).
0
 
LVL 9

Expert Comment

by:Venci75
ID: 6865225
I don't thinik it is possible. You can only understand that is the http server on this host.
0
 

Expert Comment

by:maggari
ID: 6865366
I'm sorry but this returns the operating system information of just the client(i.e the system in which the applet is running). Due to security issues you might not be able to get such an information of another system from an applet( in this case, the client browser is asking the server system's information).
0
 

Author Comment

by:pankaj_garg
ID: 6865742
I realized that this is not possible. May be I will have to write a servlet or a perl/cgi program which passes one parameter to this applet
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 92

Expert Comment

by:objects
ID: 6866139
Just enter the OS as a parameter in your applet's html.
0
 

Expert Comment

by:fundoosathish
ID: 6876175
No, i dont think its possible to know of the OS the server is running in and this info might be blocked for security reasons.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 6878495
You can use the Applet to make a connection to its own server, call getHeaderFields() of URLConnection and parse out the OS field
0
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 6878507
A lot simpler to just pass the required information in the applet's parameters.

<applet code="myapplet.class">
<param name="serveros" value="Linux">
</applet>
0
 

Author Comment

by:pankaj_garg
ID: 6879105
Objects,
     I agree with you that passing a parameter is the simplest way.

Thanks
Pankaj
0
 
LVL 92

Expert Comment

by:objects
ID: 6879145
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now