The difference between Set/getattribute and Set/getparameter

Source: Internet
Author: User

The two methods have not been carefully differentiated. Have a problem before you go to study a bit, hereby summarize

A popular generalization. The difference is two points:


Request.getattribute (): Is the value of the variable set at request, with Request.setattribute ("name", "Your Own value"), to set the value;


Request.getparameter (): Extract the parameters sent over such as: this page http://community.csdn.net/Expert/topic/4633/4633804.xml?temp=.3488123
Request.getparameter ("temp") = = ". 3488123"
Request.getparameter is used to accept parameters from the Get method or the Post method


The getparameter can obtain the parameter values that the client sends to the server side.
GetAttribute can get the parameter value set by SetAttribute, which is equivalent to using getattribute to get a parameter that is defined by itself, not from the client.


Second, getparameter can only pass variables of type string, getattribute can pass vector.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The difference between Set/getattribute and Set/getparameter

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.