when this jsp is accessed first time, it will run JspInit() thus incrementing x by 1.Then, <%= x++ %> would increment x by 1. By now x=2. Now if you access the same instance 2nd time, JspInit() wouldnot be called. just <%= x++ %> would increment x by 1. So the final value of x will be 3.