You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@yahoo.com> on 2008/02/29 20:07:17 UTC
[OT] Re: Dead code parser/finder for Struts
--- Adam Gordon <ad...@readytalk.com> wrote:
> Does anyone know if there's a server side library that can parse JSP
> pages (or the generated Java file) and look for dead Struts code?
Any of the typical code walkers should be able to deal with the generated
JSP, but it probably wouldn't be capable of identifying situations where
something was put into scope and referenced by name later.
I don't know of any JSP-source walkers with this capability. That said, it
shouldn't be *that* hard (depending on how well-formed the JSP/HTML is,
perhaps?) to write an ad-hoc tool that tracks whatever types of tag usages
you're concerned about and later references (or lack thereof) to the same.
HTHBIPD,
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [OT] Re: Dead code parser/finder for Struts
Posted by Dave Newton <ne...@yahoo.com>.
--- Adam Gordon <ad...@readytalk.com> wrote:
> Dude, it's bad.
I feel your pain.
In fact, I revel in it ;)
It's pretty hard to mechanically find problems in JSP-space, though, and I
personally don't know of any generic tools that allow it (if you do find any,
please follow up!) My approach would depend on how many files there are
(well, maybe how many lines/syntactic elements) and if it was easy to
identify the various classes of problems.
You may get the joyous task of walking them by hand (perhaps writing
client-side tests as you go via Selenium, Watir, ec.) if the original
developers didn't provide any to help verify requirements compliance.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [OT] Re: Dead code parser/finder for Struts
Posted by Adam Gordon <ad...@readytalk.com>.
Dave-
Dude, it's bad. They had a team of developers each with varying degrees
of experience which ranged from no knowledge of Struts/EL (those
developers used.....scriptlets.....*shudder*....) while others used
Struts/JSTL tags for almost everything when EL tags would not only have
sufficed but made the code cleaner and easier to read. I recognize that
there's some duplicity across the Struts tag library and JSTL, but it's
like they found one way to do something and just ran with it, even if it
meant it wasn't appropriate to use in a given instance. It got so bad
at the end, when a bug was filed to fix a validation problem in a form,
they just removed the alert box that said there was an error and checked
it in as the fix.
I know they used MyEclipse and based on the indention (or lack thereof)
in the JSP's I suspect they were at least partially computer generated
with some type of GUI builder because there's no way someone could write
JSPs like that by hand and not go mad.
I recognize that there's some duplicity across the Struts tag library
and JSTL, but it's like they found one way to do something and just ran
with it, even if it meant it wasn't appropriate to use in a given instance.
--adam
Dave Newton wrote:
> --- Adam Gordon <ad...@readytalk.com> wrote:
>
>> Does anyone know if there's a server side library that can parse JSP
>> pages (or the generated Java file) and look for dead Struts code?
>>
>
> Any of the typical code walkers should be able to deal with the generated
> JSP, but it probably wouldn't be capable of identifying situations where
> something was put into scope and referenced by name later.
>
> I don't know of any JSP-source walkers with this capability. That said, it
> shouldn't be *that* hard (depending on how well-formed the JSP/HTML is,
> perhaps?) to write an ad-hoc tool that tracks whatever types of tag usages
> you're concerned about and later references (or lack thereof) to the same.
>
> HTHBIPD,
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [OT] Re: Dead code parser/finder for Struts
Posted by Manos Batsis <ma...@geekologue.com>.
Dave Newton wrote:
> shouldn't be *that* hard (depending on how well-formed the JSP/HTML is,
> perhaps?)
Bingo. We use the XML JSP syntax and have done similar tasks in the past
using XSLT or even SAX filters.
I've never encountered XML syntax users outside my company though.
Manos
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org