|
||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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,
|
|
||||
|
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 |
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |