1

Case 1

    <% 
    request.getParameter("");
    %>
   Enter code here

Case 2 jsp

  Scriptlet tag begin
     <jsp:scriptlet>
        request.getParameter("");
     </jsp:scriptlet>
   Scriplet tag close

Is there any difference between the two? Are the two, the same thing. Is anyone preferred over the other? According to jsp2.0 scriptlets should be avoided. Do they talk about both these two?

vjy
  • 1,184
  • 1
  • 10
  • 24
Gaurav Arya
  • 71
  • 1
  • 1
  • 4
  • Take a look at this one, might help: http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files?rq=1 – Menno Jun 06 '13 at 06:30
  • This one may also help: http://stackoverflow.com/questions/2188706/how-to-avoid-using-scriptlets-in-my-jsp-page – Menno Jun 06 '13 at 06:30
  • no, it didnot help at all, before posting I went through both of these. They advocate the use of el and jstl tags which I already have started as a learning. My confusion is about jsp tags specifically scriptlet declaration and expression tag. like vs <% %> <%! %> <%= %> – Gaurav Arya Jun 06 '13 at 06:44

1 Answers1

0

No difference between them except the syntax.Avoiding scriptlet means you need to avoid both of them

PSR
  • 39,804
  • 41
  • 111
  • 151