Some coding basics of Java

Source: Internet
Author: User

All base types of non-byte types can be converted to strings through the string.valueof () method

Comparison of non-basic types requires the use of the Equals method

Get parameter values for form submission

1:string name = Request.getparameter (' name ');

Gets the array value of the form submission

1:string[] NameList = request.getparametervalues (' listname ');

Passing parameters to a page

1:request.setattribute (' var ', value);

Session action

1: session.setAttribute('var',value);
2: session.getAttribute('var');
3: session.removeAttribute('var');

Split a string into arrays

1:string[] col= mystr.split (', ');

To determine the length of an array

1:mylist.length;

Converts a string to an integral type

1:integer.parseint (STR);

Output passing values in a JSP page

1: <bean:write name='Obj' property='Id' /> //对象的某个属性
2: <bean:write name='name' />

Map Action Method

1: Map condition= new HashMap();
2: condition.put('name', value);
3: condition.get('name');

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.