Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

JSF vs ASP.net 107

DuncanE asks: "We are looking at migrating an old legacy database application to a newer web based framework for the front end. For me the two obvious choices are ASP.net vs Java Server Faces. CodeGuru has side by side look at both, but does anyone have any real world comparisons? ASP.net appears to be MS only, which is a concern, depending on how mature mod_mono has become." Which framework would you prefer to use? Under what situations and conditions would you recommend the use of the other?
This discussion has been archived. No new comments can be posted.

JSF vs ASP.net

Comments Filter:
  • by B5Fan ( 639395 ) on Friday January 13, 2006 @12:05AM (#14460906)
    As soon as Microsoft decide that Mono is good enough to make enough people think of moving away from Windows, I think they'll try to change .Net to prevent it.
    AFAIK The only issue with Mono currently is that MS-specific security doesn't work under Mono, because it relies on Windows.
    I suggest that if you want to be able to run on something other than Windows, be careful about choosing .Net. It may still turn out to be a good choice, given that there are probably more .Net developers available, provided that you've taken into account aspects like security.

    BTW The only programming I do is .Net (in New Zealand), and this is being written at home with Firefox on Linux.
  • by free space ( 13714 ) on Friday January 13, 2006 @12:15AM (#14460954)
    I think Java would be a more 'safe' choice.
    Java Server apps can run on multiple operating systems, multiple servers, and in the extreme case of Sun not supporting it anymore ( or not adding a feature you want) you've got tons of big companies pushing it, like IBM and others, in addition to open source implementations like GNU classpath. Not to mention that you can implement 100% of your solution without paying anything.

    ASP.net, on the other hand, is a Microsoft solution, and you depend on the whims of MS for everything. It runs on little more than Windows/IIS, and the only serious IDE for it would be Visual Studio.net, and good luck trying to run it under mono if you favorite class or function is incomplete or has a bug in its mono implementation ( or the MS implementation for that matter).

    I think that the Java and .net solutions are somewhat similar in the quality of their solutions, and that any marginal difference in quality, if they exist, would have no impact compared to the freedom of choice Java provides.

  • by Saeed al-Sahaf ( 665390 ) on Friday January 13, 2006 @12:17AM (#14460962) Homepage
    The provided link: If you develop web applications you have probably heard the names JavaServer Faces...

    My web apps must be crap, because I've never heard of "JavaServer Faces".

    • Re:What The Fuck? (Score:2, Insightful)

      by 0kComputer ( 872064 )
      Yeah, check out the foot note on the author

      About the Author A Senior Consultant with Sogeti LLC, Michael has spent over 7 years in IT, specializing in J2EE and Oracle analysis and development.

      wonder which platform he's rooting for? The article was a piece of shit anyways, a few screen caps of the IDE's doesn't make for a good comparison of frameworks.
    • You take a black marker and draw little faces on your java servers! dohhhhhh!
    • My web apps are crap, because I use JavaServer Faeces
    • My web apps must be crap, because I've never heard of "JavaServer Faces".

      Then you may not have been paying attention for the last few years.
      JavaServer Faces [sun.com] at Sun java/J2EE. It's been around a while.

      But not using JSF will not make your web apps crap. There's bound to be a better explanation for your web apps being crap.

  • These kinds of decisions ought to be based on what you and your colleagues are most comfortable with. Java? C#? Perl/Python? You certainly wouldn't try to run a marathon in brand new shoes!
  • Either (Score:5, Informative)

    by Artega VH ( 739847 ) on Friday January 13, 2006 @12:25AM (#14460994) Journal
    Both are a good choice if you want to properly engineer a new web-based tool. ASP.NET is probably quicker but if you want to do anything really serious you'll probably want to look at purchasing Visual Studio 2005 [microsoft.com] rather than just using the Visual Web Developer Express [microsoft.com]. Also the tool support for JSF isn't nearly as mature so it will probably take longer to implement in JSF than in ASP.NET.

    Having said that JSF is still a good choice - particularly if licensing costs and portability are an issue. Apache MyFaces [apache.org] is an excellent framework whose only downside is the poor documentation. JSF can be slower to get started with but I found that it enforces best practices more strictly and once you get the hang of all the XML wiring it wasn't that bad. Another benefit of JSF is that you'll have trouble breaking the MVC pattern but you can pretty easily embed alot of code in ASP.NET unless you properly use code-behind and deliberately seperate out the DAL which isn't the default for the point and click wizards (the DAL separation).

    In the end it comes down to a few things. If you have existing C#/VB skills and don't mind being stuck with IIS then go for .NET. If portability is a big issue and you'd really like to run this application on a small server running Jetty [mortbay.org](for instance) then go for JSF.
  • Compared to ASP.NET, Java Server Faces is pretty immature, and missing certain controls like a file upload. Nobody seems to use it that much, so the user support community seems pretty small (as you can see by the responses to this story). Also, if you stick the state into the Session, the controls tend break if the user click the back-button. The navigation framework also seems pointless (just use links like a regular person)

    I wouldn't make it a large deciding factor though -- in both cases the actual page
    • Re:JSF (Score:3, Informative)

      by bloodredsun ( 826017 )

      FileUpload from jakarta would be used for that as it's pretty much the de facto choice. There are other options like javazoom but it's an easy add-on. The apparent lack of a file upload control is probably reflective of the fact that Java allows multiple ways to do the same thing (which can be very confusing to someone new to the field) where MS products tend to have all the features included whether you use them or not. The JSF user community is not that small and is growing (although there are about 10x a

    • Re:JSF (Score:3, Informative)

      Not really, unlike ASF.Net JSF is just a specification, you get stuff like date controls file upload controls etc usually from component packs. If you want a good out of the mill solution in JSF with most components you need, start with MyFaces.
      The usual mistake many people do with JSF is that they just look at the RI and then dismiss it as all there is, while literally hundreds of components linger around on the net for free and about the same amount in commercial solutions.
      • When I checked out MyFaces, the sample controls on their site were completely buggy. We also experimented with Oracle's and it was a nightmare. IMO, if you want to use JSF, you should stick with the stock package and roll your own custom controls.
        • Re:JSF (Score:3, Informative)

          Things are moving fast in the apache world, actually the controls are not very buggy anymore (You probably checked then out a while ago). Much has been done in the last year. for a good demo check this: site [irian.at] out.
  • I'm a .net developer, and while I'm sure it wouldn't be too dificult to transition to the Java language, I think I'd have the most problems adjusting to the tools. As I'm sure a Java dev would have issues transitioning to .net. I wouldn't know where to start, what IDE should I use? how is remoting/RPC implemented? What build tools, source control systems to use? and so on... .net and java are pretty much mutually exclusive techs, so most of your developers are going to be experts in one or the other. I
    • Just a comment on the portability issue. I completely agree that sometimes having to move an app between disparate systems may mean that someone didn't plan well, but there are also situations where it means you can leverage your assets. For instance, where I work I developed a small network monitoring/reporting application for our help desk to handle 200 or so sites. At the time I wrote it (3 years ago), we had a spare windows 2K server running on older hardware that was otherwise going to go unused, so we
    • The portability thing is a red herring issue. Incorporating a web server from a different operating system into your network is trivial.
    • You must be a shitty developer. Java and .NET are both heavily object oriented, hell .NET was basically Microsofts answer to Java. A good developer is basically lanuage neutral and can pick up what is needed.
      • You must be a shitty reader. Did you read my post cockfuck?
        and while I'm sure it wouldn't be too dificult to transition to the Java language, I think I'd have the most problems adjusting to the tools

        My point was it wasn't the language, douchebag, it was the supporting tools of the platform that takes some experience to learn. Yeah, C# and java are very simmilar syntactically. Of course someone who thinks a programming platform is just syntax (like yourself) would be a "shitty" developer who doesn't
        • You said .NET and Java are pretty mutually exclusive techs, which is not true. A good developer can transition from one to the other in 6 months, if we are talking J2EE and ASP.NET environments. The end goal is the same you pass generated HTML to the client who responds with more information. If you use IIS, Apache, Websphere, Oracle App Server you still do the same basic thing. A good developer once they know how to use one can learn use the other to accomplish similar tasks.
          • You said .NET and Java are pretty mutually exclusive techs, which is not true
            Not true? Really? How many projects have you worked on that use both .net and java?

            A good developer once they know how to use one can learn use the other to accomplish similar tasks.

            You are completely missing the point, which is that developers who dont know websphere, java, oracle etc... will have to ramp up, good developers or not, if using a specific tech is that important to you, fine, you need to plan for it, and its g
            • Were I work we have an enterprize app that has both java and asp.net interfaces. They cover different functions but both use the same backend datastore.

              I not arguing that a programmer can switch overnight, but one can definatly swith in a relatively short time frame.
  • I would stick with Java - you can deploy on any platform without worry of premature implementations. At the company I work for we use BEA WebLogic with Java web applications and Struts - works quite well.
    • I'd second that but with one comment. Do you have java developers or vb developers?

      struts is really cool, and I use that. I've come up with a few of my own tags though, because struts does not have them.

      The following, obvious things are missing from all the frameworks I've used.

      1) struts tags are nice, but if you use the dynaformbeans, then its a problem to fill the beans from a database. Not really a problem, its possible, but not easy. I've created a request to hashtable to object method, so I can

      • I prefer Struts to JSF as it's more mature and you can use more JSTL in it (JSF has issues with ). The JSTL fmt tags can also be used for formatting, including dates and this is recommended by the Struts team which is why they probably didn't both with a competing struts tag to do the same thing.

        I'm also with you on the fact that what framework you use depends more on what language you are happiest coding in and what your company uses. Comparisons like this are a bit of fluff as you can say anything depend

        • JSTL... well, the issues are being adressed in JSF 1.2, to my knowledge only one issue really exists, which is JSF foreach, a construct which in 99.999% of all cases can be replaced with a tighter dataTable or dataList c:if normally works fine, but is not needed because every component has its own render attribute which can be combined with the jsf el. The rest is less verbose than struts, formatting there is an h:outputFormat component for formatting, validation is done within the form not from an xml fi
        • My tag consists of

          <htmlcustom:dateSelect inputFormat="MMDDYY" outputFormat="MMDDYY" useLongYear="true" yearFrom="2001" yearTo="2010" name="foo" bean="mybean"/>

          The select shows January dropdown for the month, 1-31 for day, and the year goes from 2001 to 2010 or whatever you select. It can be dynamic using the Java Calendar object. If useFUulYear = true then the year is CCYY otherwise its just YY. The input format can change based on a user pref from MMDDYY to DDMMYY. Since its a dropdown, the cha

      • No VB developers at the company - it is an insurrance company and all the software we write is for internal use only and some external use by agents which are done via Java webapps using struts, java, jstl, jsp, etc. All of our dev machines are using WebLogic for test deployments and for running the servers locally to track down problems but I'm not sure about the production servers - maybe WebSphere or Tomcat or something.

        As far as tags go, we use a lot of JSTL and the tags that are missing or tags that wo
  • by TechieHermit ( 944255 ) on Friday January 13, 2006 @01:31AM (#14461293) Journal
    In terms of being able to create and serve a web page, either one would probably WORK, but I think Java is a much better platform. Let me share with you my reasons why, keeping in mind that I'm a professional developer with eight years of production experience. Also, I've developed on Apache (straight HTML and some CGI), JSP (on Red Hat servers with Apache Jakarta), ASP3 (IIS with COM+ middleware and Oracle backend), ASP.Net with web services AND some COM+ middleware and oracle backend, and now, Oracle 10G with Java everything (basically).

    First of all, every platform in use supports Java, and you can download almost anything you might want to use for free. This is going to save you a bundle. YES, I know that technically Mono is sort of .Net-ish, and it's free, but I don't think Mono matches the sheer breadth of Java offerings you can acquire at zero to no cost. Java buys you almost complete freedom from vendor lock-in, if you play your cards right. .Net, in comparison, is vendor lock-in INCARNATE.

    Second, Java has an amazingly rich class library. If you can think of something you might want to do with a computer, there's a java library in there somewhere which will let you do it -- usually relatively easily, too. Although C# is approaching this level of functionality, I don't think it's exactly equal with Java yet. Close, maybe, but I think Java still has a little edge. Which makes sense, when you think about it -- Java's been around for several years longer.

    Third, most major vendors are now completely behind Java. Sun, IBM, Novell, and Oracle, for instance, are all putting their collective might behind the platform. That's pretty significant. It means that new innovations from these companies are going to be available in Java FIRST. Also, when you're ready to ramp up to big iron, you're more likely to be able to do so with Java, because all the big players there are Java shops.

    Fourth, you can download Oracle Express for free, and use it with Oracle's Java developer's tools to build a rather interesting type of system. Oracle's considering an interesting approach here; give away the low-end database so that as companies grow they think about going with Oracle first. That's pretty good business; be generous first, so you'll be thought of when it's time to purchase something big. And this can work for you.

    Fifth, the same skill set your developers use to create Java-based apps on your web server can be used to program just about anything from a Microwave to a PDA to cars and trucks (believe it or not, yes Java's finding its way into some vehicle systems). Java's everywhere these days; the language is the same, only the API changes. That makes your Java skillset very portable.

    Finally, I think JDBC is a little nicer than Microsoft's database approach. I've programmed both ways, and I like the Java approach better. It's easier, for one thing; I write less code working with Java (YES, I know, it's astounding, but nontheless true).

    I could go on, but you see where I'm going. Java's the nicer of the two platforms, and you can't really go wrong choosing it.

  • More choices (Score:3, Informative)

    by LarsWestergren ( 9033 ) on Friday January 13, 2006 @02:58AM (#14461576) Homepage Journal
    If you go with Java, there are plenty of other choices than JSF. Struts, while a bit verbose and showing its age, is a very mature framework that scales well and has been used successfully in lots of projects. A lot of people recommend Tapestry [apache.org] or Cocoon [apache.org]. It all depends on the size of your project and what people are experienced with.

    A good thing with Java, no matter which framework you choose, is that you have a huge number of open source tools and libs to help you (Eclipse, Netbeans, JUnit, Ant, Maven, CruiseControl, JMeter, PMD, Checkstyle, xdoclet, Hibernate, Spring, Tomcat, commons logging, jsch...) , and there are also plenty of books, online tutorials, and programmers around who know Java.
  • Use Java if you can. Use .NET if someone pays you more.
  • My money.... (Score:1, Offtopic)

    by g1zmo ( 315166 )
    My money is on the JSF [google.com]
    • Yeah, I thought the same, the Joint Strike Fighter vs MS code. Damn the geneva convention and lets napalm that sucker! Colleteral damage highly advised. If only they can accidently take out Java as well. Then all will be well.
  • by plsuh ( 129598 ) <plsuh&goodeast,com> on Friday January 13, 2006 @04:23AM (#14461803) Homepage
    If you're looking into alternatives, perhaps you should consider Apple's WebObjects [apple.com]. It's essentially what JSF is trying to be, along with a robust, mature, *lightweight* JDBC object-relational mapping and object persistence layer that is scads more mature than Entity EJB's. Pure Java, runs on J2SE 1.3.1+, deployment licenses amount to $499 per server (free with XServes [apple.com]). It's also highly scalable -- this is the technology that drives the Apple Store online, the iTunes Music Store, and Apple's .Mac service.

    --Paul
    (disclaimer -- I work for Apple; however, I've been doing web development using ASP, J2EE, and WebObjects for years. IMHO WebObjects is far more elegant and robust than the alternatives.)
    • If you mean with alternatives EJB2 and pure then yes, if you mean with alternatives something like Seam+Facelets+JSF+Extensive component lib, or s/seam/ejb3 or s/seam/spring/hibernate then definitely no! Or if you subsitute xcode with something like Studio Creator 2 EA2 then definitely no. Do not get me wrong, WebObjects was groundbreaking, but it is mostly Apple to blame for that we now all code with other technologies not WebObjects. All the web stuff now is there where Webobjects has been around 2000 bu
  • For me the two obvious choices are ASP.net vs Java Server Faces.

    Why are they the two obvious choices? What about PHP for example? It sounds like you've already made your mind up - why bother asking the question?
    • Why are they the two obvious choices? What about PHP for example?
      No offence intended, but comparing PHP with ASP.NET and JSF is like comparing a Trabant with a BMW and a Mercedes ;-)
    • What about PHP for example?

      In my experience, PHP is an intepreted, unstructured, code-mixed-with-markup hellhole. Comparable to the original ASP or JSP. The state-of-the-art development platforms moved past that sort of thing several years ago... too many maintenance and scalability issues.

  • JSF hard to develop (Score:4, Interesting)

    by DeadSea ( 69598 ) * on Friday January 13, 2006 @06:22AM (#14462154) Homepage Journal
    I have a small project at work that I inherited that is written in JSF. It is a pain. Don't go there. I have problems with JSF:
    1. Non-existant error reporting: If an exception is throw by the code backing it up, the error message on the front end will be something like "Exception: '{mycomponent.dosomething}'". Which really means that dosomething threw some other exception that it is hiding from you.
    2. Everything is a post: JSF tries to apply MVC to the web, which is fundamentally broken IMO. The web is transactional, not event driven. To make it appear that everything has callbacks, all the links in the web app are done by making javascript submit a POST form for the page. Much harder to debug than any other web app that I've ever worked with. You can't just see the params on a GET url and expect links to work like every other link on the web
    I've never used ASP though, so I can't really compare. Myself I prefer servlets that spit out XML and use XSLT to give HTML. The designers don't seem to like the XSLT much though.
    • I have been through 5 jsf projects, and I do not want to miss it anymore (although I agree the first project was rough) Actually the exception stuff is dependent on the implementation the post centricness is not really that true, yes there is lots of http post, due to the fact that post scales better than get, but you can do links with normal links (there is a h:link or something even in the standard codebase) as for post problems, like back button, the back button issue is solved in MyFaces and the ri,
    • I have problems with JSF...Everything is a post...The web is transactional, not event driven

      You're not going to like ASP.NET either. The reason why these two technologies are being compared here is precisely because they both attempt to make the web development experience (which, as you say, is transactional) look more like a windowing application development experience (which is event driven).

      I guess that the theory why this type of approach is popular is that there are many developers out there who a

    • I don't know JSF, but I'll comment on how this might compare with ASP.NET v1.1. (Haven't used 2.0 much, but it's much improved in many ways.

      1. Non-existant error reporting: If an exception is throw by the code backing it up, the error message on the front end will be something like "Exception: '{mycomponent.dosomething}'". Which really means that dosomething threw some other exception that it is hiding from you.

      I don't think this applies to asp.net. If the code backing it up throws an error, and you're di
  • I've enjoyed developing PHP applications, so you might also want to consider some form of LAMP-oriented system. If you do, consider using Zend Platform, the new PHP server management system from Zend; it's supposed to make administration of PHP webservers much easier.

    That said, I have a radical suggestion: use a rich client rather than web application. Even with AJAX, the web is still a very limited user experience platform -- I've always preferred manly GUIs to sissified pansy-web-pages. ;) If you go that
    • Good luck getting clustered transactions and other important things like maintainability over dozends of coders code with php or rails in any way... Sorry to say that but both php and rails are great frameworks but there are areas where you cannot choose both of them!
      • Clustered transactions aren't always a requirement (in fact, they're *rarely* a requirement), and certainly weren't listed as such by the article author.

        As for maintainability... good luck getting maintainability with *any* language when you have dozens of coders on a project. PHP is not inherently unmaintainable, it's a language, capable of some pretty sweet things. So are Java, C#, ruby, and python, just to name a few (note: I avoided perl, because *shudder* ;)). Whether or not a program is maintainable i
        • Actually maintainability in teams is a huge problems in dynamic languages like PHP or ruby, you have to do excessive Unit testing to keep everything in place. These languages definitely have a team scaling problem, add to that in PHP at least the most popular version (4) no namespacing no separation of code concerns via mvc and you are in for a scaling desaster. PHP is fine for small projects but it does not scale for real world enterprise requirements. Both PHP, Rails etc... have their place but there are
  • Is this really 'just a front end'? If your project is really just a front end to an existing body of business logic, it doesn't really matter that much. Front end coding will be the easy part. Going through your server or appserver business logic and tweaking it for your new interface will be where the work is. In a well designed web front end there should be as little business logic as possible. This way the front-end coding is reduced and replacing your web interface down the road with another front
    • In a well designed web front end there should be as little business logic as possible. This way the front-end coding is reduced and replacing your web interface down the road with another front end becomes easier.

      I totally agree with this, it is the best development scheme you can do for yourself. As a corollary you can also write multiple front ends, i.e. web based for quick deployment, and a rich client for in-house power use.
      • "...and a rich client for in-house power use."

        This is exactly the scheme we're using in house. We'll deploy various frontends (some TBD) based on client needs and bandwidth. On our company LAN, we'll use fat clients (better for serious data entry IMHO), and all will access the same body of business logic on our Progress Open Appserver (great product).

        Rant: I really wish Progress Software Corporation had better advertising and promotion. They've had a great DB and rich development environment for years.
  • Seems like every time I see .net deployed, it only really work with MS browsers. Then the under-knowledged team has to try to figure out how to get it work in the real world. Then there's also the endless security issues with very very long fix times. You'd have to be high to not know it takes way too long for MS to fix known security problems.

    Consider Microsoft for games, but not for business.
  • .
    Java has some new ide's for free that seem to produce web pages (I'm not exactly sure what java flavor). They look really slick, and have me thinking about switching to java from php.

    http://developers.sun.com/prodtech/javatools/jscre ator/index.jsp [sun.com] [sun.com]

    http://developers.sun.com/prodtech/javatools/jscre ator/reference/quicktour/2/flash/index.html [sun.com]
  • Not sure why you're considering JSF and not Tapestry, but in case you want to add the latter to your shortlist, here's a good, detailed comparison between Tapestry 3.0 and JSF:

    http://www.realsolve.co.uk/site/tech/jsf-vs-tapest ry.php [realsolve.co.uk]

    Tapestry 4.0 was just released, so that comparison a little dated now, but still worth a read.
  • You could check out this netbeans flash demo that explains the ease-of-use of developing a Java EE 5 application. That includes adding JSD support to the project.

    http://weblogs.java.net/blog/binod/archive/foss-in -2005-GlassFish-EJB3Persistence-NetBeans-Demo.swf [java.net]
  • I'm a little concerned about the maturity of JSF, especially as Microsoft has just raised the bar (nov 7th last year) with the latest release of ASP.NET. The 2.0 release made up for some of the errors by omission from 1.x. But more importantly 2.0 also introduced a number of new concepts which really boost ASP.NET development:

    MasterPages. Page templating ensures consistent page layout throughout the site, without the hassle of a centralized dispatcher logic like e.g. a front controller.

    WebPart

Get hold of portable property. -- Charles Dickens, "Great Expectations"

Working...