Passing parameter without use of HTML forms in JSP

后端 未结 3 1116
粉色の甜心
粉色の甜心 2020-12-30 11:06

I have done some research, and majority of the examples I have found use forms (obviously for user input) to collect data which is then passed to another JSP page through th

3条回答
  •  星月不相逢
    2020-12-30 11:44

    There are a few ways to pass information from one JSP page to another.

    1. Hidden values.

    Simply write the data to an input field within a form with the type 'hidden', e.g.

    
    

    Data written thus will get posted back when the relevant form is submitted. This can be a useful way to 'carry along' information as the user fills out a series of dialogs as all state is user side and the back and forward buttons will work as expected.

    2. URL writing.

    Attach parameters to URLs in links on the page, e.g.

    
                                                            
提交回复
热议问题