Slashdot Mirror


Web Development With JSP

This "dynamic content" thing doesn't seem to be going away, does it? Web sites need to get smarter to handle the types of content that at least some people want to see on them these days, and the coders and designers behind them need the tools to make them so. Accordingly, Gavin Bong crafted this review of Web Development with JSP, which may be one of the tools you need.

Web Development with JSP author Duane K. Fields and Mark A.Kolb pages 543 publisher Manning rating 8.5 reviewer Gavin Bong ISBN 1884777996 summary Comprehensive coverage of JSP1.1. Suitable for beginning to intermediate Java developers.

Prologue

Before I proceed with the review, I feel obligated to respond to Jayakrishnan's review of Core Servlets and JSP and Slashdot readers' comments.

I share the sentiments of most people that the use of JSP scriptlets (Model 1) is bad practice. The mantra, "Thou shalt not mix HTML and Java code," should be tattooed onto every JSP developer's forehead. And as the author and readers have suggested, either choose a Model 1.5 (JSP or custom tags with JavaBeans) or Model 2 (MVC) to implement moderate- to high-complexity Web applications.

However, I believe that the authors of this first generation of JSP books need to inform the populace of what JSP is fully capable of (warts and all) -- in order for developers to appreciate the other paradigms. And beyond that, these authors must then educate on how not to use JSP. And I believe that will be the difference between a complete JSP book and an incomplete one.

