Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between getParameter()

 
naveen jayant
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i could not understand the difference between the following statement
both produce same result

<%=request.getParameter("email")%>
<%out.print(request.getParameter("email"))
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first (which is called a JSP expression) is shorthand for the second.
 
Fabian Gutierrez
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats right,

this is an expresion
<%=request.getParameter("email")%>

this is a scriplet
<%out.print(request.getParameter("email"))

basically you can use both, however the idea of JSP 2.0 is that you avoid those and instead use EL, for example:

${param.email}

regards,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I think it's worth pointing out that, in JSP 2.0 neither should be used.
They are both part of the scriptlet syntax.

In JSP 2.0 MVC architecture, JSTL (JavaServer Pages" Standard Tag Library), and EL (Expression Language) have replaced the need for scriptlets altogether.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic