Fog Creek Software
Discussion Board




Creating Web Clients

I am pretty familiar with Microsoft technologies. I have recently started studying j2ee and have a question on what web client would be better.

JSP: I researched the newgroups and there seems to be many complains on JSP. This may have changes lately if there are new specs released.

Servlets: Ditto

Combination of JSP/Servlets: This seems to be the latest trend - most posters have posted using this lately. But I could not find an article to describe an implementation.

Applets: From the news groups, there seems to be a decline in the interest of Applets as Microsoft does not ship the latest version of JVM. Aside from this I am not sure of the drawbacks on Applets.

Swing: Same problems as Applets?

J2EE is a lot harder to grasp than a Microsoft solution - there are many disparate information from diferent vendors.

Can posters share their experiences on the above - it can be a challenge to find unbias information.

Ram Dass
Tuesday, September 30, 2003

How interactive does your client have to be?

Matthew Lock
Tuesday, September 30, 2003

"J2EE is a lot harder to grasp than a Microsoft solution - there are many disparate information from diferent vendors. "

I have found this aswell, it is hard wondering where I should start looking to get started in J2EE development. When we are so used to the Microsoft way of it works out of the box, it seems wierd that to program in J2EE I need to download an SDK from SUN, a server from IBM and an IDE from Borland. Is this correct? Is there a "one stop shop" on getting started in J2EE?, like what software I?, need where I get it? and how I install it?

The reason I would like to try J2EE is to see if it is something we should be considering for our future projects as opposed to dotnet. And I would like to be able to give an accurate answer to my manager next time he asks about a J2EE version (probably the next time it is just another checkbox on a requirements list).

ChrisO
Tuesday, September 30, 2003

"How interactive does you r client have to be?"

The interactive nature woulld be similar to a travel site (like Expedia) or a University course registration site.

These can work well with ASP.NEt (Provided that .NET is considered stable) but I am not sure what would comparatively work in j2ee.

Ram Dass
Tuesday, September 30, 2003

"Is there a "one stop shop" on getting started in J2EE?, like what software I?, need where I get it? and how I install it?"

Not really - unless I am mistake.

The best way would be to download the Eclipse IDE from www.eclipse.org - you will need to download the JRE from Sun to make this work.

Eclipse comes with Tomcat, which can work well as a low load server. For better performance, Apache can be used.

Databases are Oracle, DB2 and maybe Sybase.

I am learning as I go along - so some of my information above may not be 100% correct. I hope other posters will correct me if I am wrong.

Ram Dass
Tuesday, September 30, 2003

The major problem with JSP is the major problem with any solution that allows you to put business logic into a view (e.g. ASP, Cold Fusion): maintainence is a lot harder than it could be.

"Best practice" in Java is to use a servlet to co-ordinate between business objects and JSP pages. The servlet can analyse the HTTP request (e.g. query parameters), invoke some business objects to do processing and then send values to a JSP page in the following way (roughly):

// servlet code - e.g. body of doPost or doGet
...
request.setAttribute( "now", new Date() );
request.setAttribute( /* you can put other stuff in here */ );
RequestDispatcher dispatcher = request.getDispatcher( "my.jsp" );
dispatcher.forward( request, response );


In your JSP page (my.jsp) you can access "now" as follows:

<jsp:useBean id="now" type="java.util.Date" scope="request"/>
Time in milliseconds: <%= now.getTime() %>


Yes, it is more complicated than ASP, but it promotes separation of concerns. You can use the ASP approach, but that is not the recommended approach (java.net got royally flamed for an article promoting ASP-style JSP pages with SQL queries in the page).

Something that typifies Java is that you have a lot of options here. You don't need to use JSP for your views (e.g. you could use Velocity). You don't need to run Tomcat, etc, etc. This wide array of options has both positive and negative aspects.

Also, you can download tutorials from the Java site - http://java.sun.com/ - including ones that cover J2EE. I'm not sure how useful the J2EE one is in particular, but at least some of the tutorials definitely have their moments.

My other standard J2EE recommendations are:
* Spring Framework - http://www.springframework.org/
* The book that inspired Spring Framework ("Expert J2EE", Wrox)
* IDEA - http://www.intellij.com/
* Two other books: "Effective Java", "The Pragmatic Programmer"

Good luck!

Walter Rumsby
Tuesday, September 30, 2003

BTW, a JSP page will get compiled into a servlet (managed by your app server - invisible to you), but the point is that the servlet is the key part of the Java web solution. While they may seem intimidating at first make sure you understand them, then JSP will be a breeze.

