• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When are scriplets executed?

 
Ian Whitelaw
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another problem with my JSP/bean (shown below). My understanding of jsp scriplets (as opposed to declarations and expressions) is that they are executed when the user submits a request, but not when the JSP is first loaded.
If so, why does the processRequest() method on my bean seem to be executed when the page first comes up?
The JSP:

The bean:
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same question some time ago and I found out that the scriptlets are always executed when the JSP is.
The first time, you may want to check for nulls depending on the application. My observation is that they always get executed when the page is processed. And that you may want a different result the times after the first
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic