Go Back   Java Programming Forums > Java Standard Edition Programming Help > Java Networking


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-11-2009, 05:52 AM
Junior Member
 

Join Date: Oct 2009
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
chinni is on a distinguished road
Default How to get the url from the browser as object in my server class?

hi boss,
i am writing one server class. in that serversocket created at the port 9000.
now i want to get url in the browser as a java object.
boss i used getInputStream() method to get url but i get as a string object.
from that i have to get contextpath, path info ...etc
here, i want one URL class object if tried to get that by String as parameter of constructor, it gives MalformedException.

i sent url in browser as http://localhost:9000/app/servlet , is it ok? boss.

is it ok for URL class object or any other class object we have to create ?

and i want to send response to the browser. so i want its address for that i used outputStream() but the output didn't going to browser.
how can i send the response to the browser?

plzzz tell me by which class i have to get the browser url information?

plz help me thank u boss,



Reply With Quote Share this thread on Facebook
Sponsored Links
Java Training from DevelopIntelligence
  #2 (permalink)  
Old 05-11-2009, 07:35 PM
Json's Avatar
Super Moderator
 

Join Date: Jul 2009
Location: Manchester, United Kingdom
Posts: 1,157
Thanks: 54
Thanked 136 Times in 132 Posts
Json will become famous soon enoughJson will become famous soon enoughJson will become famous soon enough

I'm feeling Happy
Default Re: How to get the url from the browser as object in my server class?

Are you using a normal HttpServlet here?

In that case I guess you have an incoming HttpServletRequest object. You can use the request object to get the requestURL and URI.

See HttpServletRequest (Servlet API Documentation))

// Json
Reply With Quote
  #3 (permalink)  
Old 06-11-2009, 02:15 AM
Junior Member
 

Join Date: Oct 2009
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
chinni is on a distinguished road
Default Re: How to get the url from the browser as object in my server class?

hi json ,
i am not using any HttpServlet or any?
at my socket which is running at a port no 9000,
i want to take URL class Object? how is it possible?

//chinni
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
Object o = new Object(); need help zeeshanmirza Object Oriented Programming 11 07-01-2010 02:01 AM
[ASK] Make Object as a layer bocahTuaNakalzz AWT / Java Swing 2 24-10-2009 06:07 PM
How can i point the mouse over a html element within the web browser? bobomonkey Java Theory & Questions 2 18-10-2009 05:37 PM
Having trouble printing object information in main class KingLane Object Oriented Programming 1 11-10-2009 11:53 PM
UDP server Koren3 Java Networking 0 12-04-2009 10:46 AM


100 most searched terms
Search Cloud
2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jbutton java jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

All times are GMT. The time now is 01:47 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.