struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: how can i get my servlet result to jsp page
Date Fri, 16 Nov 2007 13:42:42 GMT
Why wouldn't you just expose an action property
through normal means?

--- Thilo Ettelt <te@carmunity.de> wrote:

> sure, in your action method you can define:
> 
> ValueStack stack =
> ActionContext.getContext().getValueStack();
> 
> and then fill whatever object you have into the
> valuestack:
> 
> String sample = "Hello World";
> stack.set("myIdentifier", sample);
> 
> In your JSP you can use the s:property tag to
> display your String in 
> this case:
> 
> <s:property value="myIdentifier"/>
> 
> you can put any ognl expression into the value part,
> read the docs for 
> more info on ognl.
> for example you could have put an array onto the
> stack and call the 
> object at index 5 by using:
> 
> <s:property value="myIdentifierArray[5]"/>
> 
> You can also call methods like this method of a
> String object:
> 
> <s:property value="myIdentifier.toLowerCase"/>
> 
> 
> - Thilo
> 
> vijay vijay wrote:
> > Hi can u give me some sample code to me
> >
> > On 11/16/07, Thilo Ettelt <te@carmunity.de> wrote:
> >   
> >> Access the ValueStack in your action, it allows
> you to store objects and
> >> you can retrieve them from your jsp. You might
> need to know about the
> >> ActionContext object accessable from your action.
> >>
> >> Read more from the docs :)
> >>
> >>
> >> - Thilo
> >>
> >> vijay vijay wrote:
> >>     
> >>> Hi
> >>>        i am writting a database connectionin
> action, here i wanted to
> >>>       
> >> put
> >>     
> >>> tth result back in to a jsp page.
> >>> in jsp what i need to write
> >>>
> >>> any one help me here
> >>>
> >>>
> >>>       
> >>
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail:
> user-help@struts.apache.org
> >>
> >>
> >>     
> >
> >   
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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


Mime
View raw message