[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Find what kind is the client

Posted on 2004-04-03
29
Medium Priority
?
213 Views
Last Modified: 2010-03-31
Hello, could anyone please remind me how we can find out what the client is from the Http request??

For example we have a
1) J2ME,
2) a WAP phone
3) a web page

calling a controller servlet. How this servlet will identify each one of these ???
0
Comment
Question by:pouli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 13
  • 6
  • 5
  • +1
29 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10749527
Try

request.getHeader("User-Agent");
0
 
LVL 92

Expert Comment

by:objects
ID: 10749886
the client needs to send something that allows u to distinguish.
Print out the http headers and see if you canb determine anything distinguishing.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10749895
Nothing other than User-Agent should be relied upon and even that is not 100% reliable
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 92

Expert Comment

by:objects
ID: 10749913
> and even that is not 100% reliable

ie *nothing* can be relied upun as I alluded to in my comment
0
 

Author Comment

by:pouli
ID: 10751073
I know how to emulate J2ME, a Java program or a web page
but what about a WAP client ???

There must be a program that runs the WML right ???
Any suggestions please ???
0
 
LVL 92

Expert Comment

by:objects
ID: 10751082
Its not the technology that dictates it, it is the particular client and how it fills in the http headers.
0
 

Author Comment

by:pouli
ID: 10752967
Ok, objects I have got that. (About the http headers)

Could you please advise me about a good WAP emulator ???

0
 
LVL 14

Expert Comment

by:kennethxu
ID: 10753326
I agree with CEHJ that you should not even had a look at any header other then User-Agent.
and there is a list of WAP emulators:
http://www.wap-shareware.com/directory/wapemulators.shtml
0
 

Author Comment

by:pouli
ID: 10791770
Ok then how could I infer what is the type of client ???

According to the MVC pattern I need to know what is the client.
How I will do this?
0
 

Author Comment

by:pouli
ID: 10791884
I think I will use the object's way.
Send specific coed with each request in order to understand who is who.
Any other recommendations please ???
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10793903
Are you saying you have access to each potential client?
0
 

Author Comment

by:pouli
ID: 10800141
CEHJ, yes that's a good point you say.

I have yes. I make the clients. So it's easy to find out. I have done it. I just place a parameter in the URL specifying what is the type of the client.

What would happen though if I didn't ??

Possibly I could just make hypothesis about the client from the user-agent I suppose.

0
 
LVL 92

Expert Comment

by:objects
ID: 10802668
As you are implementing all the clients then you can set the User-Agent value appropriately to identify the client.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10805331
>>Possibly I could just make hypothesis about the client from the user-agent I suppose.

Yes, as i mentioned earlier. And as i also mentioned, the user-agent is the crucial field and you may well find, therefore, that it's already been set without your needing to do anything - check it.
0
 

Author Comment

by:pouli
ID: 10814792
I think we have covered the topic :)
The problem is that all the 3 of you have helped me and the points are too little to be splitted at all of you.

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10814827
First of all, since the answers are quite different, you should establish whether you need to do anything special other than read the (pre-existing?) user-agent string.
0
 

Author Comment

by:pouli
ID: 10814867
I choosed objects beause he gave the first relevant answer.
But I thank you all htough.
Do not misinterpret me please.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10814889
I'm sorry pouli but your comments don't make any sense. You've now accepted *one* answer only and as far as i'm concerned, i'm pretty certain it's the wrong one as well. Please see the Member Agreement about accepting wrong answers
0
 

Author Comment

by:pouli
ID: 10814934
CEHJ your reaction was really fast!
Object's answer was not wrong or unrealted.

But your as well was right. and you have reacted quickly.
OK.
Remind me what I have to do to split the points, because its long time since I made this.

I should go to...
and tell him to split the points.


Tell me where and I will go.
But tommorow because its late here and I am going now.
Everything will be settled.
0
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 10821503
> I'm sorry pouli but your comments don't make any sense.
> You've now accepted *one* answer only and as far as i'm concerned,

which is what he stated, so what doesn't make sense ?

> i'm pretty certain it's the wrong one as well.

That'd be why pouli accepted it :-D

0
 

Author Comment

by:pouli
ID: 10825641
All have helped a lot and I do not want to make sombody feel bad so I will split the points.

kennethxu the points are not much so I will leave you outside although your refernece was good.
Firstly I will give 25 points to Objects and I will make a new question for CEHJ.
0
 

Author Comment

by:pouli
ID: 10825661
Ok, I cannot decrease the points to the question :)
Now I need CetusMOD again how I will split the points ?
I will post a message again.

Hang on.
0
 

Author Comment

by:pouli
ID: 10834650
Ok as the admin suggests I will post 2 new questions  with 50 points each for all of you
0
 

Author Comment

by:pouli
ID: 10862492
No, that's ok CetusMOD I am happy with this. :)

Sorry, for the late reaction, but they have bloked me from my office's desktop computer.

They do not want me to loose time here and there :(
I cannot even access the mail.yahoo.com/

Anyway.

As I said people go take the points otherwise only the Admin will close this topic :)

My reaction's though will  be a bit late because I have to go to an Internet cafe to login etc....

Talk u later people.
Vitrual community is great isn't it?

0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

649 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