1.RESTful Webservice as a remote call (RPC), what is its input? What is the input? input URL, output JSON or XML
2. A Java remote function declares public Customer GetCustomer (String ID), maps the HTTP protocol input/output to the function, and at least declares (annotation) what information? Please write these annotation and simply explain the relationship between the protocol and the function.
need to declare HTTP protocol methods and project root access to the URL path of the method
@GET
@Path ("/customers/{id}/")
In fact, the function implements the function of the Protocol, and the Protocol defines the contents of the function.
3. Modify the Experiment 1 @Path @Path ("/myservice/"), please use CURL-V to give the results
4. Describe the difference between GET and POST
Get: Gets the data from the server, the get is the parameter data queue to the submission form the Action property refers to the URL, the value and the form in the field one by one corresponding to the URL can be seen The server side uses Request.QueryString to get the value of the variable, and the get transmits a small amount of data that cannot be greater than 2kb;get security is very low.
Post:post is the transfer of data to the server, post is the HTTP post mechanism, each field within the form and its content in the HTML header to the address of the URL referred to by the Action property, the user does not see this process ; The server side uses Request.Form to obtain the submitted data, the post transmits the large amount of data, the general default is unrestricted. However, in theory, the maximum amount of IIS4 in 80KB,IIS5 is 100kb;post security is higher.
5. Map<long in practical application, customer> customers use will produce side effects? Why?
The meeting. A single-instance class must be multithreaded-friendly. You must consider the instance variable (Field) thread sharing problem in the class.
6.Spring IOC and DI are one of the core contents of Java programming. Read the Spring IOC using a detailed explanation of the IoC decoupling principle in your own language.
a container is added to the project, and the container instantiates the object. provides dependency injection for a container by configuring beans in the Beans.xml file. The container automatically pushes resources for the component.
8. in the Spring experiment, read the Beans.xml and write down the key elements of the root resource
<jaxrs:server id= "CustomerService" address= "/service1" >
<jaxrs:serviceBeans>
<ref bean= "Customerbean"/>
</jaxrs:serviceBeans>
</jaxrs:server>
<bean id= "Customerbean" class= "Demo.jaxrs.server.CustomerService"/>
The fullname of WADL. Intercepts a section of WADL content from the return of the program results.
One. Output Object Format negotiation is the field decision for the Header segment of resquest?
Accept
The fullname of Jax-rs .
Java API for RESTful Services
[Email protected] and the role of @Consumes
The @Produces is used to specify the output format, which can be an array of strings. If it is an array, the first
One is the default output format
@Consumes Specifies the type of processing input media
Distributed Computing (quad)--socket communication with HTTP server (3)