JSP ${param. ID} usage


Its value range is page, request, session and application.
${param. ID} is input related, relative to request. Getparameter (“Id”). It means to get the input parameter ID.
When a.jsp is submitted to b.jsp, the ID does not belong to any range of page, request, session and application, so it cannot be obtained.
ID is a parameter passed from a.jsp to b.jsp, so ${param. ID} gets the value.
The scope of request refers to that one JSP page sends a request to another JSP page.
In a.jsp <% request. SetAttribute (“key”, “test”)% >
When a.jsp turns to b.jsp, b.jsp can get the value of the variable key of a.jsp, while other JSP pages cannot get the value.
The key to this is that a.jsp should turn to b.jsp. Adding < jsp: forward page = “b.jsp” / > to a.jsp means to turn to b.jsp. Otherwise, b.jsp cannot get the value of the key set by a.jsp.