• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 vc standard MVC vs other frameworks

 
Jay Tai
Ranch Hand
Posts: 221
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have good experience in developing POJOs, but I now need to develop web applications. I'm somewhat lost about the right approach to take. To begin with I want an application that has a security environment (login page, user admin page, roles, etc). Then I need a few jsp pages that query a MySQL DB (eg: a page showing a list of contacts) and another page that does some content/ documents keyword searching.

This is a rough example of the kind of design I'd like to start with, which brings me to my question concerning the right framework and technology. I've built standard JSP MVC type applications on Tomcat before. I appreciate that doing things in this 'vanilla' style might present development overheads and might make the code less re-usable as the application becomes more complicated. I looked into Struts2 framework, bought a bunch of books, understood the basic concepts but i'm still finding it difficult to build the most basic type of Struts2 app.

First of all, there seems to be problems with my IDE (Netbeans) in terms of building the application in the correct directory structure. The apps I built on Netbeans are filled with deployment errors. I also tried using Maven but this didn't help much. I can't seem to find any good books on how to correctly build Struts2 applications in Netbeans. For that matter, a lot of the examples in all of the books I've read don't work in Netbeans.

My questions are:

1) Is there a definitive guide on building Struts2 in Netbeans?
2) Is it better (in terms of my own learning) to start building a standard MVC using servlets and JSPs? Can this application be somehow upgraded and adapted in Struts2 later on?
3) Is there an alternative framework I should be considering besides Struts2 that has a clearer learning path?

Many thanks, J
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to roll my eyes whenever I hear "I can't do such-and-such because the IDE won't let me".

An IDE is a tool that is supposed to help you get things done; not constrain what you can do or get in the way. If the IDE is not helping, get rid of it!

 
Jay Tai
Ranch Hand
Posts: 221
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry. I didn't realize anywhere in my post I've said the IDE won't let me do such and such. Anyway to be crystal clear, I posted 3 specific questions. One of them is on the IDE and my question was about if there's any resources (books, online, FORUMS?, etc) that I could use to learn more about the IDE. If there aren't any of course I will take your advice and give up on the IDE. I always believe in trying to learn from any resource before I give up on it.

Hope this clarifies my question. Please let me know if my 3 questions can be answered.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Tai wrote:Sorry. I didn't realize anywhere in my post I've said the IDE won't let me do such and such.

Jay Tai wrote:First of all, there seems to be problems with my IDE (Netbeans) in terms of building the application in the correct directory structure.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Tai wrote:1) Is there a definitive guide on building Struts2 in Netbeans?

Don't know as I don't use either.

2) Is it better (in terms of my own learning) to start building a standard MVC using servlets and JSPs?

I would say yes. If you don't have a sound basis in servlets and JSP, frameworks based upon them are likely to be befuddling.

2b) Can this application be somehow upgraded and adapted in Struts2 later on?

Not likely without a lot of refactoring of the controller and view layers. A well-designed model should be framework agnostic.

3) Is there an alternative framework I should be considering besides Struts2 that has a clearer learning path?

Learning paths are subjective. Different people learn differently. You should look at the other frameworks (SpringMVC, Grails, Play, Frontman, none at all) to see which best suits you as a developer, and which might be best suited for the nature of your project.
 
Joe Ess
Bartender
Posts: 9256
9
Linux Mac OS X Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Tai wrote:
1) Is there a definitive guide on building Struts2 in Netbeans?


Not that I know of, but I use Eclipse or a text editor.

Jay Tai wrote:
2) Is it better (in terms of my own learning) to start building a standard MVC using servlets and JSPs? Can this application be somehow upgraded and adapted in Struts2 later on?


It's always good to have an understanding of the underlying technologies when writing a web app with a framework. First, it's good to know when the underlying technologies are good enough and when the framework is appropriate. Then it is handy to be able to "write around" the framework when necessary.
That said, a JSP/Servlet app can't be "upgraded" as much as rewritten when you do switch. No matter what framework you choose, there will be some amount of coding/configuring you have to do to accommodate the framework and there will be some code in your JSP/Servlet app that the framework replaces.

Jay Tai wrote:
3) Is there an alternative framework I should be considering besides Struts2 that has a clearer learning path?


If you search the forum, you'll find many discussions regarding the available frameworks, and there are many. I think Spring is currently the favorite. As for a "clearer learning path", I think that is too closely tied to your personal style than any empirical measure, so read up on a couple and choose one.
 
Jay Tai
Ranch Hand
Posts: 221
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a million! Great advice!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic