I'm requesting a webpage with sockets like this:
Socket sock = null;
PrintWriter out = null;
BufferedReader in = null;
try {
sock = new Socket( "www.overvprojects.nl", 80 );
...
|
HI I am having problem in java related to write on the web server from the client. I am using following code please help me where I am wrong
For Server class
import ...
|
my question is quite hard to formulate.
Well, is there any server in whole web which one would be able work with testing sockets?
For example to send to server "somehow" and get ... |
hey guys was up.. i want to write a chat program for my web page. i know that i need to write a server/client program but im not sure on how to do this....is there any step by step tutorials out there or can some one email with and tell me how to actually do this thanx guy |
I HAVE TAKEN UP MAKING A WEB SERVER AS MY SEMESTER PROJECT BUT I AM FACING PROBLEM IN GETTING SUFFICIENT INFORMATION ABOUT IT. CAN ANYBODT HELP ME TO GATHER USEFUL MATERIAL WHICH CAN HELP ME OUT. ACTUALLY I WANT TO KNOW ABOUT A WEB SERVER FROM THE SCRATCH. HOW DOES THIS WORK,WHAT ARE THE MAIN FEATURES,WHAT ARE THE USES,HOW TO USE ... |
Hi all I have an URL (say https://mycompany.com/download.exe) I want only authenticated users get this URL(This is actually an exe the user is trying to download) If I do application level authentication and redirect to the URL, then the user can see the URL and use it to download bypassing the authentication. Is these a way I can send the exe ... |
Hi folks! I have found a java program that sends SMS (text message) alerts to mobile phones. Now, when I run this program on its own (i.e. through a main method), there are no problems. The message is sent correctly and the result code, indicating whether or not the message was sent and if not, why not is returned. However, when ... |
|
import java.io.*; import java.net.*; import java.util.StringTokenizer; final class Fileserver { public static void main( String[] args ) throws Exception { if( args.length < 2 ) printUsageAndExit(); int port = Integer.parseInt( args[0] ); String docRootName = args[1]; File docRoot = new File( docRootName ); if( !docRoot.exists() || !docRoot.isDirectory() ) { System.out.println( "Document root must be a directory that exists. Not starting..." ); ... |
|
Attention pls Mr.Ravish Thanks for you iteresting response. But could u help further by tell ing teh reall steps needed to implemnt the Socket server. i.e pls let me know where should i put the my ChatAdminServer ,ChatClient(applet in html); do i have to get a Port from the Internet host .Becuase as such we dont have WEBSERVER for our company ... |
Team , As you know, web servers adhering to Http 1.1 , can respond with chunked messages. This means that response from a web server can appear at the other side in chunks. Each chunk will have its own content length and content. It seems that Java Http Url Connection InputStream doesn't handle the chunked response. Though ACME provides classes to ... |
|
|
Hi All, I need your help to solve a problem related to parsing XML Stream. We have an application which reads data in form of XML over HTTP.Earlier , I was using parse method of DocumentBuilder , something like document = builder.parse(PULL_URL); But every now and then , it hands at this line i.e. at parse method. I read good words ... |
Here's some code I use. This gets the site content into a string. You may have to parse it to find what you want. public String fetchURL( ) throws SiteException { URL lURL; String lLine; StringBuffer lBuffer = new StringBuffer(); try { // 07/17/2002 JLS Added following statements to handle HTTPS java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); // 07/17/2002 end lURL = new ... |
|
Hi, I am trying to make a simple web server. I finally make a succesfull conection an server by a browser and the handling of GET methods works perfectlly! When i put on a browser http://localhost:80 i take my 'index.html' that i wanna take... All these are good until now... I want to develop more my simply server. Until now GET ... |
|
Only one listener can bind to a port at any time. In your case that listener is Tomcat. You can either write a proxy server to intercept requests (i.e. listen to port 8000, have people connect there, get their information and forward requests to port 8080) or work within Tomcat's framework. It's a pretty full-featured web server. I'd be surprised if ... |
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ... |
The code for the Web Server is as such: import java.lang.*; import java.net.*; import java.io.File; import java.io.IOException; class Server { ThreadForTrans theThread; public static void main( String args[] ) { try { IO.Trace("STATE", "Web server 0.301" ); if ( args.length == 2 ) { int port = Integer.parseInt( args[0] );// Port number IO.Trace("STATE", "Base of file system : " + args[1] ... |
I'm gathering some data from a site using the HTMLEditorKit. The first page works all well and good, but from that page I get URLs that lead to me other pages that require a login. Normally my browser (Firefox) handles this so I don't have to sign in each time, but how do you do this using what Java has available? ... |
|
I dont think it is all that simple. You would have to recognize all the ways that the base HTML page can refer to resources from CSS to images and imported javascript. I actually tried to write a general web page analyzer that captured all the parts separately - HttpClient is certainly the way to go. Bill |
Yes it is a bad idea. I have now added the System.out.println to each of them to see what error was caught. Going back to the images, so i will not only be have to call for the html file but the images the server uses?? any ideas on how to do it please |
Hi I built a web server which outputs HTML. Now when i run it and call for the HTML on Internet Explorer the HTML is viewed, but when i call on Firefox no HTML is outputted... why is that??? here is the source code: package myservertrial1; package myservertrial1; /** * * @author marie-jose */ import java.net.*; import java.io.*; import Proxy.Proxy; public ... |
hi i am building a program to get the contents of html on an http website. The code is found below: //Get details of the url (RequestTrial) I would like to connect to //The 'RequestTrial' stands for the url, example, www.yahoo.com url = new URL(RequestTrial); String getHost = url.getHost(); int getPort = url.getPort(); if (getPort == -1) { ... |
Hey I am using low-level sockets to send a GET message to a Web server to retrieve the HTML content and plaxe it into a file. I am managing to do so with some websites for example http://www.naturenet.com But for some other websites such as http://www.google.com or yahoo's website it either tells me that the object moved or that it doesn't ... |
I was trying to use an opensource web crawler "WebSPHINX" to crawl all the subwebpages of the url "http://www.kompass.com/guide/extraction-industries/services/GSENWW510109.html".however I failed to get any of its subwebpages. from the url I believe it is not a dynamic webpage. so could anyone tell me why subpages of this url cannot be crawled? I have tried other ready to use crawler(such as jobo,teleport ... |
I am using apache httpResponse and other API from org.apache.http to login into a secured web page by providing my ID/Password. The resultant page is getting stored in a folder as a static (.html) file Now, my aim is actually to go to a particular link on that web page and then another on result page and so on. Is there ... |
Hi! Before I get around to testing it out, I was wonder if anyone knew if I could use a webstart application to communicate with a subdomain that it came from without granting it socket permissions. Another way to phrase it, you know how it can communicate to the server (via a socket) that it is coming from without said permissions, ... |
import java.io.*; import java.net.*; // javac TCPServer.java java TCPServer http://localhost:6789/new.html class TCPServer { public static void main(String argv[]) throws Exception { String clientSentence; ServerSocket welcomeSocket = new ServerSocket(6789); while(true) { Socket connectionSocket = welcomeSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream( ) ) ); clientSentence = inFromClient.readLine(); System.out.println("RECEIVED FROM CLIENT : " + clientSentence + "\n"); } } } |
|