Walter Rumsby
Tuesday, September 30, 2003

JSP and Servlets may send HTML, Images, PDF files and similar stuff to web browsers, which all browsers are able to display. If you don't use Applets, then client browsers not need to provide a support for JVM at all.

Evgeny Gesin /Javadesk/
Tuesday, September 30, 2003

JSP pages == ASP pages
Servlets == custom activex objects in the page

Applets are purely client side and not much used these days, although they can communicate with the server using sockets and other mechanisms. They can be more elegant than JSP/servlets, but generally for particular technical applications.

Swing is a particular way of creating the UI for an applet. Again, not that relevant for web apps.

Sun's IDE is OK.

There are a few needless complications in the J2EE approach that make me suggest .Net as a cleaner, more robust approach.

.
Tuesday, September 30, 2003

As a mainly J2EE guy, let me say that Walter Rumsby's comments are right on track. Also:

1) Most of the time the web client is a browser that renders HTML and JavaScript. It is confusing terminology to describe the server side software that generates the HTML as the web client.

2) J2EE is a bundle of APIs that include servlets, JSP, JDBC, and EJBs. The EJB part is probably the most controversial component and many, if not most major Java applications do not use EJBs. If you don't use EJBs, then servlets / JSP / JBDC becomes a lot like .Net with asp(x), C++, and ado.net.

3) Microsoft is ahead of Java right now in its support for WYSWYG development of web applications. Java should catch up with the new Java Server Faces technology.

4) Many vendors do support one stop shopping, just as Microsoft does. These include BEA, IBM, Oracle, Sun, and Borland. Similarly, they charge money.  The thing about Java is that if you know what you're doing you can assemble a nice solution from pieces that are free.

5) Java applications can generally run unchanged on a variety of machines. Some people want to be able to run on Linux, Solaris, IBM mainframes, etc, and Java makes that all possible.

Ken
Tuesday, September 30, 2003

Your web "client" is the browser. Now, you want to send something interesting to the browser so the user can interact with a software system? Think about what you want the system to do, how much time you expect users to be using it, and what your available resources are. I've found that doing dynamic web pages with Java is convoluted. I currently use Perl with some excellent support modules like CGI::Application to do web application development. PHP is a very good web programming language as well. Whatever language you use, be sure to use templates or a similar idea for the output HTML. That way you keep the visual layout separate from the data that feeds it and you'll help to make your system maintainable.

Chris Hagglund
Tuesday, September 30, 2003

Ram, are there any techologies without complaints?

And since you are already familiar with MS won't
anything seem complex by comparison?

Any technology is also a culture. It takes a while
to become friends with the natives.

somebody
Tuesday, September 30, 2003

WebObjects ( http://www.webobjects.com ).  It's java-based, works in J2EE, and has good separation of concerns (app logic, HTML, database).  Trust me on this one.

Even if you don't go with it, the design ideas within its architecture will help you design your own web application.

H. Lally Singh
Tuesday, September 30, 2003

Oh yeah, I should mention: It's not obvious on the product page, but it'll run on any Win32, Linux, Solaris, or any reasonable Java platform..

H. Lally Singh
Tuesday, September 30, 2003

Using JSP as "View", Servlet as "Controller", EJB as "Model" is called JSP Model 2.

To find out what J2EE clients to use for your situation, I think this ebook will help:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/index.html

You can also download it as a PDF file.

Patterns Guy
Tuesday, September 30, 2003

Do any of you know of a J2EE RAD tools that offer a similar approach to webapp development that Delphi, MS Access, Visual Studio and do?  Something that lets me visually design a web page composed of 'widgets' (JavaBeans?  JSP tags?) available on a palette.  Preferably widgets that are persistent or database-aware in some fashion.

Background: we just finished up a small Struts-based application -- our first foray into J2EE (we are mainly an MS shop).  The lack of a graphical builder really slowed us down.  I can't remember how many times a simple misspelling or capitalization mistake tripped up me or one of the other guys.  Keeping everything consistent between the XML files, Java source code, database config files was not easy!

J2EE Newbie
Tuesday, September 30, 2003

Considering the market share of Windows + IE and the use of developing applications in VB... if you intend to rent this web application (ie. customers know beforehand what the requirements are), you might want to take a look at embedding ActiveX controls in your web page... No need for a JVM :-)

Frederic Faure
Tuesday, September 30, 2003

Struts Studio - http://www.strutsstudio.com - is quite nice as a graphical builder for Struts applications.

John Topley (www.johntopley.com)
Wednesday, October 01, 2003

*  Recent Topics

*  Fog Creek Home