Secondly, JSP Model 1 has been often described as "servlets lite." It is a good paradigm for prototyping servlets. For example, SOAP4J (IBM's SOAP framework) was released using a JSP scriptlet to dispatch SOAP RPC invocations. The software has since been donated to the Apache group and in the latest public release; the aforementioned JSP scriptlet is now a servlet.

So on that note, let me begin the review.

Topics covered

The book starts with a survey of precursor technologies to JSP in Chapter 1 and quickly moves into the real subject matter. It is clear from the start, that this book is written with the Java programmer in mind. I'd say that only the first five chapters are useful reading for a JSP page designer. Concepts like "How to setup a JSP/Servlet engine?", "Incorporating applets with tag," JDBC, JNDI, and EJB are either relegated to the Annexes or lightly mentioned before detailed treatment follows. The authors only cite HTML and Java as prerequisites but it's more accurate to say that readers also need to have some knowledge of core J2EE services like servlets. Here's a tip: have the JSP v1.1 and Servlets v2.2 specifications within close reach when reading the book.

The book covers all the core JSP topics; here's a sampling:

1. JSP and JavaBeans
The book provides a very readable introduction to JavaBeans for those unfamiliar with it. This is required reading for those implementing the Model 1.5 architecture. However, features specific to visual-oriented beans are not covered. Page designers should specifically devour Chapter 5 on JSP bean tags. The two notable samples provided are:
  • CachedRowSet Bean - An example of paging through results using the JDBC 2.0 RowSet interface.
  • JDBC Transaction Processing - An example of maintaining a JDBC transaction across several JSP pages using a Database Connection Bean and JSP implicit objects.
2. JSP Performance/Scalability
Performance and scalability issues are discussed accross several chapters. The authors attribute JSP's performance to servlet performance, which is tied to JVM server memory. No rule of thumb on sizing JVM server memory is given, but a tip is offered on how to use the serializable interface to estimate the size of Java objects that will be placed in the session object.

Session migration over multiple load-balanced machines is touched upon lightly but no technical details were offered. I would have liked to see a practical example on session persistence coupled with a use case of load balancing a JSP website. It's unfortunate also that the authors didn't think that database connection pooling warrants a practical example.

3. Multithreading
Throughout the book, readers are reminded to be aware of thread safety issues when dealing with shared resources (e.g. JDBC Connections). This tip is offered: "Examine all static variables & objects whose scope is session or application."

4. Exception Handling
A comprehensive coverage on how to handle exceptions in a JSP web application is provided and covers these areas:

  • Error pages in JSP
  • Null properties in JavaBeans
  • Undefined values in Database tables
  • Handling exceptions in servlets (JSP Model 2)
5. JSP Web application architectures
In Chapter 8, the page centric architecture (Model 1) is compared to a servlet centric one (Model 2). A discussion on the servlet RequestDispatcher interface culminates with a sample, that demonstrates how a servlet dictates application flow; relegating JSP pages to provide only presentation services, when called upon. A more complicated sample using this architecture is developed in Chapter 9.

6. Deployment
The book provides complete information on WAR files and Deployment Descriptors.

7. Three chapters of code samples
One full chapter is dedicated to a sample implementation of a real world example of a faq-o-matic tool. Also provided are two chapters of code snippets for Web-based functionality like form handling, cookie management and JSP's marriage with Javascript.

8. Custom tags
The last two chapters are dedicated to this very unique feature of JSP and in it they provide sample custom tags for content substitution and translation, coverage on how to package taglibs and more advanced techniques incorporating Java reflection in custom tag helper classes.

Weaknesses

The book comes with eight pages of errata - mainly spelling/naming errors in the code. I think publishers need to ensure that code be proofread as diligently as the prose. Fortunately the book has a Web site (taglib.com) with a link to a Web-based public forum.

The JSP API in Annex E is presented in the same style as Oreilly's Java in a nutshell book. A UML diagram would have been nice.

And finally, just like in the Core Servlets and JSP book; there's no mention of i18n or security. But this is probably a moot point since you gain i18n features directly from the Java language itself and the "contentType" @page directive attribute. Security of a JSP application is largely dictated by the Servlet/JSP engine configuration (albeit you can plug in your own authentication/encryption schemes) and would be better covered in a book dedicated to system administration and other deployment issues.

Is it worth buying?

It is important to mention that this book covers JSP 1.1 and Servlet 2.2, the production release of each technology. Recently JSP 1.2 and Servlet 2.3 have both entered the Proposed Final Draft stage. So the question is: should you wait for a new edition? My suggestion is: go buy the ebook version (in PDF) from Manning's website. And at a price of $16.50, that's a steal.

In terms of content, the book offers good value in its coverage of deployment issues, different JSP architectures and not forgetting some really good material on custom tags/taglibs. And by advocating an MVC styled development architecture; everyone from your JSP page designers, JavaBean/servlet developers and DBAs will be less coupled - and your code more maintainable.

Table of contents

  • Chapter 1: Introduction
  • Chapter 2: Fundamentals
  • Chapter 3: Programming JSP scripts
  • Chapter 4: Actions and implicit objects
  • Chapter 5: Using JSP Components
  • Chapter 6: Developing JSP Components
  • Chapter 7: Working with databases
  • Chapter 8: Architecting JSP applications
  • Chapter 9: An example JSP Project
  • Chapter 10: Deploying JSP applications
  • Chapter 11: Performing common JSP tasks
  • Chapter 12: JSP by example
  • Chapter 13: Creating custom tags
  • Chapter 14: Implementing advanced custom tags
  • Annex A: Running the reference implementation
  • Annex B: Incorporating Java applets
  • Annex C: JSP resources
  • Annex D: JSP syntax reference
  • Annex E: JSP API reference

Besides the PDF version, you can also purchase this book at Fatbrain.

29 of 102 comments (clear)

  1. Re:Jakarta or Tomcat? by MarkX · · Score: 2

    Jakarta is the project. Tomcat is one of the products of the project. In particular Tomcat is the servlet engine. I think the name of the JSP implementation is Jasper, but don't quote me on that.

    Aditionally there are a lot of other things happening in the project, like application frame works, the Jakarta ORO Matcher regular expression library, and a number of other things. Take a look at the site.

    Mark

  2. Good Read by MarkX · · Score: 2

    Personally I picked up this book a while ago. I needed to get up to speed on JSP. It is a good read. I didn't find I needed the JSP or the Servlet specification handy to get through it, and I had only a passing familiarity with JSP when I started.

    Mark and Duane deal with the subject well. The chapter on "Architecting JSP applications" is very helpful for someone coming new to the Java way. The coverage of java beans is decent, although I'm not personally a big user of them.

    I would recommend the book as a good starting point for using Java as a web development platform, but as a starting point. Take a look at some of the alternatives to JSP. Personally I've moved away from JSP, and haven't used them in a single large project to date, except in a purely cursorial manner. We've since moved to using Enhydra as our framework for using Java on the web. I highly recommend it, but also check out some of the stuff over at the Jakarta Project for some other alternatives to JSP.

    Mark

  3. Re:Rant about separation of code and HTML by Masem · · Score: 2
    The concept about sepearating code and HTML runs along the same lines as the method-view-interface of Java and other languages, or separating content and layout for HTML/CSS. The separation takes time, and usually more resources than pure optimization, but when you get the bonus is if you wanted to run the SAME engine/content but with a different interface. A good example is HTML/CSS -- you can easily specify different stylesheets for layout depending on the viewing situation: if it's on screen, you can use one that might include all your navigation links, if you're printing, you can use another that hides navigation links, and maybe for those with celphones, you can cut it down to just the skinny. It's also much easier to make changes in one aspect (content or presentation), without affecting the other.

    Now, sure, with JSP and the like, it does seem that all you'll be serving is web pages, so why not intermix the HTML code with Java code? What if with the change of one line, you could run the JSP as an independant app (no browser required?) -- or in text mode? Or whatever other interface might come along next? It's much easier to do that separation now that if the next big thing comes along, you can easily adapt your program, than to rewrite from scratch.

    --
    "Pinky, you've left the lens cap of your mind on again." - P&TB
    "I can see my house from here!" - ST:
  4. CPU power needed to backend JSP pages? by Masem · · Score: 2

    I've been running a web server with CGI/apache/perl/mysql initally on a 486/66, and now on a 200MHz Pentium. The former case, the pages were definitely not speedy, and with the 200 behind them, it's much better (what I've written could probably stand for some optimization and mod_perl-goodness, of course). While I know that the scripts I have won't be going to JSP at any foreseeable future, I wonder what sort of power you'd need behind it to make sure the pages ran well. Assume that it's a small-size web site, maybe on the order of 10,000hits/day, with standard db backends where needed. Will my 200Mhz/128megs be able to power it?

    --
    "Pinky, you've left the lens cap of your mind on again." - P&TB
    "I can see my house from here!" - ST:
    1. Re:CPU power needed to backend JSP pages? by jammer+4 · · Score: 2

      One thing to make sure of, is that you use a 1.3 JDK. It's much faster and seems slimmer. I noticed a MAJOR difference when I upgraded from 1.2.2.

    2. Re:CPU power needed to backend JSP pages? by Longstaff · · Score: 2

      I run a decent sized web site based on JSP and MySQL. To answer your question in a word, no. We currently have a small farm of Linux boxen (IBM's JDK 1.3, Allaire's JRun 3.0) doing our front end with a MySQL database server behind it all. It's able to handle many more hits than 10,000 / day.

      However, our internal development server is a dinky little Celeron 333 / 156MB RAM with the whole mess on it (MySQL, Apache, Jrun, etc). It works fine for our dev staff, but if several heavy pages are requested too close to one another, the machine bogs down horribly. Could your P200 dish out 10,000 pages a day? Maybe - if every hit was evenly spaced out throughout the entire day. But hits never come like that. You'd need a REALLY fast disk subsystem to keep up with all the swapping you'd be doing. Money that would be better invested in more RAM.

      In order to run a DB driven JSP site, RAM is God. If you can avoid it, don't run the DB server and your web / JSP engine on the same machine. They're both RAM hungry beasts and I find it easier to put together two cheapo machines from spare parts with 128MB of RAM each than one cheapo machine with 256MB.

      The most important thing to keep in mind is that regardless of hardware, your code is what makes the biggest difference. Sloppy, inefficient code will kill you - fast!

      Depending on your content, you might be able to get away with a Slashdot style cache system. You write your JSP to generate the content (a story, etc), then store that in a static file. You can then either serve the static file directly (having a scheduler run the JSP-updater) or include the file into another JSPs output

    3. Re:CPU power needed to backend JSP pages? by JohnZed · · Score: 3

      I run a JSP-based intranet on a 400 mhz celeron with 64 megs of RAM and it could definitely use more memory (buying it next week), but otherwise it runs very quickly and smoothly. Choose your JVM wisely (Sun's tend to be lower memory usage, IBM's tend to be faster), use a good servlet engine (Resin from www.caucho.com is excellent, but Jakarta is pretty slow), and put in a lot of RAM. I don't know about 200 mhz, though. . . that's probably a little lower than I'd use, especially if it also includes to database.
      --JRZ

    4. Re:CPU power needed to backend JSP pages? by tshak · · Score: 3

      We've found that with Allaire's JRUN engine, page execution is reasonable on a dual PIII with 256megs of RAM (NT4). We also found it funny that our Allaire Cold Fusion templates could easily out perform our JSP's (sometimes 2:1), but we didn't want to spend the $5K (vs. $1300) on CFEnterprise for the use of CORBA ORBS and EJB's.


      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
  5. Re:Garbage by Tumbleweed · · Score: 2

    'dynamic content' has nothing to do with client-side dynamic technologies - it generally refers to sites that are generating pages on the fly, almost always out of a database, like Slashdot does with perl, or like other sites do with PHP or ASP, or JSP.

  6. Re:Garbage by Tumbleweed · · Score: 2

    1) A page being generated with ASP has nothing to do with whether it's viewable on a certain browser or platform. That has EVERYTHING to do with the person(s) who coded the site, and what that ASP is generating. You can generate perfect HTML or unbelievably _evil_ HTML with ASP, PHP, JSP, or Perl (hello Slashdot!).

    2) What is your problem with cookies & javascript?

  7. Re:Say what? by Tim+C · · Score: 2

    i18n = internationalisation

    Apparently because it starts with an 'i', ends with an 'n', and has 18 letters in between...

    Cheers,

    Tim

  8. Would you prefer Visual BASIC? Or COBOL??? by alienmole · · Score: 2
    The Sperber paper is a good one, although it conflates Java and OO a bit more than it should. All the arguments of this kind against Java are absolutely, 100% correct. From an academic and theoretical perspective, Java certainly sucks almost beyond repair. I've never even heard an academic defense of it (does anyone know of any?)

    At the same time, in a typical business programming environment, all these criticisms are 98% irrelevant. Very often, in these environments, the alternatives are things like Visual BASIC - or COBOL! Languages like Python on the practical side, and Scheme or ML on the academic side, are no more on the radar of most business developers and their bosses, than Smalltalk ever was.

    The reasons for this are many, complex, and intertwined, ranging from history and comfort factors to industry support and available tools. But a big part of it is that the proportion of programmers with the CS experience to recognize the flaws in Java are miniscule. To those happily using it, Java seems like a hell of an improvement on what has gone before, and the criticisms of it seems hopelessly abstract and theoretical.

    Advanced features take decades to reach programming languages used for business. The evolution of business programming languages so far goes something like this: FORTRAN, COBOL, BASIC, assorted 4GLs, Java. Progress, don't you agree?

    Unfortunately, ubiquity in business translates to ubiquity elsewhere, which is partly why Java has started becoming popular as a teaching language. Actually, compared to Pascal which has been a common teaching language in the past, Java isn't bad. For those wanting an "applied" degree that'll let them go out and get a decent job as a programmer, it'll work. But it is sad that people who might aspire to more are being taught Java as a prototypical programming language. Luckily, the smartest, most inquisitive students won't be satisfied knowing just one rather constraining language, so they'll find alternatives.

  9. Re:Anyone can do a better job that Sun by iapetus · · Score: 2
    It is a pitty that your web site is written for analysts and wankers because I would really like to use it to learn more about the Java platform particulary in relation to e-commerce/web-applications.

    It's not a pity for analysts (and wankers) who want exactly the sort of information you're complaining about, presented in the style that you're complaining about. Developers, I'm assuming, are expected to have enough intelligence to track down the Java Developer Connection, where they would find a clear and concise introduction to EJBs. Or, if they wanted something a lot more in depth, they'd take a look at the EJB specification, which thanks to the good design of Sun's site is merely three clicks away from the front page of the Java site.

    The page that you complain about (http://java.sun.com/j2ee/overview.html) is a relatively good non-technical overview of J2EE, and doesn't pretend to be anything else. However, having found it, a quick click on 'documentation', followed by 'tutorials' takes you to yet another developer-level introduction to J2EE which seems to fit your requirements a lot better.

    The only problem I see with the information provided is that it's not great for impatient developers who can't be bothered to look round the site. Perhaps if you'd spent more time reading the navigation options than 'mindless marketing drivel' then you'd have found what you wanted more quickly.

    Incidentally, I always find that you get better results when complaining about issues like this if you at least run your mail through a spell-checker first. ('pitty', 'particulary', 'nosence' etc.) It's always helpful to make a good impression when what you have to say is inherently negative.

    --
    ++ Say to Elrond "Hello.".
    Elrond says "No.". Elrond gives you some lunch.
  10. Re:Garbage by gattaca · · Score: 2
    errrm.

    So you are complaining about:
    • client side scripts that take a long time to load and don't add anything useful to the page
    • server side scripts that take a long time to serve and don't add anything useful to the page


    Soooo, the first thing has nothing to do with JSP, which is server side, and the second thing is about how you perceive the trade-off between performance and content.
    Given that you read (and post to) slashdot -which uses server side CGI scripts, and that you appreciate some customization, you do, infact like dynamic server-side content generation. Just as long as it's efficient.

    JSP offers an alternative to CGI, which, in some situations can be faster than Perl because of the way the server deals with processes. (One process for the Java Virtual machine with threads handling
    requests, rather than one process per CGI request).

    So perhaps your rant was a little misdirected.

    A better reason to dislike JSP is that it doesn't enforce the seperation between content and presentation. An XML + XSLT/XSP with Cocoon is an alternative that is, IMHO a cleaner solution.
  11. Re:Garbage by macpeep · · Score: 2
    That's such crap! The only people interested in dynamic content are those pushing the tools to create it.

    Are you on drugs? Dynamic content and JSP is not about flashy applets dancing on the screen. It's about HTML that is created on the fly. Like... umm.. well, slashdot.org comes to mind. e-Bay comes to mind. Amazon.com comes to mind. About a gazillion other database driven sites come to mind.

    Even if you don't have dynamic content, it makes a lot of sense to use something like JSP, PHP or ASP (or why not Perl), because it allows you to separate the actual content from the template. If you do a re-design of the site and you have 50000 pages, it's easier to just change one template than to do some silly Perl script that does a search-and-replace on all of your 50000 html files, complete with re-building navigation etc.

    Yes, you can misuse "dynamic content" but that's hardly a reason to say that "the only people interested in dynamic content are those pushing tools to create it". THAT is garbage.

  12. Re:Java sucks! by macpeep · · Score: 2

    UDP broadcasting.. Hmm.. is that the same as multicasting? If not, what's the difference? I'm asking cause I know Java does UDP multicasting.

  13. You might be a little confused by boudreau · · Score: 2

    Don't take the subject, "you might be a little confused" the wrong way. I just want to clarify a few things that I think may have been misunderstood.

    "I think its much more natural to do things HTML style such as >(sorry, ASP code here) than try to spit out the HTML from inside a DisplayCustomer() function."
    "Not possible if everything is inside a system.out.println() or whatever."

    Separating of code and HTML does *not* mean that you will be coding out.println() statements from a Servlet or non-jsp code. You must remember that a JSP IS a Servlet. Some authors like to think of them as Servlets "inside-out".

    That being said, the MVC and other designs do not dictate that you print the html from a Servlet... taht would be absurd. If you were do that, then you are not using the power of JSPs.

    Separating of code and html is simply this (in a very simplified form)...
    Code: Put all your business logic and backend connections here.
    HTML: Put all your presentation logic here. This does not mean at all that you cannot put jsp code here... even lots of jsp code here. The point is simply that all the code should be related to the presentation and organization of the presentation.

    Now I will admit that putting all the business logic and presentation logic in a JSP is much easier on "not-so-complex" sites. My approach above is in respect to more complex sites, which I deal with daily.

    So for everyone posting their opinion regarding separation of code and html (or as I would put it, separation of business logic and presentation logic) please distinguish whether you are speaking about complex sites or not-so-complex sites.

    Michael

    -The requirements called for Windows 9x or better... so I installed Linux

  14. Re:Rant about separation of code and HTML by horza · · Score: 2
    Reasons for separating out code and HTML:

    • programmers can follow their source more easily as they don't have to pick through reams of HTML to find it
    • less chance of a site builder accidentally corrupting code (slip in cut-and-paste, using an IDE that reformats source, etc)
    • makes page easier for site builder to read


    You will find that in many companies, the job of web application programmer and site builder (HTML) are pretty clearly cut.



    Phillip.

  15. Re:Garbage by gfxguy · · Score: 2
    That's right - and very often it's ridiculous to have to wait, because the server is so damn busy, when it could have been done in a much simpler manner.

    Slashdot is the kind of place where dynamic content is necessary - and there are dynamic parts of a lot of websites that are necessary. There's also a lot of junk.

    I guess what pisses me off the most are things like ASP pages that I can't view on netscape on my SGI. Do these companies even realize they are losing my business? Because, more often than not, it's a small business running some MS web solution than a place like slashdot, or CNN.

    I don't know. I guess I'm just in a bitch-and-moan mood when it comes to the web. I was trying to look up cellphone plans and half the places I went I couldn't even look at the offerings without cookies or javascript. And even then some of them wouldn't display the content in Netscape on Irix.
    ----------

    --
    Stupid sexy Flanders.
  16. You're all right, of course. by gfxguy · · Score: 2

    I was just in a lousy mood, my apologies.
    ----------

    --
    Stupid sexy Flanders.
  17. Re:Dynamic Web Content? Philip & Alex. by mightbeadog · · Score: 2
    Read both. JSP has its place, and if you're going to use it, or even make an educated decision not to use it, you need a JSP book. But that's just technology.

    Even if you don't go their AOLServer/TCL route, _Philip and Alex's Guide to Web Publishing_ is the best book I've seen about the goals and issues relevant to all non-static sites (plus a lot that's useful for static sites too).

  18. JSP is a Sun marketing tool... by copyconstructor · · Score: 2
    designed solely to convert 'programmers' familiar with ASP. See the following for a good discussion :

    The Problems with JSP

    There are plenty of better alternatives out there - this article mentions some, just search past slashdot for more.

  19. Rant about separation of code and HTML by Pinball+Wizard · · Score: 2
    I don't always agree with the near religious dogma of separating code and HTML. Yes, your classes and functions should be separate. But the thing we have to remember is that we are ultimately creating web pages.

    In a lot of cases, I think its easier to just mix the code. Say you are presenting a customer a page to update his/her customer information. You retrieve the information in the database, then display it in a form. I think its much more natural to do things HTML style such as >(sorry, ASP code here) than try to spit out the HTML from inside a DisplayCustomer() function.

    In pretty much any programming language I've ever used, the code must somehow interface with the GUI. So if you're doing web programming, I think one should be just as comfortable with HTML as they are with their programming language. To me there are many situations where it is more appropriate to have code interspersed with the HTML than to try to output everything from the classes and functions you are using.

    In my experience, this can be just as flexible and maintainable as doing everything within the code. In the above example, I retrieved the customer record and displayed it in a table. If the underlying data ever changed it would easier to fix this than it would be to change the function. And doing this doesn't prevent me from using classes, functions, or HTML templates that speed development and promote code reuse.

    Not only that, but I have to admit, sometimes when I am working with complex tables(tables that have rowspans, colspans, or nested tables) I will often view them with a visual editor like FrontPage, not because I don't know HTML, but because its faster and more productive. I can still do this if I have code inside the HTML, rather than the other way around. Not possible if everything is inside a system.out.println() or whatever.

    --

    No, Thursday's out. How about never - is never good for you?

  20. Re:Nothing But Good Vibes by scotteparte · · Score: 2

    I forgot to mention how the Beans were busted in the Tomcat implementation...

    What I found was that Bean object had trouble loading via the <jsp:useBean> tag. That tag would load a default Bean with no problems. The book recommended that multiple beans of the same type could be loaded as follows:

    <jsp:useBean id="myBean" class="MyBeanClass"/>

    <% MyBeanClass myBeanArray[];
    for (int i=0; i < myBeanArray.size(); i++) {
    myBean = myBeanArray[i]; %>

    <jsp:getProperty name="myBean" property="myProperty"/>
    <% } %>

    Theoretically, the for loop sets each object in the array to myBean, then displays "myProperty". In Tomcat, myBean in the jsp:useBean context and myBean in the scriptlet context were two very different objects. In fact, that code gave me an error for not declaring myBean as a MyBeanClass instance. I found other people with similar problems, but no official bug report or solution/workaround. Any idea, my geek brothers? :)

  21. Re:Java sucks! by harborpirate · · Score: 2

    You are right, Java does multicasting. The difference is subtle. UDP broadcasting sends a UDP packet to all computers on a network segment. Multicasting also sends a message to all machines on a segment, but it uses a special set of IPs. It sends out a packet addressed in a certain range (not your IP) to everyone. One of the problems here is when you try to deal with clients coded in languages other than Java, say C/C++. Multicasting is a harder to implement than a simple IP broadcasting system in most languages, and thus it is a pain to have to work with multicasting just because Java security doesn't allow for broadcasting.

    - harborpirate -

    --
    // harborpirate
    // Slashbots off the starboard bow!
  22. Re:Java sucks! by macpeep · · Score: 3
    Sure, Java has it's drawbacks (hint: where is UDP?), but it has a lot more positives than negatives, in my opinion.

    UDP? As in UDP/IP? It's right there with the rest of the networking classes: java.net in such classes as DatagramSocket, DatagramPacket and DatagramSocketImpl.

  23. Nothing But Good Vibes by scotteparte · · Score: 3
    Before the dot-com slide started to knock out all the loser no-content sites, I worked for one such company. We were using PHP and MySQL to do some CD database stuff, and it was going well until we wanted to implement e-commerce and a universal login system (we had several domains, and wanted one login for all of them). Suddenly, we realized that PHP and MySQL would not be enough for the task at hand. So we bought the JSP book.

    I had never used JSP before - I had never even written Java code! But the book was written well for someone with a background in scripting languages, and I found myself working with JSP projects easily in no time at all. I even learned Java from that book, and did so well enough to get a new job and excel at it.

    As far as the book is concerned, there are two parts which especially interested me. The first was their overview of Javabeans, which was done clearly and concisely. However, you should know that when I set up the Apache Tomcat JSP server, Javabeans were busted pretty bad (just a warning).

    The FAQ example (I believe it is chapter 9) was also excellent, because it introduced some very good methods for web application design. The first is the FAQRepository, which encapsulates DB calls into a single class. This enhances portability and allows changes to be implemented quickly in the case of a DB software or design change. The second is the so-called "octopus" design, whereby an intelligent central servlet does the bulk of the processing, and then passes control off to a JSP "tentacle" for minor alterations and display. This keeps code clean and organized, and allows for great scalability.

    I would highly recommend this book to anyone looking to learn JSP as well as develop a strong technique. I know it did wonders for me.

    Sorry about all the buzzwords ;)

  24. Dynamic Web Content? Philip & Alex. by LionKimbro · · Score: 4

    Sure, you could read this book...

    OR, you could read Philip and Alex's Guide to Web Publishing, and learn everything there is know about creating dynamic web sites, for free. That's right; click on the book, and you'll be face to face with one of the best books (and websites) that I have ever read, period.

    I've bought the book 3 times in print, because it has the highest circulation amongst my book collection.

  25. Re:Garbage by spooge21 · · Score: 5

    You like reading Slashdot, right? Slashdot could be written in Java using JSP for page generation. This is the type of dynamic content that the author is referring to.

    I REALLY wish people would stop immediately associating Java with eye-candy applets. This is, IMHO, the weakest use for Java.

    As a server side language Java is extremely powerful, primarily due to the huge number of APIs available but also due to the basic design of the language and the core API. Java also promotes code reuse better than any mainstream language out there (once again this is my opinion).

    If you don't like Java as a server side language then don't use it. But please, stop saying Java == applets or JavaScript and using that as a reason to trash the Java platform.