Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I have just started learning struts 2. I have purchased the book named Struts 2 in action. But I want to use an IDE for developing Struts 2 applications. I basically use netbeans.

Please tell me how can i develop applications using netbeans. Also, it would be great if somebody can point out a few tutorials on the same.


P.S. I haven't used eclipse. Is it advisable to switch to it for struts 2, (if it is better than netbeans in this case)?

share|improve this question

2 Answers 2

Further edited in light of revised information

It would seem that your professor is keen to have you continue the work of the previous developers. I'm not sure I agree with him on the ease of learning Struts2 vs SpringMVC, but I can see his point. He is clearly keen to stick with a chosen framework that is well understood within the faculty.

There is some backwards compatibility between Struts1.3 and Struts2 but it is limited and you may find that you are better served by just rewriting the original work in Struts2. Of course, this assumes that you are working within the web application, not just consuming it's output. If you are consuming it's output, then you don't care what it is using to manage views and page transitions internally, just so long as you can get the content.

In short, it appears that you're stuck with Struts so just make the best application you can with it.

Edited in light of comment

Given that you are a student, and the team leader of this project, then you must balance your lack of experience with the technology with the responsibilities that come with leading the team.

On the one hand, Struts2 is capable of solving your problem. It's a reasonable framework and will certainly introduce you to web application programming in Java in a manner that will be useful in the future.

On the other hand, I (and many other developers) favour SpringMVC because it makes it absolutely clear how the Model, View and Controller are interacting. It also introduces the overall Spring framework approach to your web application which promotes good coding practices throughout (dependency injection, externalisation of configuration etc).

As an aside, here is a brief overview of the key concepts in SpringMVC. Your application context contains the URI mappings to determine the entry points to your application (the Controllers) and the exit points (the Views). The Controllers call in to the services and business domain to get stuff done. The result of the work done by the services is turned into a ModelAndView object which is then used as the basis for the response. This response could be decorated by a JSP (in which case the contents of the ModelAndView is visible to the JSP) or could be directly marshalled as XML, or perhaps treated as a PDF or Image.

In answer to your question, I would go with informing your professor of your reservations with Struts2, but make sure you have an example of the same code written in SpringMVC to hand. Extol the virtues offered by Spring and do your best to win your case, both for yourself and the rest of the team who will be affected by your professors final choice.

If your professor is reasonable and you put your case well then you will learn how to deal with management for your future career - valuable experience indeed.

After chatting to numerous developers with experience with Struts2 I would counsel you away from it. There are better, more intuitive frameworks out there that just make the whole page navigation and security issues straightforward. I'm thinking SpringMVC and RESTEasy here.

However, you want to know about Struts2, so here is a handy tutorial that should work fine in NetBeans. There is a detailed alternative for SpringMVC which targets Eclipse should you want to go that way. Although Eclipse is a fabulous IDE, if you have more experience with NetBeans then stick with that until you're confident enough with your coding to make the move.

Make sure you understand what the Struts2 framework is doing for you over and above the underlying servlet API, and take time to understand HTTP and it's limitations.

share|improve this answer
Thanks Gary, Actually, I have just started learning struts...I am a student...and there is this Warranty forecasting Project which our professor has taken up from some company, so he has made a team of which i am the team leader...he asked us to learn struts and so we have started it...IF you think struts is actually not all that good, do you suggest me to talk to him about it...cuz it's still just the beginning...or is it ok to learn it and then move onto some other framework? –  shahensha Nov 9 '10 at 6:08
@shahensha Edited my answer to better answer your comment –  Gary Rowe Nov 9 '10 at 9:18
@shahensha Did you ever reach a conclusion for this situation? If you did, you might want to consider posting it as an answer to help others. –  Gary Rowe Dec 6 '10 at 17:41

@Gary sry for replying late....was busy with exams...I talked to my professor and he in fact agreed to whatever u said...But he raised couple of points to which i had no answer

(i)Our senior batch has already done some work in Struts 1.3 and we have to reuse their work..(now i seriously don't know whether we can do that with springs)

(ii) He feels, as beginners we should start with a more simpler framework like struts 2, cuz Springs is tougher to learn for us beginners!

It would be great if you can clear these doubts...

share|improve this answer
Rather than posting this as an answer it would be better as either a comment on the answer or an update to the question. –  ChrisF Dec 22 '10 at 11:49
As @ChrisF has pointed out, it is better that you edit your original question to include your additional information then delete this answer. Any further changes/responses you make to it will be automatically flagged to me by the system. I'll update my answer accordingly. –  Gary Rowe Dec 22 '10 at 12:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.