Hi,
I have been working with
Java for about a year now and have slowly progressed from small command line programmes to
jsp pages with scriptlets, to using beans and finally to using JSTL. I have been expecting my next step to be using some sort of web framework but have come up against a few issues.
First of all, for me as a programming newbie, the configuration and some of the concepts of typical frameworks (
Struts,
JSF etc) are a bit overwhelming. I am constantly trying to make my next project better organized and more up to date than the previous one so for my latest (building a new Intranet that will house custom tools and building some of those tools) I started looking at MVC frameworks. It felt like it was going to take longer to learn than I really had available to me at the time. I thought to myself, I'll try to work myself into it by first using JSTL.
This has improved the look of my code a hundred times and it horrifies me to see my old pages, covered in scriptlets! Then I looked at frameworks again and it seemed to me that they were more effort than they were worth so I decided to take a different path that would at the same time give me some more Java experience.
I have written two programmes, one to read a database table and create a bean and another to read a bean and create a form. I don't know whether this is a good or bad way of doing things but in my beans I have a setPopulate method which fills in the bean from database data and getValidation which carries out server side validation and puts bean data into a database.
My web pages have no business logic in them, JSTL is just used for presentation logic. I do use individaul 5 or 6 line jsp pages as 'controllers' when submitting forms however. They usually contain no more logic than the following
I can now create a Web application in a very short period of time. I just create a database table, run my two programmes, fill in the serverside validation in the bean's getValidation method and finally put a
line into a standard jsp that includes all my css and headers and footers etc.
Now I know that there must be a reason why more people don't do what I am doing but what is it? I want to move on and still think I should be using a proper web framework (if for nothing else than to make my CV look better)! But what do these frameworks do that my present way of doing things doesn't? How would they make things quicker for me?
Also, does anyone have any interesting opinions about the current 'I must use an MVC framework' trend?
Thanks.
P.S. If anyone wants any of my code, feel free to ask. It's only basic at the moment but I plan to make it into an Eclipse plugin and any help or suggestions would be greatly appreciated. Like I said, I'm still only a begginner so you may look at it and think it's a bit dodgy but if you could tell me how I should change the way I do things or if you would like to contribute that would be fantastic.
P.P.S. Am I posting this in the right type of forum?