braswell has asked for the wisdom of the Perl Monks concerning the following question:

I am a Perl biggot. It's the only language I really use currently and I love it. At work I am doing a lot of things involving system monitoring using Perl programs. These programs extract information and produce XML documents which are then used to populate various MySQL tables. These tables are then presented as reports from a web portal using mainly cgi scripts written in Perl.

Some of the things I am doing involve presenting Web UIs for updating additional MySQL tables. Doing this with cgi type scripts tends to seem harder than it should be. I have prototyped various things using HTML::Mason and I like what I see (i.e. templating, ease of wrapping authentication/authorization around views, embedding perl, etc). I have some colleagues that are kicking off a similar portal project using the Apache Jakarta Struts framework.

My questions are: Should I consider using Struts for my presentation layer instead? Am I going to be disappointed? Anyone have experiece doing both? I don't mind learning Java so that's not an issue. I can still use Perl to gather monitoring data (i.e. to populate my domain model) so that's not going to be an issue either. It's not really an issue of Java vs. Perl but which is better for writing a portal (presentation layer), Struts (or another framework) or HTML::Mason.

Thanks for reading.
  • Comment on Java Web Frameworks (e.g. Jakarta Struts) vs. Perl's HTML::Mason

Replies are listed 'Best First'.
Re: Java Web Frameworks (e.g. Jakarta Struts) vs. Perl's HTML::Mason
by pg (Canon) on Jan 06, 2004 at 05:18 UTC

    I never used HTML::Mason, so cannot compare it with other tools. However my current project uses Jakarta Struts + WebLogic + Oracle.

    Therotically I like the struts framework, and it is basically based on Java Servlet. The framework is very neat. But we are currently experiencing some problems.

    The effort required is bigger than expected (but did we have the right expectation?). My company had one completed project in Struts, and it was quite successful, however all the pages in the application were very simple, according to a person who is on this project and was on that one. Maybe Struts has a problem with complex web pages (in terms of GUI). But I cannot say this for sure, as most of the people on this project, including myself are new to the Struts framework, so it could be a learning curve thing.

    Under the Struts framework, each action is a class, which I see it as the right thing to do, but that obviously increases the effort.

    I think the Struts tag library might be part of the problem. I would expect its tag library provides a rich (what is rich?) set of tags for rendering complex (what does complex mean?) web pages, but seems not.

    Some other people in my company had a very positive review on code fusion, and they really likes it (especially the tag library), maybe you can take that as a candidate. Those people are doing a real project with CodeFusion now, so their comments are first-hand. But code fusion costs money, and some company probably does not like it, when there are free stuffs available. (Actually my company does not like it, and that's why we don't have many licenses for CodeFusion)

    When you evaluate your tools or frameworks, definitely look at the "tag library" very very closely.

Re: Java Web Frameworks (e.g. Jakarta Struts) vs. Perl's HTML::Mason
by exussum0 (Vicar) on Jan 06, 2004 at 04:15 UTC
    I suggest you try it out for you and your company. No, I'm not saying java > perl or struts > mason. Every tool has its uses. It doesn't mean every tool should be used.

    I'm a huge MVC biggot... and struts and mason both allow for this on some level. BUT there's a big issue. In both, you can embed code within your templates (jsp, mason's internal language). I'm a big fan of stxx which runs on struts. You send XML packets back from your servlets to the configuration engine and the engine is configured either to send XSLT back with the XML or apply the XSLT to the XML on the server side. So I hate struts AND mason. But opinions are like.. uh.. potatoes. Everyone has one.

    I can't use stxx at work right now since I'm the only one who knows java in my tiny development group. The other guy is a perl/php head. I've setup a bunch of MVC-like tools and examples, and we have a standard of doing the same things. It's what's feasible.

    So you see, it's not a matter what is better. You can measure the amount of instructions wasted, which would be marginal between the two systems, but it won't matter, 'cause they are both damned fast. It's like buying a car. You don't buy an expensive sports car 'cause it's fast, you can't fit in it nor aford to garage it, eh? Well, don't use a system that would be infeasible to use techically or socially. Doesn't mean you can't try it out though. :)


    Play that funky music white boy..
      ... mason's internal language...

      For what it's worth, note that Mason's internal language is basically just vanilla Perl. (This distinguishes it from the "tiny languages" templating systems, and is one of the reasons I like Mason so much.)

Re: Java Web Frameworks (e.g. Jakarta Struts) vs. Perl's HTML::Mason
by valdez (Monsignor) on Jan 06, 2004 at 10:00 UTC
Re: Java Web Frameworks (e.g. Jakarta Struts) vs. Perl's HTML::Mason
by smishra (Novice) on Jan 07, 2004 at 01:50 UTC
    I have not much experience with Java struts. However I have built a few large sites with Mason and it rocks!!!! The word on the street is that Amazon runs on Mason. Need we say more.