Look from web development. NET and Java

Source: Internet
Author: User
Tags http request java web

First, declare this article only from one point of view. NET and Java, and just say a point, to be sure, this article's point of view is certainly one-sided, but I think can explain some questions, or as a reference.

I personally do not exclude any technology, but also believe that any technology can achieve the same business purpose.

Individuals have dabbled in. NET, Java, Python, Rails, some longer, some shorter.

Technology is for business services, or for a commercial or non-commercial purpose to serve, in order to achieve the goal, in order to improve efficiency, in order to save time, it should be said that the use of any programming language, any programming platform, in most cases can achieve the same goal.

Language and platform is not high or low, only the scene applicable.

The first language is a person, or a group, or a company, or an industry leading group, for some purpose, to speed up some kind of business, invent design, so in the design of the time will inevitably hit the inventor's brand, the inventor will hope, and even guide the user in the way inventors want to use the language. This will affect the style of different languages, the use of style, learning style, there will be some so-called language disputes.

In fact, each language will be fully developed way: including high-level, that is, encapsulation good, you only need to focus on business logic code, write business logic code can be, but also include the underlying, that is, the original development method, you need to write the business logic code while specifying some technical parameters, some of the underlying parameters need you to set.

Some languages will lead you to enter from the top, and then you can choose to use the underlying method when you need it. Some languages will direct you directly to the bottom, and then provide you with a high-level approach.

Take it. NET and Java Web development for example.

. NET can use ASP.net to do web development, he has a way called WebForm, that is, you can directly drag the control to the Web page, and then double-click the control, write code behind the back, such as the registration button behind the registration of the business logic to write some. Just as you are developing WinForm desktop applications, people who have written VB will understand. In this development, you can do nothing about HTTP, and make Web applications, regardless of HTTP knowledge. Even if you are looking at some of Microsoft's WebForm video tutorials, he didn't take the initiative to introduce you to HTTP knowledge. So it might give some people the impression that I'm developing the web without having to manage HTTP. It was not until a long time, even a few years later, that the knowledge of HTTP was needed to better develop Web applications. Of course, you can also use WebForm to set some of the HTTP parameters, but it is usually not used in this way.

But ASP.net also has the underlying approach. It provides a IHttpHandler interface that you can implement to handle an HTTP request without even distinguishing between a get or post, but a request, a specific control, and an HTTP parameter setting, which is entirely for you to implement. It also has a IHttpModule interface that implements this interface, and you can control and customize the process of the request. For example, the content of the request to do some additional processing, permission control, request filtering and so on things.

<summary> 
   ///Summary description for addcontact 
   ///</summary> public 
   class Addcontact: IHttpHandler 
   {public 
     
       void ProcessRequest (HttpContext context) 
       {context 
           . Response.ContentType = "Text/plain"; 
           Context. Response.Write ("Hello World"); 
       } 
     
       public bool IsReusable 
       { 
           get
           {return 
               false; 
   }}}

Java is providing you with a base class HttpServlet that inherits this base class, has two methods Doget and Dopost, can accept get and post requests. If you're developing web Apps from Java, you'll need to know about HTTP GET and post, and some of the details of HTTP, because you need to understand and set it up when you're developing it to get results.

Java will also have some web development framework, in order to facilitate your development, but also to you to hide some implementation details, let you focus on business development.

Asp. NET also has an MVC framework that is implemented by extending ASP.net IHttpHandler and IHttpModule.

Speaking of which, I believe some of the readers have already understood and understood what I want to say.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.