I will try to put in simple way but this may not be complete picture.

What I am really struggling in is I have processing result in the form of
List of objects. Now if I send this list of objects through request object
to the JSP I have to do all processing on JSP with scriptlets. What would be
the best practice to send such list to JSP ready to grab.

 

Dave Newton-6 wrote:
> 
> The scriptlets should be replaced by JSTL/custom tags/etc. Anything
> that can't be trivially implemented using tags should probably happen
> on the server side.
> 
> Other than that, I'm not sure what kind of information you're looking
> for--maybe you could be more specific if you need further help.
> 
> HTH,
> Dave
> 
> On Thu, Sep 9, 2010 at 10:17 AM, anjibman <anji...@hotmail.com> wrote:
>>
>> I need the guideline on how to manage data transfer between JSP and
>> action
>> class. I am using delegate in Action class to get an list of object from
>> the
>> server and I have to process then display that list in JSP.
>>
>> Right now I am getting that list as object from server in action class,
>> put
>> it in request object and write scripplets in JSP to process the list in
>> the
>> request object then display it.
>>
>> I don't think it is good practice to put scripplets in JSP. I am not sure
>> where to put those processing part in different class or in Action class
>> itself or its ok in JSP itself.
>>
>> It will be great if anyone can show me with an example to write the code
>> in
>> manageable way.
>>
>> General implementation what I have right now is:
>>
>> Action class
>> Delegate delegateObject;
>> resultList = delegateObject.getResult();
>> request.setAttribute("result",resultList);
>>
>> JSP
>> <%
>>   result = request.getAttribute("result");
>>   for(loop){
>>     //Loop to result and display using html tags.
>>     //e.g. <TD><%= someField %> </TD>
>>   }
>> %>
>>
>> Thanks in advance
>> --
>> View this message in context:
>> http://old.nabble.com/Managing-code-between-Action-Class-and-JSP.-tp29648167p29648167.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Managing-code-between-Action-Class-and-JSP.-tp29648167p29670923.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to