what is the meaning of ?(question mark) in url string?

后端 未结 4 1833
别跟我提以往
别跟我提以往 2020-11-27 16:42

can someone explain what is the difference between using
href=\"../usermanagement/search_user.jsp?\" and
href=\"../usermanagement/search_use

相关标签:
4条回答
  • 2020-11-27 17:02

    It is a query to pass paramters. ?pagename=navigation passes the value 'navigation' to the pagename parameter.

    0 讨论(0)
  • 2020-11-27 17:13

    Whenever we want to pass some parameter to jsp then we simply append "?" question mark after jsp url and after that we mentioned parameter name and its value.

    "../usermanagement/search_user.jsp?" means you did not get any parameter on this jsp.

    "../usermanagement/search_user.jsp?pagename=navigation" with this url you can get the value of pagename parameter on jsp as by using this syntax:

    String pagenNameValue=request.getParameter("pagename");
    

    you will get "navigation" as pageNameValue parameter value.

    0 讨论(0)
  • 2020-11-27 17:15

    The href="../usermanagement/search_user.jsp?pagename=navigation" is a GET Method and will pass a key : pagename with value : navigation via URL.

    Whereas href="../usermanagement/search_user.jsp? is a POST method and doesn't pass information about its variables via URL.

    check out Difference between GET and POST method

    0 讨论(0)
  • 2020-11-27 17:19

    Its name is Query string. After the question mark you can pass key-value pairs and use them server-side.

    https://en.wikipedia.org/wiki/Query_string

    0 讨论(0)
提交回复
热议问题