Tuesday, March 29, 2011

Struts Royally Sucks

I have heard that 100s of times, and I have vague memories of myself struggling, some 7 years ago, against Struts quirks and all those HORRIBLE tag libraries (writing code in XML? Noooooo way.).

I have even hoped to be able to mock Struts, instead of having to deploy in container,
using this http://strutstestcase.sourceforge.net/ framework...

I use MockStrutsTestCase in a very basic setup and I get this:


java.lang.UnsupportedOperationException: getPathTranslated operation is not supported!
at servletunit.HttpServletRequestSimulator.getPathTranslated(HttpServletRequestSimulator.java:635)



no matter what I try...

So I am switching to MockRunner which so far seems to work.

There are also plugins for JUnit and Maven:
http://struts.apache.org/2.2.1/docs/struts-2-junit-plugin-tutorial.html
http://struts.apache.org/2.0.14/docs/testng-plugin.html


This framework is THE BLACK WIDOW MAKER of Front End Developers.


My advice: just throw Struts in the toilet and flush, you will immediately feel an intense relief. Then implement your Front End in Spring MVC or Vaadin.





Here more reasons why Struts sucks.

No comments: