HTTP simple server implemented in java
The program is a little BUG. Thank you for your advice. Why is the difference between different browsers so big?
After running the server program, enter the following request path in the browser to observe the effect (the default path of my server resources is F:/project directory
Java server and C # Client communication technology research background and purpose:ARPG Project requirements: You need to change your existing server from the authoring platform of C + + to the Java language.In the process of analyzing the requirements, we find some problems that need to be researched and realized.
1. Create a new Java project to do server Public classMyServer {String str; Public MyServer(){Try{//server-side declaration with serversocket, parentheses inside the port number, the port number is its own designatedServerSocket SS =NewServerSocket (4700);the//accept method will always wait for the client to connect in hereSocket accept = Ss.accept ();//Create a
1. Form form submission:
User:
Password:
2, JS submitted:(1) Added: , can be used in other, note to have $.post, some version does not ;
(2) var
test={
Name: "Me",
Password: "Password"
};
$.post ("Http://localhost:8080/test/Login",
Test, function (text, status) {alert (text);});
3, Form+js submit:The button in the form tag must be added: type= "button", followed by the same as above 2;4.
This article describes Java to obtain this request URL and get the server root path method, and for example, interested friends can learn from the content below.
First, get the URL of this request
String Requesturl = Request.getscheme ()//The current link uses the protocol
+ "://" + request.getservername ()//server address
+ ":" + Request.gets
://jingyan.baidu.com/article/cbcede07cf5fef02f40b4ddd.htmlThis is a setup link for environment variables.Right-click on the computer's properties and click Advanced Properties Settings, click Environment variable settings, add the jar to the previously installed directory, and if not, create a new, and set the address directory for it.Third, use the Eclipse test to link the SQL Server 2008 database:1. Open the SQL
type in Java
SQL Server Type
JDBC Type (java.sql.Types)
Java Language Types
bigint
BIGINT
Long
TimestampBinary
BINARY
Byte[]
Bit
BIT
Boolean
Char
CHAR
String
DecimalMoneySmallMoney
DECIMAL
Java.math.BigDecimal
Hello everyone! Long time no see! Today we began to learn JSP, some of the basic knowledge of the record is here to share with you.First, the URL (Uniform Resource Locator agree to the resource Locator). The URL includes the Transport protocol (http://), IP address, port (port if 80 can be omitted, others cannot be omitted), project resource address.Again, the next b/s,c/s architecture.b/S is a browser/server;Browser and
Tags: statement package mans BLE [] pack LSE JDBC NALHow to use the Java language to save a picture resource in a binary form in a database Create a table in SQL Server Use MYDB1GoCREATE TABLE Saveimg (ID varchar (primary key),IMG Image NOT NULL)Select *from saveimg Using the Microsoft-provided sqljdbc4.jar for database storage, I started to use the Jtds found not stored, and then use the SQLJDBC, this I
Tags: java JDBC SQL ServerAbout the Java JDBC Connection to SQL Server and the connection to the MySQL database is the same, in order to facilitate later viewing, the author here to give a demo.Package Com;import Java.sql.connection;import Java.sql.drivermanager;import java.sql.preparedstatement;import Java.sql.sqlexception;import Java.sql.statement;public class
As a rookie, when you first started using Java to connect to SQL Server, it took a short time,Can be said to solve one after another, so I think it is necessary to share my experience to everyone.(because I stepped on most of the pits)First pit : Load drive. Java to connect to the database need to drive, we go online to download aSqljdbc.jar on the line. What to
In the log file of your WebLogic Server, you may see exception
(Window nt)
Java. Io. ioexception Connection reset by peer
Java. Io. ioexception: clientabortexception: java.net. socketexception: Connection reset by peer: Socket write error
Java. Io. eofexception Connection reset by peer(Solaris)
The following error occurs when flex calls Java: Can't invoke method "×××", and the fault code is server. Resource. unavailable.
Generally, this error is caused by the failure to find the corresponding Java method. The following solutions are available:
1.Classes that are not defined or defined in the remoting-config.xml are incorrect;
2.There must be no par
Java HotSpot (TM) 64-bit Server VM warning:ignoring option maxpermsize=256m; Support was removed in 8.0
The JDK 8 compatibility Guide indicates that, in Java 8, the command line flag MaxPermSize has been deleted. The reason is that the permanent generation is removed from the hotspot heap and transferred to local memory. So to delete this message, edit the mav
Recently in writing a successful registration, the need for mail activation of the Web registration function, so the use of NetEase server smtp.163.com as a server host to send mail to registered users. In the process of debugging the old connection failed to encounter the exception (because it is done, forgot to copy the exception information, so no).Throughout the debugging process, I even checked the con
: Hello orld! My java! so you've installed it.
Enterprise Version SDK (with JDK) Download address: http://www.oracle.com/technetwork/java/javaee/downloads/java-ee-7-sdk-with-jdk-u45-2066865.html
After the test installs the Enterprise Edition to be easy to trouble, I am installs jdk1.8 the development version http://www.oracle.com/technetwork/
In daily development, we have used many open-source web servers, such as tomcat and apache. Now we implement a simple web server. The basic function is to click the resource to be accessed, and the server sends the resource to the browser of the client. To simplify the operation, exceptions such as resource does not exist are not considered here. The web Service is based on the HTTP protocol. When you enter
The previous article said that in the early days of web development, users could only view static pages. With the development of the web, the web that can only display static pages has not been able to meet the needs of the public, so there are CGI and Java-written servlet programs.The servlet can dynamically generate an HTML page based on the user's request and then send it to the browser.Here's a simulation of the process:
HttpServer2 class
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.