We use Struts2 with Tiles to generate the screens, so no servlets (or not
direct access to servlets).

The purpose of this change is to able to debug errors in the client
side(browser). We have about 300 JSPs, and some quite complex javascript
and HTML code. We have setup a debug system, so every javascript error in
the browser is catched, and the error information is sent to the server.
Part of that information is where the error was thrown. In order to be able
to automatize that with all browsers (Not all of them generate stack trace
when creating a javascript exception) we have setup a process where a token
in the JSP is replace with the JSP name and line number. Every time a
exception is catched, the token (more correctly, the JSP name + line number
used to replace the token) is sent to the server with the exception
information.

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) <[email protected]
>:

> 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 <[email protected]> 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
> >
> > 2015-03-03 13:33 GMT-05:00 mck <[email protected]>:
> >
> >> Compiling jsps on the fly is going to kill your performance.
> >>
> >> Redesign the content instead to be dynamic or use a scripting language
> >> like velocity that doesn't need compiling for the particular template in
> >> question.
> >>
> >> ~mck
> >>
>

Reply via email to