Pass-through of JSP for beginners

Source: Internet
Author: User

When I was a beginner in JSP, I was dizzy with the value transfer problem. After I checked some information, I finally got quite open. It turned out to be so simple.

To sum up, in. JSP click to open a new window B. JSP, and pass the value of a text box in A to B. The passing of this value should be the most basic. If you add B. the processing result in JSP is returned to. JSP, what about it? Alas,Simple. Currently, only three methods are available:

1.

Function check () {
var id = f1.userid. value;
window. open ("checkuserid. JSP? Userid = "+ id);
}< br> checkuserid. value in JSP:
<% string userid = request. getparameter ("userid"); %>

Ii. <a href = "javascript:;" onclick = "javascript: window. Open ('checkuserid. jsp? Userid = '+ f1.userid. Value) "> check the user name </a>

Iii. <input name = "button" type = "button" onclick = "javascript: window. Open ('checkuserid. jsp? Userid = '+ document. getelementbyid ('userid'). Value) "value =" whether the user exists "style =" background-color: # ffcccc; color: #339966 "/>

In fact, all of them are similar. The third one makes me depressed and I always don't know the format.

Related Article

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.