Why did the programming point, life is a hundred thousand why

 

Introduction: Some time ago wrote a lot of Servlet and JSP-related blog, almost self-understood that, not even outside Appreciating someone outside, there is day, as well as the source code is, by the expert coaching, looked Servlet source code, very well and could not say understand, do not understand the essence of life, you will never live in a dream. Of course, that represent personal experience, if you have big brother passing, forgive us, a rookie still on the road.

 

 

learn from mistakes

So why the big brother Niubi, not why, because they ask why the some than others. He looked like a tongue twister feel the same, in fact, such is life, see the world through nature, in fact. . . . . . . . . Also the case.

 

Today, by the teacher coaching, understand some of the knowledge and the truth of life, unfortunately niche ignorant, but understand some fur, but fur if nobody coaching, how can I learn programming, why a career, then again, "read a not as good as ten thousand books, from thousands Beacon is better to have an expert, an expert guiding needs to own epiphany, "positioning to prepare themselves, through the day, I believe that life is really good in progress.

 

Into the program, and see why

During this time learned Servlet and JSP, did the application layer, but did not do in-depth research, receiving the request and response processing for the Servlet, forwarding and redirection that use of Servlet ServletContext domain objects, as well as pages done some cases and later learn JSP, JSP learn various grammatical statement, label is introduced, scripting syntax, built-in objects, combined JSP + JavaBean model and JSP + Servlet + JavaBean (MVC) pattern done some cases applications. Although it will use the knowledge of these points, but I think we should change if the thinking, should first put forward why, after inquiry and problem solving with the problem.

 

For example:

Why JSP is Servlet?

Why JSP has built-in objects, not instantiate be able to use?

Why in <%!%> Write a statement in <%%> write logic code snippet, the <% =%> write expression?

Why use EL expressions and JSTL?

Why do people use JSP less and less?

why. . . . . . . . . . . . ?

 

 

Thinking determines height

Let me talk about why JSP is Servlet, do not explain, look at the source code to know. Case before doing a lot of cases are used in IDEA, this time with Myeclipse presentation, of course, there is a reason to change tools, source code for easy viewing.

 

First, find your tomcat installation package, find your Web project in the installation package in the work folder, and then find the source file as shown below.

 

 

On the Web project index.jsp I wrote the code shown below, observe the location of these scripts statements in class

 

 

 

 

 

 

 

 

 

I describe here, then you see the corresponding map

First look at the statement

 

 

Position statement appear in the class body, which is a member variable has a default value, so the assignment can not be directly output.

 

Look at the code fragments and output expression

 

 

Fragment In one method body, so <%> Representative methods thereof, and <% = i%> corresponds out.print (i) ;, I would correspond to that, it should be something Naikanmengbai, and those built-in objects, are encapsulated in the class, so when you use them in the JSP can be used directly do not have to instantiate the object. So, JSP Servlet class is, if you understand the principles, corresponds to class, learn it would not be so difficult (at least I think so).

 

 

Understand these look, JSP write those snippets of time, I am not feeling a lot of trouble, yes, indeed a lot of trouble, this time there was a thing called JSTL, which simplifies the writing JSP fragments in Java, with some of the tags will be able to achieve some complex functions, but this thing is someone else's package, although you will use, but in the end someone else, if you feel not satisfied, you can also customize the label, a tag library own package, in JSP rapid development, JSP is the fire time before many companies have their own tag libraries, right, time is the fire, now JSP Why not fire it? According to my understanding, should now have a variety of ports, Andrews terminal, mobile terminal, etc., with many before and after the end of the separation development, parsing the JSP too limited, unlike JSON, can resolve any port. . . . . . . . . . . Go beyond it, in which only heard, not their own nonsense, afraid to mislead people, and if there are big brother passing, seeking advice.

 

 

End

Cipian let you start with the class point of view of understanding of JSP, JSP for more understanding, I will talk next JSTL and custom labels. For how to articles, see the next time to explain.

 

 

*****************************************************************************************************

我的博客园地址:https://www.cnblogs.com/zyx110/

转载请说明出处

我不能保证我所说的都是对的,但我能保证每一篇都是用心去写的,我始终认同“分享的越多,你的价值增值越大”,欢迎大家关注我的技术分享“Java匹马行天下”和学习心得分享“匹马行天下”,在分享中进步,越努力越幸运,期待我们都有美好的明天!

支持我的朋友们记得点波推荐哦,您的肯定就是我进步的动力。

 

Guess you like

Origin www.cnblogs.com/zyx110/p/11260219.html