请给我一个使用Struts的理由。

Struts的优点,大家都可以列一箩筐,如可以通过配制文件定制流程,可以通过FormBean来交验数据,可以通过ActionServlet来把模型和显示分离,等等。我也是看到大家对这个架构的一致好评而想在项目中用一下。可等我花了一个星期来学这个架构后,我却找不到一个能说服我的理由来使用Struts.我们现在的项目是一个电话计费系统。在原来我的开发中,我是一直这样做的。JSP->Servlet->派发。我自己写针对每个需要跳转的JSP都写一个Servlet来控制页面跳转。前台的数据校验我用JavaScript来完成。并且用JavaScript我可以很细的控制Form的提交方式。我的项目需求也不要求改变业务流程。因此我对项目中是否需要使用Struts产生了怀疑。希望得到大家的指点。

奇怪,按你的应用,为什么不干脆用ASP或其他语言开发。
用jsp是赶潮流吧?

可以很简单的绕过Javascript的校验,只需要自己写一个htm文件,作一个类似的form,提交到相同的url就可以了,所以js校验不安全,但是server端的工作少一些

其实如果你觉得Struts不好的话,那就不要用了,
配置起来麻烦,写单一的action也麻烦

不能说自己想用struts,不顾自己的系统的情况就用了,
很多自己实现的方法也许比struts 更高明,它也只不过是个
framework而已,自己写一样可以

如果你真正踏实的研究一下struts你会觉得你知道的太少了!我已经用struts开发完了一个电子商务网站,目前正在兼职为武钢开发部分信息管理系统,也是完全用struts开发的,尽管struts在model层弱一点,但那也不是她不好,学习了模式之后再看看struts,你会更上一层楼!

目前还未有什么比struts更高明的,只是各有所长!struts不复杂!踏实一点的人会学到很多东西!

> Struts的优点,大家都可以列一箩筐,如可以通过配制文件定
> 屏鞒蹋梢酝üFormBean来交验数据,可以通过ActionServl
> t来把模型和显示分离,等等。我也是看到大家对这个架构的?> 致好评而想在项目中用一下?傻任一艘桓鲂瞧诶囱д飧黾?> 购螅胰凑也坏揭桓瞿芩捣业睦碛衫词褂Struts.我们现在
> 南钅渴且桓龅缁凹品严低场T谠次业目⒅校沂且恢闭庋
> 做的。JSP->Servlet->派发。我自己写针对每个需要跳转的JS
> 都写一个Servlet来控制页面跳转。前台的数据校验我用JavaS
> ript来完成。并且用JavaScript我可以很细的控制Form的提交
> 绞健N业南钅啃枨笠膊灰蟾谋湟滴窳鞒獭R虼宋叶韵钅恐惺
> 否需要使用Struts产生了怀疑。希望得到大家的指点。

使用struts可以让你的配置文件简单很多。一个servlet在web.xml中要写两个配置,而在struts.xml中只要写一个。而且struts随着你系统的复杂有太多的好处。

Where Struts Is Going

What will the future bring? It’s impossible to say for sure, but we believe it’s possible
to extrapolate at least a little.
Integration with JSTL
As the various applications servers adopt JSP 1.2, they can take advantage of the full
power of the Java Standard Tag Library (JSTL). The main effect that this will have on
Struts is to provide a much more powerful alternative to the Struts Tag Library that
interoperates with non-Struts platforms.
As a result, you should expect to see the Struts tags gradually fall out of favor as time
progresses.
Integration with JavaServer Faces
In addition to being a key Struts contributor, Craig McClanahan is also deeply
involved in developing the JavaServer Faces specifications. Not surprisingly, Struts
and JSF will become closely intermingled as time progresses.
Again, the main effect will be to de-emphasize the importance of the current Struts
tags because the combination of JSTL and JSF (which work together) will make the
proprietary Struts tags obsolete.
Struts Will Become More Widely Accepted
At the time of this writing, Struts was about to have its 1.1 release. This release is a
major improvement over the previous one, both in features and code stability. As a
result, it will become a more attractive platform for commercial applications
development.
These things feed on themselves. As Struts becomes more popular, more people will
contribute bug fixes and new features, which will in turn make Struts more popular.
Certainly Struts will be the predominant applications framework inside the Jakarta
community.

--《Struts kick start》


////////////////
当Struts已经成为事实上的MVC标准的时候,我们竟然还在讨论是否该使用?!!!


在《struts kick start》中提及MVC最早是在1970s后期出现在Xerox PARC研究所,40年了!!!!

看看几大工具商支持的mvc是什么?

当然,struts并不是万能的,就如java不能取代其他语言一样,使用合适的产品才能适合各种项目;)

> 当Struts已经成为事实上的MVC标准的时候,我们竟然还在讨?> 是否该使用?!!!


话是没错,不过总是要向前走的吧?在流行使用Struts的时候出来的反对意见,你不觉得很难得吗?

我使用Struts开发了一个电子商务的应用,的确有它的方便地方,比如在配置文件中可配置对应的处理方法名称,一定程度上精简了代码。

同时,开发过程中碰到更多的是不便:
1)Struts学习不是很简单吧?莫名其妙的使用毕竟不放心。
2)标签库的使用比较不认同,标签库如果不用的话,Struts还有多少内容?使用标签库的话,很多程序就会受到标签库的限制,要等待标签库的完善?难。
3)一不小心就会写了很多的类,实在是太费时了,即便是一个简单的功能。
4)庞大,MVC核心不会这么大的,如果仅使用Struts核心怎么办?没办法,全部加进来,模块分得不满意。
5)至今还是觉得烦琐。

很希望能有个Struts的精简版,甚至替代物,简化、方便开发