【高编 死记硬背】 北邮 高级网络程序编程 考试概念题 死记硬背就对了

死记硬背

高概率

TWO main differences between a process and a thread

  • a process is isolated, has its own independent memory and it is associated with a single application
  • All thread exist within one process and share the same memory

Why we need to close the stream

  • Stream is an expensive resource
  • These resources are limited and may prevent more connections
  • Must close a stream before open it again
  • This could be a stream over the internet, which is expensive to maintain

What is a deadlock, how two threads might become deadlocked

  • Two or more threads are waiting for two or more locks to be freed, and circumstance in the program is such that the locks wil never be freed.

TWO methods that can be used to check the statues of an interrupt flag

  1. public boolean isInterrupted()
  2. public static boolean interrupted()

What is a cookie? Provide reason why you would use cookies in web programming

  • cookie is a mediator that allow user to store information between browser sessions.
  • The reason is that we need data delievry between pages.

Difference between the doGet and doPost()

  • doGet is for response pf THE HTTP REQUEST with the GET method and doPost…
  • The GET Method incorporates the query string in the requested url; idempotent (multiple request affects same as one)
  • The POST Method places the query string in the body of the http request; not idempotent

Explain the difference between the following HTTP status codes: 300, and 404.

  • 300: Multiple Choice, the requested source includes serveral locations.
  • 404: Not Found Server cannot find the resource according to the client request.

Disadvantage of using HTTPs

  • add extra overhead
  • increase connection time

purpose of using JSP directives in general

  • is a statement that gives information to the JSP engine, about the JSP page it is define in

purpose of JSP directive in partitcular

  • can appear anywhere in the JSP file
  • it allows you to provide information and control the structure for the page
  • e.g. for inporting classes and setting up the content type

MVC

Briefly describe the role of JavaBeans in an MVC software architecture. Must also state the main principle of using MVC architecture

  • Principle: In an MVC architecture, there is a separation between the control and the presentation.
  • JavaBeans: The role of JavaBeans is to model the web application’s data, and to privice a means for and data calculations to be performed and recorded

MVC step

  1. The servlet handles the user’s request.
  2. The servlet instantiates the appropriate JavaBean based on the request.
  3. The JavaBean communicates with the middle tier or directly to the database, to retrieve
    the required data.
  4. The servlet sets the JavaBean in one of the following contexts: request,
    session or application.
  5. The servlet dispatches the request to the next JSP, based on the request
    URL.
  6. The JSP uses the JavaBean in step 4. above, to display data.

Briefly describe what is meant by the Model View Controller software architecture, when developing a web application

  • In an MVC architecture, there is a separation between the control and the presentation (总)
  • the control side of things is usually performed by a servlet (Servlet)
  • calculations are carried out through the use of JavaBean (JavaBean)
  • presentation of the output is done by JSPs (JSPs)

低概率

Socket

  1. The server instantiates a ServerSocket object, denoting which port number
    communication is to occur on.
  2. The server invokes the accept() method of the ServerSocket class.
  3. This method waits until a client connects to the server.
  4. While the server is waiting, a client instantiates a Socket object,
    specifying the server name and the port number to connect to.
  5. The constructor of the Socket class attempts to connect the client to the specified
    server and the port number. If communication is established, the client
    now has a Socket object capable of communicating with the server.
  6. On the server side, the accept() method returns a reference to a new socket on the
    client that is connected to the client socket.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

这不是Ourz的ID

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值