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

 



Forgot your password?
typodupeerror
×
Programming IT Technology

ASP or JSP? 32

Fooknut asks: "I'm here, in the infant stages of development of a corporate website, and portal for my employer. I asked to build on JSP/servlets/EJB, so they setup a Win2k server with IIS 5 and JRun (allaire). Two weeks into the dev process they have a meeting with some managing "programmers" and the decision is made that JSP/Java was just a foolish thing to do, and that we should go with ASP. So here I am, chucking all of my hard work out of the window because someone "important" likes ASP better. Luckily I haven't written much code yet. These decisions are made by ASP lovers, people stuck in the MS rut, unwilling to try or hold a new skillset (I believe because they don't know how and don't want to know how to program anything else). Does it make business sense to put all your chips in the MS hat? Should a web dev co do one thing only, or should it embrace a variety of technology? So what are the advantages and disadvantages of JSP over ASP and vice-versa? Please don't post anti-MS comments, I really would like some serious comparisons."
This discussion has been archived. No new comments can be posted.

ASP or JSP?

Comments Filter:
  • by Anonymous Coward
    I'll agree that for large scale, long term, high volume applications, JSP pages on top of an EJB platform is very powerful and very versatile. We're building a system like this now and it's going to be very powerful. HOWEVER, in almost no time you can set up an Access database, build a quick and dirty ASP page, and have instant interactivity. If you're in this for the long haul and the large scale, plan ahead and use a solid programming language. If you need a solution yesterday, go Microsoft.
  • Being glued to MS isn't by itself evil, and you can do some pretty nifty stuff with ASP, despite what you have heard on Slashdot...

    What the question really boils down to is 'are you willing to fight for the best system for you to do the job with, regardless of vendor'... While not a web developer (Although I was one, briefly) I generally don't care what is actually calling the shots as long as they get called on time and consistantly so. I'm sure the manegerial staff (And the 'heavy-hitter wioth a MS pref) don't really care either, so long as you can show them the why and why not. They're just used to that 'Microsoft thing', and in their mind the world's most valuable company can't be wrong..
  • Why is it that MS products, (ASP, VB, VC, Access, etc) are always the 'quick and the dirty'??
  • I have been attached at the hip to all things microsoft for 5 years. Access, VB, sql server, etc etc. And accomplished a bunch of ad hoc work.

    With MUCH difficulty, I have learned enough java to write servlets and database calls and server side java can now do much of what I would do in ms land with the power of java running on opensource servers with free database software on a cheap monthly host.

    I will agree that down and dirty wins the business contest. But it also is really really stupid, just like all the management decisions that make down and dirty programming the rule of the day.

    This battle is far from over. If you want the definition of easy, try php, not ASP. And java is actually quite easy, once you get past all the inane classpath issues.

    While the corporate monkeys are all addicting themselves to mindless tech, there are a bunch of us learning how to do real work with slightly more clunky technology and actually enjoying it. It is going to be very fun to watch the slug fest in the following years. I have my own personal ideas of who might win the war, and it won't be the mindless ones.
  • by The Iconoclast ( 24795 ) on Friday June 02, 2000 @07:20PM (#1028866)
    Cause MS stresses ease of use over anything else. (Well, besides world domination :-). Seriously, It is incredibly easy to do relativity simple things with MS products, but if you want to do anything complicated that MS didn't write in explicitly, you are screwed.

    A wealthy eccentric who marches to the beat of a different drum. But you may call me "Noodle Noggin."
  • It's powerful, it runs on NT and various Unixes, and as of last month, it's ridiculously cheap [apple.com]. And, you don't even have to learn ObjectiveC if you don't want to.

    Just a thought.

  • I lurk here a lot but never post anything so here's my FIRST POST. I have used both technologies (ASP and JSP) on several different projects and enthusiastically recommend JSP over ASP. So far in all the different methods I've used to develop web apps (C++-CGI, C++ISAPI, JSP, ASP) I feel JSP just from a language stand point is a better choice over JSP. The limitations of the VBScript language is something I felt like I was constantly fighting -- the VBSript language is just too limited when compared to the power Java gives you. The concept behind both technologies are the same: embeded Java or VBScript within the HTML. As far as I know the ASP will be interpreted each time it is processed. JSP's will get turned into a java code (as a servlet) that will stay in memory until a change occurs, at which time it will be processed and compiled again. Also with a good JIT virtual machine I think performance of JSP is better than ASP. I don't have any benchmarks but based on my experience JSP pages "feel" faster. Hope this helps.
  • by costas ( 38724 ) on Friday June 02, 2000 @07:54PM (#1028869) Homepage
    ASP is nice; I am a PHP man myself, but I recently had to look into ASP for a consulting gig. ASP has a coupla features I'd really like to see in PHP, but in the end of the day, I'd still pick PHP's versatility.

    But anyways, back to ASP vs JSP: JSP sucks! there's no other way to put it: JSP is a hack on top of a kludge: it's ugly syntactically, it tries to fit a square peg (Java) into a round hole (server-side scripting) and it has nowhere the built-in functionality and features of either PHP or ASP.

    Now, OTOH Java *servlets* (not JSP) rock! Session management, persistent objects, the ability to leverage Java's impressive APIs; it's the answer to any serious enterprise-level solution.

    So, what to do? PHP4 is supposed to be able to manipulate Java objects *directly* (it's in the spec but I haven't used it). If that works, you can now throw away JSP, put all your middleware logic in Java beans and servlets and use PHP to do the string-parsing and HTML pushing...

    If I were you, I'd try to push for PHP as a 'peer to' ASP with the advantage of being able to use your old Java work...

    engineers never lie; we just approximate the truth.
  • Zope is platform independant, fast
    and MS people working for me now think
    it is the greatest thing since sliced bread,
    and definately superior to ASP
  • Server side Java should be more than JSP, which means that you need some plan and organization.

    It is easy to put too much functionality in JSP. Think of it as a template language with various flavors of Java classes for the backend. It if is mostly Java code it should be a servlet. I don't know if there is an equivalent rule in MS land.

    One division that was recommended by a senior guy, who recently came on board, and which makes a lot of sense to me, is to have JSP 'views' with a servlet 'controller'. (Ala MVC) The controller uses a ResourceDispatcher.include() to get the views that it needs, passing them data as request attributes. We'll be trying this. I liked when I heard about it, and it has only grown on me since.

    This also means that specialized HTML/presentation people can hack the JSPs without being as likely to fsck things up.

  • Now, OTOH Java *servlets* (not JSP) rock! Session management, persistent objects, the ability to leverage Java's impressive APIs; it's the answer to any serious enterprise-level solution.

    Hmmmm. From what I understand, JSPs are a superset of servlet functionality. JSPs, in fact, get converted into servlets before being executed. You should be able to insert any valid Java servlet code you like into an JSP page.

    Maybe you were using something that only conformed to the JSP 1.0 spec? You should be working with JSP 1.1 at least. There are dozens of vendors with different implementations, which is a key advantage over ASP, BTW.

    PHP4 is supposed to be able to manipulate Java objects *directly* (it's in the spec but I haven't used it). If that works, you can now throw away JSP, put all your middleware logic in Java beans and servlets and use PHP to do the string-parsing and HTML pushing...


    What you describe is the entire idea behind JSP. I love PHP, but the idea that PHP will provide better connectivity to Java then JSP (which is Java), seems a bit unlikely.

    BTW: I love PHP. Great platform.

    - Scott

    ------
    Scott Stevenson
  • If you're a Java lover but you're forced to use ASP, you can put your business logic into Java classes and call them from your ASP pages! That way the suits will be happy, and you'll still be doing most of your coding in your language of choice (Java). Here's a great article that shows you how to do that. It's quite easy! http://www.4guysfromrolla.com/ webtech/080999-1.shtml [4guysfromrolla.com]

    A bit of advice from a guy who's learned it the hard way.... no matter what language you're coding in, your ASP or JSP tier should just be a thin "glue" to hold together the objects that contain yer bizness logic. Those objects can be either compiled DLL's or Java classes, it really does not matter- just as long as you keep it out of your ASP and JSP pages where it's ugly and not very reusable. With prior proper planning, you can create a set of middle-tier objects that will make your ASP/JSP pages a snap to code.

    IMHO, the ASP/JSP tier should be so thin it really shouldn't make too much of a difference whether you use ASP or JSP. The meat of your code should be in the middle tier. I haven't done any real work in JSP, so I can't directly compare it to ASP, but I would agree that Java is a nicer language than VB to code in, so it's a good choice for your middle tier logic objects. :) Good luck on your project!!!! :)

  • I'm no expert, but these are the advantages as I undertand them:

    1. Multiple JSP implementations are available from multiple vendors [esperanto.org.nz]. Many of which are free (You either have to buy NT, or software from Chilisoft to use ASP).

    2. JSP functionality can be stored in JavaBeans

    3. JSPs can be deployed on virtually any platform in existence. And while ASPs can be deployed to environments other than Windows, ActiveX library support cannot [esperanto.org.nz]. Therefore, if NT/W2K runs out of juice (witness Toys R Us), you can't move up to Solaris or AIX.

    4. JSPs are compiled into servlets for faster execution (does ASP do this?)

    5. JSP engine can run on a different machine than the webserver

    For more information, check out The JSP FAQ [esperanto.org.nz].

    - Scott


    ------
    Scott Stevenson
  • I was hoping for something a little more earth-shatteringly philosophical, or perhaps some insight into the actual dev stages; I know of a dozen MS employees who post here, and at least one worked on the last gen of Visual [stuff].

    I'm a former VB/VC++ drone, [it paid the bills] so I'm rather familiar with it in practical use..
  • OK, having used them both on large scale projects, the only real difference is... JSP use Java Beans, and ASP uses COM objects. No, really, that's it. ASP and JSP are both simple page processing engines, for embedding programmatic logic in pages, and neither are particularly good at it (for example, look at the hoops you need to jump through in them both the iterate through a record set and output HTML for each row).

    If page templating is all you need to do, then something like Allaire Cold Fusion is probably better. Use JSP if you have existing business logic in JBs/EJBs, and ASP if you have existing applications in COM.

  • Good luck in getting them to convert to PHP. MS people are notorious for telling you how great PHP is and then forcing you to use ASP.
  • that here on slashdot, such an intelligent post wasn't moderated up more... The question is ASP vs JSP, but everyone's saying, "Use PHP!" (I've used PHP, yes, I'd recommend it, but not on a Microsoft platform.)

    If you're on a Microsoft platform, use ASP. That's such a no-brainer answer, I can't see how it's even questioned. You can even use Java, just like Mr. Booty suggests.

    If you're not on an MS platform, use JSP. DUH! (unless you like to fiddle with those 3rd part ASP for non-MS solutions.)

    If you have a little free time, go check out php at php.net. No fooling with zope or zend just yet, just try out good old fashioned regular PHP. Version 4 just came out, and if any of my current projects demanded a Linux environment, I'd be very excited. And I fully plan to be excited when I have to do a Linux-based project.

    ASP or JSP. My guess is, the answers to this question were so obvious, the asker wanted to get everyone else's opinions just to make sure he wasn't getting snookered by something he couldn't see. "A good programmer looks both ways before crossing a one way street."
    --
    Peace,
    Lord Omlette
    AOL IM: jeanlucpikachu
  • I said I havent tried the Java-thru-PHP approach. I am very curious to try it, so it might happen. But anyways:

    You are correct, JSP is translated to Java and then compiled as a servlet. Now, what does that mean for the end-developer?
    * Is JSP faster than PHP/ASP? No, not out of the box. Both PHP and ASP are compiled to bytecode, so loading time between a PHP/ASP page and a JSP servlet are not far off. The true advantage of JSP comes from the ability to communicate with Java beans that can do very nifty tricks (like DB connection pooling, persistent objects, etc). Other than that, a JSP servlet is not static (i.e. always loaded); it has to communicate with static beans/Java classes to get those advantages. Now, this was true a few months ago with JServ and GnuJSP, Tomcat might have changed things a bit. But what if PHP can do the same trick as JSP (i.e. communicate with persistent Java objects, so you don't have to replicate them with each page invocation)? I think some benchmarks would shed some light on this one.
    * JSP is syntactically ugly. Both ASP and PHP have an advantage there.
    * JSP is nowhere as widely used as either PHP or ASP. The 1.0 and 1.1 implementation where so very different, forcing people to port stuff over. I.e. there's a much larger libary of ready-made code for either ASP or PHP over JSP.
    * Most importantly, (to me at least): JSP is Java; as much as I love Java for serious programming, it sucks for scripting: it's a rigid, serious programming language. PHP/ASP OTOH have all the nifty shortcuts to make code easier to develop and read (e.g: variables within strings, automatic conversion between strings and numbers, etc, etc).

    As I said, I love servlets. For serious applications, servlets kick ass. For RAD, servlets are a pain and a half. PHP/ASP Java connectivity can bridge that gap and get rid of that half-baked technology Sun came up with to be in the server-side-scripting market (i.e JSP)...

    engineers never lie; we just approximate the truth.
  • I'm currently developing a rather complex website using Java Servlets. If you are putting HTML code in your servlets, you're doing it wrong :) I don't spit out any HTML code directly from the servlets, the servlets fill up templates, which are used to fill up other templates, and so on. The entire site is based on these templates (which allow the side effect of SKINNING! :) .. the role of the servlets are to provide logic in their generation and the fetching and maintenence of database connections.
    modern day geek. [dhs.org]
  • You can use other languages in ASP pages, JavaScript, Perl even Haskell.
  • A. its way more scales better
    B. it compiles to bytecode when run on the server. nifty..!
    C. JSP = JAVA server pages, you have a WAY more powerfull development language than VB. They are just begining to plan to ad treads(just an example :o)
    D. performs better under heavy loads

  • You can share variables between them. ASP is actually quite powerful solution, it's more than You can call COM/DCOM objects (possibly Java objects too, been a while since I played with ASP) You can use VBScript for the simple stuff, or use PerlScript for those regexps. However, you are stuck on IIS/NT/x86. There is/are ASP modules available for Apache, AFAIK, but I haven't looked at them. Using JSP OTOH, is still somewhat problematic, there are some features missing, and others not working quite yet, but it has more potential for future growth, and reusability (Haven't we been promised that for years?)
    But enough Karma whoring...
    J.
  • If you are on a Micro$oft platform, go with ASP, especially with W2K...performance is pretty spectacular and once you start getting into COM/MTS/COM+ things really start moving. Once your head is around VB, it is really fast to develop in (which is why code factories always go for it).

    I have been working with ASP for a while now (IIS 3 days) and it has really matured as a platform...JSP still seems to be relatively new and I have not been impressed with what it offers, other than cross-platform capability. In reality, most companies will lock a platform in as a part of a strategic plan so the need to change platforms should be remote on most sites...in two years time you may have to change, but will you be working at the same place...python may even have taken over the world.

    As observed, within ASP objects can be coded in Java, so this may be of some benefit.

    And the presentation layer should be very thin and should also be pretty straight forward...logic should be limited to some loops, some conditional statements, some output and formating.

  • ASP is helpful for immediate server side, site development. In fact, much of Microsoft's own wizard (read regurgitated) code in Visual Interdev 6 uses JScript, Microsoft's implementation of JavaScript, as the server side scripting language. It seems quite clear that Microsoft has realized that VB was never a great language to begin with, especially not for the web where other languages had already gained strong followings, not to mention support.

    I've never used or seen JSP code, and I think it's safe to say that PHP is definitely on a path that puts it in the ruuning for the lead in the future. It justs needs some more data handling abilities and we're all set. The future looks bright. Cheers!

    -Yoink!
  • No, not out of the box. Both PHP and ASP are compiled to bytecode

    ASP maybe, but PHP is not (unless you mean it's recompiled in memory each time the page is requested?). I know there's a PHP4 compiler lurking on the horizon, but I believe its purpose is to encrypt the code prior to distribution rather than to speed things up.

    JSP is syntactically ugly. Both ASP and PHP have an advantage there.

    I would tend to agree PHP has the edge here, but have looked at very little ASP code.

    JSP is nowhere as widely used as either PHP or ASP. The 1.0 and 1.1 implementation where so very different, forcing people to port stuff over. I.e. there's a much larger libary of ready-made code for either ASP or PHP over JSP

    My feeling is that JSP will rapidly overtake PHP in terms of activity of developer community, because 1) it is from Sun 2) based on Java. Sun has much more influence than the PHP team. I also suspect JSP will grow quite rapidly in the next year. Not that I

    nifty shortcuts to make code easier to develop and read (e.g: variables within strings, automatic conversion between strings and numbers, etc, etc).

    Amen to that.

    that half-baked technology Sun came up with to be in the server-side-scripting market (i.e JSP)

    Like I said, I think JSP is going back in the oven for a bit.

    - Scott


    ------
    Scott Stevenson
  • The company I worked for has decided to go JAVA only 3 years ago. We had systems written in ASP (Custumizable Online Store for example) which were basicaly recreacted in JSP. I can tell you that writing in JSP was a huge strugle. The lanague was so incomplete compared to ASP that you had to write most of the code in JAVA then call it from JSP in weird ways. The debuging process was terrible, very often you had to restart the server (JRUN) in order to see your changes, or delete the compiled .java,.class files. Sytax was changed around from version to version, methods droped, changed. JRUN and JSP documentation was very disorganized. ASP was still faster.
    Many of these problems are not as severe these days. But I still find programing in ASP much simpler then in JSP.
    ------------
    As for the language limitations? Neither ASP or JSP is a language. You can use serveral languages ASP always allowed Vbscript and Jscript. JSP is supposedly supposed to support other languages since version 1.1 even Pascal.
    ------------
    Programming Communities> ASP is commercial once you are Microsoft's friend you get many freebies but free code is hard to find. JSP comes from the JAVA cult, they only want you to use JAVA technologies and think that JAVA is gonna take over the world someday. You have to deal with way too many closeminded people. JAVA is closely controled by it's mentors and you have to spend lots of mulla for different pieces of technology. PHP is nice and free :) ------------
    That's it for today.
  • Microsoft's decision to use JScript in its Web-widgets was a technical one, but is no longer necessary with VBScript 5.0. JScript was used to instantiate real objects and classes, which, until recently, were not available to VBScript.
  • Yey, another benchmark from the JAVA cult.
    Go to some third party to get a decent benchmark,somebody that doesn't have anything to gain by saying JSP is faster.
  • Hey, really? Where is that Microsoft people telling us to use PHP? That must be really wonderful news for PHP - Microsoft has great marketing, as we know...
  • My understanding (and this is second hand, so take it with a few grains of salt) is that PHP4 actually compiles to bytecode now, and that the compiler will just help you distribute that bytecode. Of course, if this is true, I don't understand why Zend doesn't have PHP Compiler ready now...

    Now, about JSP: instead of me trying to convince you why it should be thrown away, read this [servlets.com] great article from Servlets.com --hardly the place for Java critics...

    engineers never lie; we just approximate the truth.
  • They are just begining to plan to ad treads

    Excellent! I have lots of traction problems using VB on wet roads, and treads will make a big difference.
  • The article linked to above is a pretty shaky foundation on which to base a criticism of JSP. It's obvious that the author is enamoured with his pet language, to the extent that he thinks saving a few keypresses equates to increased efficiency in the Real World.

    Let's look at the criticisms one by one:

    "Java code too tempting."

    This is true of any scripting language. I've been forced to clean up amateur ASP projects that were 90% inline VBScript, 10% HTML, 0 VB objects. PHP3 was even worse, because you were almost forced to inline everything (which put me off PHP to the extent that I never bothered to look at whether v4 fixed that problem).

    The proposed solution, however, removing the _ability_ to inline code, is far too restrictive. Why should my proof-of-concept JSP need to be coded for maintainability? If I've got a deadline tomorrow, I might _want_ to sacrifice good coding style, secure in the knowlege I can split the load properly between servlet and JSP over the next week, so long as the app is running. In the real world, there are too many situations where you want to inline code, although you should plan on fixing it later if the page is anything more than a one-shot.

    "Java Code Required"

    There is no real advantage to being able to type "$Request.ContextPath" instead of "Request.getContextPath()", unless you count three keypresses as critical to your project. They are two different syntaxes for the same thing. This is like saying that WebMacro is a bad thing because it forces you to use WebMacro.

    The remaining complaints in that section are solved by using custom tags.

    "Simple Tasks are Hard"

    Once again, "#parse "header.wm"" is just as complicated as "<%@include file="header.jsp"%>". The only difference is that the latter is a lot less likely to upset GUI web design tools, which makes it easier to keep the web-designers happy.

    "Lousy Looping"

    The JSP/taglib example of "foreach" is identical in complexity to the WebMacro version, once more with the advantage of being more friendly to existing web design applications.

    "Useless Error Messages"

    That's an implementation issue, not a problem with JSP's themselves. A decent JSP compiler should spot constructs that will cause errors in a compiled class, and flag them. If your JSP compiler is not decent, it's the fault of the people who wrote the compiler, not of the JSP spec.

    As an aside, the setup I have here allows me to step through the JSP compilation process, and attach a debugger to running servlets and JSP's. Being able to set breakpoints, walk through methods etc. etc. makes it a lot easier to find the more obscure of my mistakes.

    "Need a compiler"

    So how do you run a dynamic site without a compiler (or an interpreter, if you want to be picky)? Osmosis? Telepathy?

    It's not particularly hard to get hold of a Java compiler. They're available for free (beer) on most platforms (Solaris, NT, Linux, AIX, HP-UX, MacOS, we've even got one client running an application server off an AS/400). I'll admit, if you're not running on a platform with an available JDK, then JSP isn't for you.

    "Wasted space"

    The disk-space argument isn't even worth mentioning. You're never going to have so many JSP's that it'll cost you more than a few dollars worth of hard drive space, if that.

    Sure, Java uses up a lot of memory. But that's Java itself, not something specific to JSP. I don't know what system he was using to test on, but the average size of a JSP on the production web-app closest to hand is 6-7K, not 30+K. The JSP compiler doesn't load all the HTML as static class data, it gets pulled off the disk at the start of the service() method, and is available for garbage-collection as soon as the request is done.

    Anyway, enough counter-rant.

    Charles Miller

    --

Anyone can make an omelet with eggs. The trick is to make one with none.

Working...