You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Ivey <cb...@comcast.net> on 2004/02/09 18:44:08 UTC

Passing an ArrayList

I'm working on an application that prompts a user to enter data into 4 text
fields.  The user then clicks on a button to submit these to an Action.
These 4 values are used to create an object that is added to an ArrayList.
The page used for data entry is refreshed with the just entered values
appearing as a row in a table.  The user may do this as many times as they
wish.

My problem is that the ArrayList is recreated every time the Action is
called.  I understand that this a characteristic of the transient nature of
Actions.  Can anyone make any recommendations on possible ways to preserve
this ArrayList between calls to the Action.  I'm betting that this could be
resolved by stashing the ArrayList into the request as an attribute or
something similar, but would like some commentary on this issue.  BTW, the
project this application is for mandates only request scope be used.

Thanks,
Brian Ivey


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


repost: Performance statistics with struts

Posted by shankarr <sh...@adventnet.com>.
Hi!
I had to repost it again as no one answered it previously.
Any reply is greatly appreciated.

Richie
At 01:10 PM 2/18/2004, you wrote:
>Hi!
>I would like to get some figures showing what is the performance gain/hit 
>using Struts1.1 with Tiles
>We are currently using struts1.1 with tiles in our development and am 
>getting to hear that because of the multitude
>of entries in the xml files, there is a slowdown occuring.
>I do not know how much is a fact, but was wondering if anyone else has had 
>the same problem and solution for the same.
>
>I agree that it may not be with struts but with our design, but  just 
>wondering if I can get any already available info.
>
>Richie
>
>
>"To achieve all that is possible, one must attempt the impossible"
>

"To achieve all that is possible, one must attempt the impossible"


Performance statistics with struts

Posted by shankarr <sh...@adventnet.com>.
Hi!
I would like to get some figures showing what is the performance gain/hit 
using Struts1.1 with Tiles
We are currently using struts1.1 with tiles in our development and am 
getting to hear that because of the multitude
of entries in the xml files, there is a slowdown occuring.
I do not know how much is a fact, but was wondering if anyone else has had 
the same problem and solution for the same.

I agree that it may not be with struts but with our design, but  just 
wondering if I can get any already available info.

Richie


"To achieve all that is possible, one must attempt the impossible"


Re: Setting nocache

Posted by ru...@albany.edu.
Hubert:
 Thanks for the info.  Based on my attempts, and speaking from a position
of ignorance I believe I am unable to use transaction tokens from my
initial login. I believe it's due to the way I set up entry into the web
app. ??

http://<entryURL>/ --forward----> index.jsp (submit to loginAction)
                         failure --^
                         success--> .interface.tile

That is, I have no initial action (breaks MVC2?).
Consequently, the index.jsp page where my login form resides is being
presented prior to any action where I could use saveToken().  ??

I assume this is also why the redirect="true" on the forward does not
prevent a re-POST?

In any case, I'm satisfied with what I have for the login portion. I chose
to use the fact that I store a user object in the session for
authenticated/authorized users. Re-POSTs to my login action for users
already logged in are just ignored now.

However, I can see how the transactions tokens will come in handy for the
remainder of my app. :)

Thanks to all who answered,
-Ryan

> Take a look at Struts transaction tokens.  That will help provide your Action
> with a flag to ignore successive transactions (in this case, logins), even
> when the user hits "ok" on the resend prompt.
> If you don't want the user to even see the resend prompt, you can redirect to
> the view after the transaction.  Even with a redirect, though, you might
> still want to add the transaction token checking.
>
>  - Hubert
>
> --- russo@albany.edu wrote:
> > Hi Jay:
> >  Thanks for the response. That didn't have the intended result but, it
> > appears to be working when I look at the headers.
> >  Maybe my goal's not clear?
> >  Outline of steps in my web app. and where I want to prevent repost as
> > follows:
> > 1) http://<host>:<port>/afadmin/
> >   presents login form
> >
> > 2) On successful login user info is stored in session and user is
> > forwarded to view:
> > http://<host>:<port>/afadmin/console.afr
> > At the moment this is just simple page with a header, menu, body and
> > footer.
> >
> >  If you hit the refresh at this view the browser still has the post data
> > from the login view and if I click "OK" it re-sends the login information.
> >
> > Is there a way to prevent the repost on the client end? Or, at least
> > indicate to the client that I'd like it to forget about the post
> > information from the previous view?
> > Or, am I approaching this incorrectly? Should I just ignore the re-post in
> > my loginAction ?
> >   I found this but, in my present state of mind (too darned tired) it
> > seems like overkill:
> >  http://www.livinglogic.de/Struts/
> >
> > Thanks,
> > -Ryan
> >
> > > In your struts-config.xml <controller> element, thus:
> > >
> > > <controller>
> > >
> > >     <set-property property="nocache" value="true"/>
> > >
> > > </controller>
> > >
> > > Jay
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

