Hi,
I have been working with JASPER compiler shipped
with Tomcat Server. I have the following requirements.
1)Before deploying a web application, I want to read
each and every JSP page in a web application and
insert a method call (let's say a
System.out.println()) before each of the line.
2)I will be then saving the modified JSP file.
3)This application will then be deployed on the
server, which will result in printing a line on the
console as each of the line will be excuted.
4)Please note I am interested only in scriptlet part
(<% %> and <%! %>) of the JSP.
5)I am trying to use JASPER for that purpose.
6)I want to parse the JSP page using some JAPSER class
(Parser looked a possible candidate, but its not
public, any reason why?). Is there any other option
available?
7)Assuming that I am able to parse the JSP page (maybe
I will make the class public) and get Nodes in the
page, I will detect the type of node from the parsed
nodes and will modify only the Scriptlet nodes (will
insert System.out.println() before each line).
8)I will then dump this tree (I hope I will get a tree
after parsing similar to a DOM tree) as a .jsp file.
9)I could see implementation of Visitor pattern in the
code, any reason why its not exposed as in BCEL?
Do you see any problems with this approach? Is there
any example available for the parsing I am trying to
do?
Thanks,
Nikhil Khedkar
__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]