I'm an experienced Java/J2EE dev and I've written an internal J2EE app for a company which runs on a very old JBoss-2.4.4 and is accessed only through Swing interfaces which I have written. I have now been asked to make all new interfaces web-based, meaning any new stuff should be web-accessible and I may also have to convert the older interfaces to web pages.
The only problem is that I have NO experience using J2EE over the web. What I mean is that I have only ever used it with Swing interfaces and looking at the web technologies available (Tomcat, Struts, JSF, Spring, Tapestry, etc) I am confused as to which way to proceed. I am currently in the learning phase and I have been given a very tight deadline (maybe 1 or 2 weeks) to come up with a viable web-based solution.
I have started to read about struts and will try to do some tutorials in it and get some stuff working to get a feel for it and I assume I will have to do the same for the other frameworks before I have a chance of making my own decision. I also have the 'Core J2EE Patterns' book and am hoping to cram in as much of the knowledge there as possible. It seems that book has a lot of web-centric patterns though I suppose one could apply them in other cases.
But I would like some guidance from anyone here who has experienced such a similar transition and has had to implement something like this.
I would like to know if maybe Struts is overkill in my case, or maybe JSF is now a better way to do this? Or just straight servlets with Tomcat?
I am afraid you are in for a long hair-pulling ride. The plethora of J2EE frameworks can make it very hard to choose one. They all have their place though.
Now, you don't really need to use any of the frameworks. If it is a small application, you can very well write the web interface using Servlets, JavaBeans, JSPs and JSTL. Make sure that there is adequate decoupling between the business logic and web MVC layers. Read up on Front Controller pattern, if you haven't already done so. Rod Johnson's first two books address issues in web MVC design quite well.
If the application is big enough and you decide to you a framework, I recommend having a look at Tapestry. Tapestry provides a component based development model for web frontend (so does JSF). I have only looked at these two briefly, but I found Tapestry to be much more elegant than JSF, JSF code just looks ugly!! Another component based framework, which is said to be much simpler with a shorter learning curve, is Wicket. [Edit: I recommended these because you are coming from Swing background and may feel right at home writing components. A lot of people who start with request-response based frameworks like Struts etc. find component based web development too complex and hard to adapt to]
If you decide to ditch component based development, and go for request-response based development, I would recommend Spring MVC. The other choices are Webwork 2 and Struts. If you do a google search on saloon.javaranch.com, you will find a few posts comparing Spring MVC with Struts.
Good Luck, and HTH [ November 28, 2005: Message edited by: Sonny Gill ]
Thank you so much for both your replies guys. I have so far been too busy to look into it any further but at least with your suggestions, I have a better start at it. I was initially going to go full-on struts but now I will just skim the struts stuff and try to focus more on JSF and also Tapestry.
Thanks once again for the suggestions, I will let you know about my progress
subject: best way to make my internal j2ee app web-based?