This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Appologies in advance for possibly posting in the wrong forum, but if you read on you may understand why !
I have for the last 18 months been writing a J2SE (1.5) Java application that runs on a users desktop. It uses Swing & some AWT. I would like to extend the application so that some elements of it can be run from a wireless 802.11b device running Windows (versions vary). I have done some experimentation installing IBM's J9 JVM on a PDA and using RMI to connect to my development machine. I work's, but it was problematic to get the PDA configured with J9 and SWT and ideally I would like a solution that would be very easy to deploy.
So, I think I heading towards a web based application, but I have been totally blown away by the number and diversity of Java based J2EE technoligies out there, servlets, struts, velocity, jsp and so on. Frankly I don't have time to investigate all these possibilities so I am hoping that if I can highlight my requirements someone can prepare a shortlist.
2) I would like to utilise my existing business logic Java class library (.jar) which I've created for the desktop element of the application in the server side logic. I don't mind having to create some form of wrapper's around calls to my existing code, but I don't want two separate versions to maintain.
3) I would like to adopt a technology which is well known, well supported and has a good future (shelf life). I have a habit of learning stuff just as something better replaces it.
4) I would like to be able to develop and deploy using the latest Tomcat server software on my laptop.
5) The application would require user sessions to be persistent (sorry of this is the wrong terminology), so for example they can logon and have their username and password validated by using my existing class library, but have an instance of that class held in server memory so that when they perform a transaction I can use this information to check permissions etc.
I don't mind learning something new, but I would like to have some assistance picking the correct technology in advance.
I think a simple web application infrastructure is sufficient for your need.You may consider learning Struts , servlets ,jsp.While writing view components you might see like what all html components are well supported by the mobile browser that you might use.
Perhaps I should elaborate on my question. When you browse through Amazon's bookstore you can find books on each of these subjects, which implies that they are solutions in their own right. Do you know of any good resources (links or books) that would illustrate which bits (servlets, jsp, struts etc) do what. Which my limited knowledge I assume that the servlet is the business logic side of things, whilst struts and jsp are used to build the presentation (html) side of things. If so they does struts incorporate jsp ? If not they when do I use one rather than the other ?
Just as we often recommend people start Java with a text editor rather than jump into an IDE, I'd recommend starting Java web with naked servlets & JSPs rather than a framework like Struts. Ben Souther, one of the regulars here, has a nifty set of Simple Servlet Examples that start with about the least code you can possibly make run. Invest a day and see if those make sense to you. After you build a few simple pages you may bump into some of the problems Struts was meant to solve. Or not.
BTW: Persistent state to mimic what's held in memory in a Swing app can be hard to scale past a few users. Let's defer that conversation until you have played with servlet a bit.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Thats very helpful. Many thanks. I will start with servlets, however do you mean that the servlet approach may be wrong if I have too many users, or just that it might require a complicated design to get it right.
Originally posted by David Garratt: however do you mean that the servlet approach may be wrong if I have too many users
No, he was talking about persistence. Servlets/JSP scales well to many users.
that it might require a complicated design to get it right.
The urge today seems to be to create over-complicated and over-engineered Rube Goldberg designs to solve simple problems. Hence the popularity of large frameworks.
I'd advise to keep things simple until or unless you have a good reason to go complicated. A simple front controller and native servlets and JSP is all that is needed for the vast majority of web apps.
Could I also ask you to consider jsf for my needs. I get the impression that it allows user interfaces to be built from a standard set of components, what would the advantages/disadvantages be for me with this ? Sorry if I'm drifting off topic but I would like to keep the same thread/topic running.