|----------------------------------|
| Ryan Russo                       |
| russo@[noSPAM].albany.edu        |
| University at Albany--Computing  |
| <<remove [noSPAM] to e-mail>>    |
| Technical Services Web Team      |
|__________________________________|

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


Re: Setting nocache

Posted by Hubert Rabago <ja...@yahoo.com>.
Take a look at Struts transaction tokens.  That will help provide your Action
with a flag to ignore successive transactions (in this case, logins), even
when the user hits "ok" on the resend prompt. 
If you don't want the user to even see the resend prompt, you can redirect to
the view after the transaction.  Even with a redirect, though, you might
still want to add the transaction token checking.

 - Hubert

--- russo@albany.edu wrote:
> Hi Jay:
>  Thanks for the response. That didn't have the intended result but, it
> appears to be working when I look at the headers.
>  Maybe my goal's not clear?
>  Outline of steps in my web app. and where I want to prevent repost as
> follows:
> 1) http://<host>:<port>/afadmin/
>   presents login form
> 
> 2) On successful login user info is stored in session and user is
> forwarded to view:
> http://<host>:<port>/afadmin/console.afr
> At the moment this is just simple page with a header, menu, body and
> footer.
> 
>  If you hit the refresh at this view the browser still has the post data
> from the login view and if I click "OK" it re-sends the login information.
> 
> Is there a way to prevent the repost on the client end? Or, at least
> indicate to the client that I'd like it to forget about the post
> information from the previous view?
> Or, am I approaching this incorrectly? Should I just ignore the re-post in
> my loginAction ?
>   I found this but, in my present state of mind (too darned tired) it
> seems like overkill:
>  http://www.livinglogic.de/Struts/
> 
> Thanks,
> -Ryan
> 
> > In your struts-config.xml <controller> element, thus:
> >
> > <controller>
> >
> >     <set-property property="nocache" value="true"/>
> >
> > </controller>
> >
> > Jay
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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


Re: Setting nocache

Posted by Janarthan Sathiamurthy <ja...@yahoo.com>.
Hi,
 
Your problem sounds like you are using a forward tag which might be like -
<forward name="success" path="/my_page.jsp" />
 
Try this -
<forward name="success" path="/zip_inquiry.jsp" redirect="true" />
This should solve your "repost problem".
 
This is very beautifully explained in Chuck Cavances "Programming Jakarta Struts" book from Orielly.
 
Regards,
Janarthan S

russo@albany.edu wrote:
Hi Jay:
Thanks for the response. That didn't have the intended result but, it
appears to be working when I look at the headers.
Maybe my goal's not clear?
Outline of steps in my web app. and where I want to prevent repost as
follows:
1) http://:
/afadmin/
presents login form

2) On successful login user info is stored in session and user is
forwarded to view:
http://:
/afadmin/console.afr
At the moment this is just simple page with a header, menu, body and
footer.

If you hit the refresh at this view the browser still has the post data
from the login view and if I click "OK" it re-sends the login information.

Is there a way to prevent the repost on the client end? Or, at least
indicate to the client that I'd like it to forget about the post
information from the previous view?
Or, am I approaching this incorrectly? Should I just ignore the re-post in
my loginAction ?
I found this but, in my present state of mind (too darned tired) it
seems like overkill:
http://www.livinglogic.de/Struts/

Thanks,
-Ryan

> In your struts-config.xml element, thus:
>
> 
>
> 
>
> 
>
> Jay

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


---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: Setting nocache

Posted by ru...@albany.edu.
Hi Jay:
 Thanks for the response. That didn't have the intended result but, it
appears to be working when I look at the headers.
 Maybe my goal's not clear?
 Outline of steps in my web app. and where I want to prevent repost as
follows:
1) http://<host>:<port>/afadmin/
  presents login form

2) On successful login user info is stored in session and user is
forwarded to view:
http://<host>:<port>/afadmin/console.afr
At the moment this is just simple page with a header, menu, body and
footer.

 If you hit the refresh at this view the browser still has the post data
from the login view and if I click "OK" it re-sends the login information.

Is there a way to prevent the repost on the client end? Or, at least
indicate to the client that I'd like it to forget about the post
information from the previous view?
Or, am I approaching this incorrectly? Should I just ignore the re-post in
my loginAction ?
  I found this but, in my present state of mind (too darned tired) it
