You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by hns <ha...@yahoo.com> on 2008/07/14 16:19:44 UTC

about iterating values

hi

it might be this question is not related s2 but still i want to ask

i am using one public function in one class which get key,value pair from
database query fire and fill in linked hashmap
and return iterator to access on jsp page

i have used jsp:usebean of this class to get access public function which
iterate data in page scope
for  my select box

now i have to ask 
when i refresh or redirect this page ,every times Map will get details from
database ,so at  codebehind database accesss happens so many times  when i
refresh or redirect it,

how can i solve this issue
now 
-- 
View this message in context: http://www.nabble.com/about-iterating-values-tp18444913p18444913.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: about iterating values

Posted by Laurie Harper <la...@holoweb.net>.
hns wrote:
> HI
> Thanks for reply
> 
> but session is appropriate for large size map stored in it?
> it can works fine?

It certainly *can* work. Whether the session is the best place to keep 
this data depends on the size of the list, how much it varies (if at 
all) between users, how often it changes, etc. You might be better off 
looking into a caching solution at the persistence layer level (e.g. 
Hibernate or whatever you use), or, perhaps, building a custom 
application cache at the application level (using something like ehcache).

L.


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


Re: about iterating values

Posted by hns <ha...@yahoo.com>.
HI
Thanks for reply

but session is appropriate for large size map stored in it?
it can works fine?
please reply
-- 
View this message in context: http://www.nabble.com/about-iterating-values-tp18444913p18458485.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Action form in session scope

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Larry,
i'm assuming You are talking about s1,
there is no clear answer for your question as for me, because using
session forms is extremely comfortable for developer, no need to worry
about remembering any object acros your app, they just are in session
forms.
But on the other side your session object might get bigger and bigger
with time - not my case so i wont tell You much about it. But there is
more bad news, when user is using back and forward browser buttons and
also forms on your pages rely on session data accuracy You are in deep
... troubles.
When i'm developing in s1 i'm using session forms, but i prefer s2
even without session forms.

Best greetings,
Pawel Wielgus.

On 17/07/2008, Zhang, Larry (L.) <lz...@ford.com> wrote:
> Hello, which is a prefered way to add actionform into session scope or
> in the request scope? Is that true that putting actionForm into the
> session is a bad idea? Thanks.
>
> ---------------------------------------------------------------------
> 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


Action form in session scope

Posted by "Zhang, Larry (L.)" <lz...@ford.com>.
Hello, which is a prefered way to add actionform into session scope or
in the request scope? Is that true that putting actionForm into the
session is a bad idea? Thanks.

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


Re: about iterating values

Posted by Milan Milanovic <mi...@yahoo.com>.
Hi,

you can save it into session and use it to display on jsp page.

--
Milan


hns wrote:
> 
> hi
> 
> it might be this question is not related s2 but still i want to ask
> 
> i am using one public function in one class which get key,value pair from
> database query fire and fill in linked hashmap
> and return iterator to access on jsp page
> 
> i have used jsp:usebean of this class to get access public function which
> iterate data in page scope
> for  my select box
> 
> now i have to ask 
> when i refresh or redirect this page ,every times Map will get details
> from database ,so at  codebehind database accesss happens so many times 
> when i refresh or redirect it,
> 
> how can i solve this issue
> now 
> 

-- 
View this message in context: http://www.nabble.com/about-iterating-values-tp18444913p18450811.html
Sent from the Struts - User mailing list archive at Nabble.com.


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