JSP page to get the parameters in the servlet request
•
Java
In Java Web application, how to obtain the parameters in the servlet request and pass them to the jump JSP page? For example, visit http://localhost:8088/bbs?id=1
When the BBS servlet is executed, the value of the URL parameter ID is passed to BBS JSP page?
1. First configure the web XML, see the following configuration:
2. Write servlet class:
Create BBS in the application root directory JSP file, the content is:
Note that many people pass the parameter unsuccessfully because they call doPost in the doGet method, and the doGet method does not call doPost..
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码