Get Request Parameter in JSP page (original) (raw)

With this example we are going to demonstrate how to get Request Parameters in a JSP page. JavaServer Pages (JSP) is a server-side programming technology that enables the creation of dynamic, platform-independent method for building Web-based applications. JSP have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. In short, to get Request Parameters in a JSP page you should:

Let’s take a look at the code snippet that follows:

GetRequestParameter.jsp

Java Code Geeks Snippets - Get Request Parameter in JSP Page
Parameter myparam: <%= request.getParameter("myparam") %>

URL:

http://localhost:8080/jcgsnippets/GetRequestParameter.jsp?myparam=myvalue

Output:

Parameter myparam: myvalue

This was an example of how to get Request Parameters in a JSP page.

Photo of Ilias Tsagklis

Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.

Back to top button