How to print variables in JSP?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Jan 09, 2020

 

JSP uses the Java programming language. So, most of the statements in JSP follows the Java code. To print a variable in JSP,

<%   
String name=request.getParameter("Pname"); //initializing the variable name with  Pname value.  
out.print("welcome "+name); //statement to print the variable in JSP 
%>

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JSP Interview Questions

    Explain What is JSP?

    JSP, expanded as Java Server Pages is a Java-based technology to create dynamic web pages. Released in 1999 by Sun Microsystems, JSP is based on technologies such as HTML, SOAP, XML, etc...

    JSP Interview Questions

    What is the el in JSP?

    The EL (Expression Language) in the JSP is used to access the data stored in the JavaBeans along with implicit objects like requests, sessions, etc...