How to make "echo" (php) but in jsp?
The page directive is used to provide instructions to the container that pertain to the current JSP page. You may code the page directives anywhere in your JSP page. By convention, page directives are coded at the top of the JSP page. Following is the basic syntax of page directive − <%@ page attribute = "value" %>
JSP (JavaServer Pages) is server side technology to create dynamic java web application. JSP can be thought as an extension to servlet technology because it provides features to easily create user views. JSP Page consists of HTML code and provide option to include java code for dynamic content.
JSPs are Internally Compiled into Java Servlets Servlet can be viewed as "HTML inside Java", which is better for implementing business logic - as it is Java dominant. JSP, on the other hand, is "Java inside HTML", which is superior for creating presentation - as it is HTML dominant.
You can do like this:
out.print("whatever you want to echo");
also:
<c:out value="${variableName}" />
where variableNmae
would the value you want to output.
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With