Atitit.web dynamic include and variable pass java. NET PHP

Source: Internet
Author: User

Atitit.web dynamic include and variable pass java. net PHP

1. Dynamic include <jsp:include 1

2. Using QueryString 1

3. Use the Session variable 1

4. Use Server.Transfer//request.getrequestdispatcher (tmpltpage). forward (Request, response); 2

5. Cookies, this HTML can be passed between the two ... 2

6. Reference 2

1. Dynamicinclude<Jsp:include

Use to implement components separated from the implementation of a template ... . Implement IOC,,, Delay Binding

<Jsp:include page="<%=Request.getparameter ("TMPLT")%>"  Flush="true" />

Jsp:include the absolute path is applied Maguan , automatically suitable ... Sub-application Ya 10 root number start ..

2.UseQueryString 


Use querysting passing values between pages is a very old mechanism, and the main advantage of this approach is that it is very simple to implement, but its disadvantage is the value passed Yes will show on the address bar of the browser (unsafe), but not the object, but in many of the values passed and the security requirements are not high, this method is more preferred to use.

Author:: Old Wow's paw attilax Ayron, email:[email protected]

Reprint please indicate source: Http://blog.csdn.net/attilax

3.UseSessionvariables 


using session variables is another way to pass values between pages, in this case we have the values in the control in the Session variable, Then use it on another page,

4.UseServer.Transfer    //Request.Getrequestdispatcher(Tmpltpage).forward(Request, Response);


This method is slightly more complex than the one described above, but is particularly useful in variable transfer between pages, and you can use this method to access The object properties in another page. revealed by value and, of course, using this method, you need to write some extra code to Create some Properties so that it can be accessed on another page, but the benefits of this approach are also obvious. In general, using this approach is concise and object-oriented . The whole process of using this method is as follows

String tmpltpage="/com.attilax/dsm/tmplt_edit.jsp";

Try  {

Request . Getrequestdispatcher (tmpltpage) . forward (request, response) ;

5. Cookies,this canHTMLpassed between the two....

6. Reference

passing variables between two asp .- Weinideai 's Column - Blog channel -CSDN.NET.htm

Atitit.web dynamic include and variable pass java. NET PHP

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.