You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by M Murali <go...@yahoo.com> on 2005/03/04 01:30:36 UTC

Struts Or Spring

We are kind of middle of deciding go to with which framework.Can some one help. On high level, we have an application where data gets from webservices and is displayed to user thru JSP.  the webservices access is done thru Axis and the proxy class generated are used on JSP side. Each proxy class holds data specific to businesslogic. In order to access these data , it looks like we need to create a form bean exactly to match with proxy class for accessing at JSP.  Is there any way around creating a formbean for each dataclass?? 

for example: in JSP we have

<%

 LineInfo[]  infos = LineBean.GetAllLines();

%>

<form>

        <% for (int = 0;  i < infos.length; i++) %{>

                <input type=text  value = infos[i].LineNo>

                <input type=text  value = infos[i].UserName>

             <% }%>>

</form>

 

how can this be done using struts. Do we need to create a  LineInfoFormBean ?? THe LineInfo is a proxy generated data class, if we have to create a FormBean for each dataclass, then it would be very in efficient and this would be duplicate of get/set from data class. Is is possible??   I heard the same can be easily using Spring.  Any ideas, which one is best suits here.

Thanks in advance.




		
---------------------------------
Celebrate Yahoo!'s 10th Birthday! 
 Yahoo! Netrospective: 100 Moments of the Web 

Re: Struts Or Spring

Posted by Larry Meadors <la...@gmail.com>.
Struts does not require a form bean. Doing what you are describing is
trivial with struts tags or even vanilla jstl tags. If you are using
servlet 2.4 (tomcat5), it is even more trivial. They all use
reflection to get to the properties, and the beans can be in any
scope. I guess I am making the assumption that they are beans, and not
classes with public members.

IMO, your jsp would be way cleaner because your action could do all
the interaction with the business layer (instead of using a
scriptlet).

Larry

On Thu, 3 Mar 2005 16:30:36 -0800 (PST), M Murali <go...@yahoo.com> wrote:
> for example: in JSP we have
> 
> <%
>  LineInfo[]  infos = LineBean.GetAllLines();
> %>
> <form>
>         <% for (int = 0;  i < infos.length; i++) %{>
>                 <input type=text  value = infos[i].LineNo>
>                 <input type=text  value = infos[i].UserName>
>              <% }%>>
> </form>
> 
> how can this be done using struts. Do we need to create a  LineInfoFormBean ?? THe LineInfo is a proxy generated data class, if we have to create a FormBean for each dataclass, then it would be very in efficient and this would be duplicate of get/set from data class. Is is possible??   I heard the same can be easily using Spring.  Any ideas, which one is best suits here.
> 
> Thanks in advance.
> 
> 
> ---------------------------------
> Celebrate Yahoo!'s 10th Birthday!
>  Yahoo! Netrospective: 100 Moments of the Web
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org