The difference between HTML and JSP pages

Source: Internet
Author: User

HTML (hypertext Markup Language) Text Markup Language, it is a static page, and JavaScript as the explanatory language, why is it interpreted language? Because, as long as you have a browser then it can be displayed normally, without the need for the specified compilation tool, just write the HTML tag in the TXT document OK.
JSP (Java Server page) to see this meaning is the Java service side of the page, so it is dynamic, it needs to be compiled after the JDK to send the content to the client to display, we all know that the Java file compiled will produce a class file, The final implementation is the class file, JSP is the same, it will be compiled into a class file! JSP not only to compile, it has to be translated, first the JSP translated into a servlet file, and then compiled into a class file. When the user accesses the JSP, it executes the class file and finally ...

1. The simplest difference is that HTML can be opened directly, JSP can only be published to Tomact and other servers to open.
2. The definition on the HTML page is a static page can be run directly, the JSP page is a dynamic page which needs to be converted into a servlet when it runs.
3. Their header is different, this is the head of the JSP "<%@ page language=" java "import=" java.util.* "pageencoding=" GBK "%>" in the table header has encoded format and poured into the package and so on.
4. It is also very good to distinguish between the use of <%%> in JSP can write Java code, and HTML does not have <%%>.



Under what circumstances is Ajax inferior to jsp,php:
Ajax is not as dynamic as jsp.php.asp in the real time of returning queries.

Asp\jsp\php is a dynamic language that can interact with the server to query data.

Html
Just static language, so-called static refers to the server can not interact with, query data and so on.

However, any dynamic language can not be separated from HTML and exist on a single site, because there is no static page display, can not return data to the user.
As we now see the page is all static pages, are composed of HTML.

You can think of HTML as the interface, asp\jsp\php and so on as the background code.

Ajax display is really better than JSP, because it is not a refresh technology, can not refresh, jump Web page can query, return data, but I said before, real-time is not very good control.

I answered a bit of a mess, but for each of your questions generally also said, if you are not too familiar with HTML, JSP, it is recommended not to look at Ajax, because do not understand the basis to learn, is difficult.

If you have any further questions, please leave me a message.

---------------------------------------
Lee_blue, did I say something wrong? It's just not like you quoted too many specialized terms, "Ajax is an asynchronous refresh technique", the first sentence that every AJAX-learning person knows. Believe LZ if is the system of learning will certainly understand this sentence meaning, but LZ obviously did not learn, All will ask questions like this. Do you think it's useful to answer so classics? It's better than a real metaphor.

Ajax and JSP no comparability, this sentence, I completely agree, but LZ so asked, I believe you should also understand what he means.

In fact, the LZ should ask the use of Ajax and do not use the difference between Ajax

------------------------------------------------------
LZ, my answer you look carefully:

Ajax display is really better than JSP, because it is not a refresh technology, can not refresh, jump Web page can query, return data, but I said before, real-time is not very good control.

Non-Ajax is for example, say: A page is a registration information page, the user after writing, you can click "Register" after the submission to the B page (in the B page to detect whether the user name is registered), this resulted in a refresh page operation.

And Ajax can be in a page directly without refreshing the page can detect whether the user name is registered (LZ can look at the current major sites of the user registration most of the use of Ajax technology detection).
However, this is important, after the Ajax detection page, the time to submit to the page may be registered with the user name you are registering, so you also have to check the B page again.
There's one more. However, for example, when the server is too slow (although this is not a lot), it may not be possible for a long time to return information that detects whether the user has been injected.
These two are the real-time problems I mean. Ajax is not going to make these two points.

I'm not talking about Ajax technology, of course, and I'm working on the website.

-----------------------------------------------
>>>> can you tell me what the situation is not suitable for Ajax
-----------------------------------------------
LZ, this question is not a good answer.
Let me give you an example.
Ajax you can when he is you are browsing the web and listening to the song,
Instead of Ajax you can only read the page and listen to the song, not at the same time.
When two things don't have a clear sequencing, you can use AJAX techniques, and this is handy for users.
But when two things have order, such as the user to register first, the latter can log in, then you can not use Ajax at the same time, because it is prone to error.

The difference between HTML and JSP pages

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.