Servlet
How to open a document in a non-HTML format with a servletA simple way to send a non-HTML document to a WEB client
by Marla Bonar (marla.bonar@javaworld.com)
Summary
Java Servlet Programming makes it easy to send HTML files
Using Java to implement breakpoint continuation (HTTP)
Content:
(a) The principle of the continuation of the breakpoint
Two Key points in Java implementation of breakpoint continuation
(iii) The realization of the core of the breakpoint
Java was originally introduced as a network programming language, which provides a high degree of support to the network, which makes the communication between client and server become reality, and in network programming, the socket is the most used.
This is primarily a simple operation of the files in HDFs in Hadoop, you can add files on your own, or upload a file operation experiment directly.Go no code as follows:Package Hadoop1;import Java.io.fileinputstream;import java.io.ioexception;import
First, download the file information class, entity
Encapsulates information about the upcoming download of resources
The code is as follows
Copy Code
Package com.hoo.entity;/*** function: Download file information class*
A netizen just needs this thing, I put several technologies together. Includes three parts and is implemented one at a time
Multi-threaded file downloads, HTTP protocol
Make this feature an HTTP service that listens on a port for easy use by
There are two ways of submitting data to the server, post and get. The difference between the two is mainly three points, security, length limit, data structure. Where GET request security is relatively poor, the data length is limited by the
Project to use, here to simplify and general, highlighting the basic ideas, specific can be based on this class to modify.Based on Java containers and Servlets.Package Com.xxx.first;import Java.io.bufferedreader;import Java.io.ioexception;import
1. WebserviceWebService is a set of remote call technical specificationsRPC is called remotely, which realizes the remote communication between system and system process.There are many technologies for remote communication in the Java domain, such
This article describes the Android Internet access picture and how it is displayed on the client side. Share to everyone for your reference, specific as follows:
1. Layout interface
2. Some types of seals
Encapsulation of URLs:
One: Causes
(1) Recently used for tasks need to crawl the content of HTML page, and similar to the reptile htmlparser contact more, crawling is nothing but filtering the information they want, so the filter is the core, Of course, the matches (Regex)
Next, we'll take a look at the second topic of Web Programming on Java: URL processing. The URL (uniform Resource Locator) Chinese name is a Uniform Resource locator, sometimes also known as the Web address. Represents a resource on the Internet,
Common methods in the 1.URL class:
Create a URL object
url url = new URL ("http://www.baidu.com");
URL url1 = new URL (url, "/index.html?usrname=lqq#test");
Common methods for URLs
System.out.println ("URL host name:" +url1.gethost ());
getting data from the Internet
Using the HttpURLConnection object, we can get the Web page data from the network.
URL url = new URL ("http://www.sohu.com");
HttpURLConnection conn = (httpurlconnection) url.openconnection ();
Conn.setconnecttimeout (
In general, it is unavoidable to encounter the call of external interface in project development, this article illustrates the method of Java background call HttpURLConnection class to simulate browser request. Can be used for interface calls. Share
The first is the database establishment to be prepared:
We're going to set the drop binary field to a BLOB type, select the appropriate BLOB type based on the size of the file, and the size of the binaries that each BLOB type can hold.
Four types of
Mobile phone file download is divided into the background of automatic download and foreground download, I summed up the implementation of these two code, where the foreground download and realize the download progress bar implementation.
The first
Copy Code code as follows:
public class Mainactivity extends activity {
declaring controls
Path and number of threads
Private EditText Et_url, Et_num;
Progress bar
public static ProgressBar Pb_thread;
Actions that show progress
Private
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.