seems like overkill:
 http://www.livinglogic.de/Struts/

Thanks,
-Ryan

> In your struts-config.xml <controller> element, thus:
>
> <controller>
>
>     <set-property property="nocache" value="true"/>
>
> </controller>
>
> Jay

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


Re: Setting nocache

Posted by Jay Haines <ja...@norvadallc.com>.
In your struts-config.xml <controller> element, thus:

<controller>

    <set-property property="nocache" value="true"/>

</controller>

Jay

----- Original Message -----
From: <ru...@albany.edu>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, February 09, 2004 10:58 AM
Subject: Setting nocache


> Hi All:
>  Question: Where/How do I set up my Struts app. so that all forms (views)
>            send out  "nocache" pragma?
>  Goal: Attempt to prevent repost of form data on browser refresh.
>  Status: Struts newbie
>  Developing Env.: JDeveloper 10G (OC4J Servlet Engine), Struts 1.1
>  Deployment Env.: Tomcat 5.0.16, Struts 1.1
>  Browser: Moz. Firebird
>  In response to why I didn't search the archive: It produces the following
>  error:
> ht://Dig error
> htsearch detected an error. Please report this to the webmaster of this
> site. The error message is:
> Unable to read configuration file
>  In reponse to why I didn't use Google: I have been for well over 4 hours.
>  Google conclusions: setting nocache in web.xml is deprecated. I should
>                      set my controller to nocache=true
>       my controller in struts-config.xml now looks like:
> <controller
processorClass="edu.albany.allfunds.authority.AuthRequestProcessor"
>               nocache="true" locale="false"/>
>
>  Where my class "AuthRequestProcessor" extends TilesRequestProcessor.
>
>  This had no apparent affect. Hitting refresh in Firebird results in a
> warning that I'm about to re-POST my form data.
>
>  In response to why I don't read a book:  I did. It said to use web.xml.
> Guess I need a new book.
>
> I hope you have found this plea for help both informative and amusing.
>
> Peace,
> |----------------------------------|
> | Ryan Russo                       |
> | russo@[noSPAM].albany.edu        |
> | University at Albany--Computing  |
> | <<remove [noSPAM] to e-mail>>    |
> | Technical Services Web Team      |
> |__________________________________|
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Setting nocache

Posted by ru...@albany.edu.
Hi All:
 Question: Where/How do I set up my Struts app. so that all forms (views)
           send out  "nocache" pragma?
 Goal: Attempt to prevent repost of form data on browser refresh.
 Status: Struts newbie
 Developing Env.: JDeveloper 10G (OC4J Servlet Engine), Struts 1.1
 Deployment Env.: Tomcat 5.0.16, Struts 1.1
 Browser: Moz. Firebird
 In response to why I didn't search the archive: It produces the following
 error:
	ht://Dig error
	htsearch detected an error. Please report this to the webmaster of this
	site. The error message is:
	Unable to read configuration file
 In reponse to why I didn't use Google: I have been for well over 4 hours.
 Google conclusions: setting nocache in web.xml is deprecated. I should
                     set my controller to nocache=true
      my controller in struts-config.xml now looks like:
<controller processorClass="edu.albany.allfunds.authority.AuthRequestProcessor"
              nocache="true" locale="false"/>

 Where my class "AuthRequestProcessor" extends TilesRequestProcessor.

 This had no apparent affect. Hitting refresh in Firebird results in a
warning that I'm about to re-POST my form data.

 In response to why I don't read a book:  I did. It said to use web.xml.
		Guess I need a new book.

I hope you have found this plea for help both informative and amusing.

Peace,
|----------------------------------|
| Ryan Russo                       |
| russo@[noSPAM].albany.edu        |
| University at Albany--Computing  |
| <<remove [noSPAM] to e-mail>>    |
| Technical Services Web Team      |
|__________________________________|

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


Performance Issues regarding tag libraries

Posted by José Gustavo Zagato <jo...@emacdigital.com.br>.
Hi Folks !

	I've been made some performance test with a new web application
developed entirely using the struts 1.1. Analyzing the response from a
simple database search I discovered that some struts tags generates way
to much "blank spaces" and "TAB" characters. There is any chance to
avoid this 
Behavior ? It might appear to be a stupid issue, but I made some other
tests with the same search operation and I replace the struts tags for
"regular code" and the response size decreases at least 30%. If someone
wants I can send the response generated by struts and any other file.

Cheers !

José Gustavo Zagato Rosa
System Analyst - Atos Origin
jose.gustavo@emacdigital.com.br





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