I suspect that it would be possible to use something like Jaxen[1] to
provide an XPath API here if we have a good JSP parser. I think that is
the approach that PMD takes for parsing Java.
Although if we can convert them to .java code that would be even better.
It would be nice not to have separate analysis paths for them.
[1]
The APIs for the Eclipse library have a DOM parser that basically
extends standard DOM parsing to handle <% %> from what I could tell.
Brad Davis
Senior Manager, Red Hat Consulting
Email: bdavis(a)redhat.com | c: 980.226.7865 |
http://www.redhat.com
----- Original Message -----
From: "Ondrej Zizka" <ozizka(a)redhat.com>
To: windup-dev(a)lists.jboss.org
Sent: Monday, September 14, 2015 1:36:05 PM
Subject: Re: [windup-dev] JSP / JSP / Taglib Parsing & Rules
On 3.9.2015 04:45, Brad Davis wrote:
> One of my projects leverages Richfaces 3 and we need to move to 4. It would be very
helpful to expand upon the (basic) JSP rules that we had in Windup 0.7 with actual JSP
parsing in Windup 2.4. Because we leverage Eclipse for AST with Java, I wonder if we can
do the same thing for JSF / JSP? Maybe we can reach out to one of the project leads in
the Eclipse community to get their recommendation on which project would provide similar
functionality for those technologies. I think Nick Sandonato from the Eclipse WTP team
may be a good starting point.
>
> There is a migration guide at:
https://developer.jboss.org/wiki/RichFaces33-4xMigrationGuideUnleashed
>
> I guess we could use old-fashioned XPath and probably get a lot of the way,
Probably not XPath, because JSP can be anything, like, <%if(fish){%>
<°)))>< <%}%>
Once I parsed JSP by looking at it as java file, and placing "out.print(
... )" instead of the content between %> and <% . Plus special handling
for the <%@. Didn't cover 100 % but worked for my case.
Now I would probably use the Tomcat's JSP to servlet source processor
and parse that. WDYT? It would loose the context though.
> but I think in Windup 1 this fell down around <% %> / embedded code.
Thoughts?
>
> Brad Davis
> Senior Manager, Red Hat Consulting
> Email: bdavis(a)redhat.com | c: 980.226.7865 |
http://www.redhat.com
>
>
> _______________________________________________
> windup-dev mailing list
> windup-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/windup-dev
_______________________________________________
windup-dev mailing list
windup-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/windup-dev
_______________________________________________
windup-dev mailing list
windup-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/windup-dev