JSP are not supposed to change at runtime, but it is true that some application servers will monitor the changes in JSP in "development mode", and recompile them.
However I would advise to use 2 files: "xyz.jsp.template" would be modified by the developer, and "xyz.jsp" would be generated by your tool and used by the application. That would avoid the risk of concurrent modification. Then I don't think Tiles is the right tool for that. I would just use a javax.servlet.Filter mapped on *.jsp for that, it would be more focused on your specific concern. The filter could check if xyz.jsp.template is more recent than xyz.jsp and act as necessary. Hope this helps, Nick. On 15-03-03 03:54 PM, JOSE L MARTINEZ-AVIAL wrote: > In production we can do it before the deployment, as the JSP don't change > in production. But in development it usual for us to modify the deployed > JSP on the server, and therefore the line numbers already created are not > right. That's why we want to be able to do it on the fly. > > JL > > 2015-03-03 15:42 GMT-05:00 BR Brett Ryan (3456) <brett.r...@johnsands.com.au >> >: >> > Why? Maybe JSP isn't your answer and instead write out the stream >> > separately directly from your servlet. >> > >> > Sent from my iPhone >> > >>> > > On 4 Mar 2015, at 05:44, JOSE L MARTINEZ-AVIAL <jlm...@gmail.com> wrote: >>> > > >>> > > Hello mck, >>> > > I'm not going to compile the JSP on the fly on every request, just when >>> > > they change. Basically we have a token in the JSP that we want to >>> > > replace >>> > > with the line number where the token is. Every time the JSP is >>> > > requested, >>> > > we will check if the JSP file has been updated since the last time it >>> > > was >>> > > requested, and if so, change the token in the JSP and call the >>> > > requestdispatcher as usual, so it can process it. >>> > > >>> > > JL