Author Login
Post Reply
user Digest 20 Apr 2008 01:24:38 -0000 Issue 7988
Topics (messages 185597 through 185623):
Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions
185597 by: Toni Lyytikäinen
185598 by: Randy Burgess
185599 by: Dave Newton
185601 by: Brad A Cupit
how to replace a button (ajax) with a simple link?
185600 by: xianwinwin
Re: Clearing form value
185602 by: aum strut
185603 by: Dave Newton
185605 by: aum strut
185606 by: Dustin S.
185609 by: Nils-Helge Garli Hegvik
185610 by: aum strut
Re: ParameterAware Arrays
185604 by: Dustin S.
Re: Trouble executing scripts in returned ajax content
185607 by: Jeromy Evans
s2 in tomcats shared lib/
185608 by: Marc Ende
185615 by: Gabriel Belingueres
result in different pages
185611 by: Danieleippoliti\.libero\.it
185612 by: Martin Gainty
Declarative validation: show colored message
185613 by: Peter Theissen
from Action to PageContext: how's it done?
185614 by: Adam Hardy
185616 by: Ralf Fischer
185618 by: Adam Hardy
185619 by: Dave Newton
185620 by: Adam Hardy
185621 by: Dave Newton
185622 by: Adam Hardy
185623 by: Dave Newton
Scope Interceptor
185617 by: Kibo
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_185597.ezm (zipped)Well, as I already posted in the issue, it turned out that this is somehow
caused by the Spring plugin. If I disable the Spring plugin, it works fine
(apart from the fact that my DAOs won't get injected to the actions, of
course).

Attachment:
user_185598.ezm (zipped)Make sure to set your actions in your application context with
scope="prototype".
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
> From: Toni Lyytikäinen <tolyen@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Fri, 18 Apr 2008 21:54:14 +0300
> To: Struts Users Mailing List <user@(protected)>
> Subject: Re: Converting action configuration from 2.0 to 2.1 - how to convert
> parameters to actions
>
> Well, as I already posted in the issue, it turned out that this is somehow
> caused by the Spring plugin. If I disable the Spring plugin, it works fine
> (apart from the fact that my DAOs won't get injected to the actions, of
> course).
This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

Attachment:
user_185599.ezm (zipped)--- Toni Lyytikäinen <tolyen@(protected):
> Well, as I already posted in the issue, it turned out that this is somehow
> caused by the Spring plugin. If I disable the Spring plugin, it works fine
> (apart from the fact that my DAOs won't get injected to the actions, of
> course).
I'm wondering if this is related to the CGLIB issue.
Dave

Attachment:
user_185601.ezm (zipped)>> I'm wondering if this is related to the CGLIB issue.
Hrm...he's using the redirectAction which has been immune to the CGLIB
issue (assuming we're talking about the same issue). The 'chain' result
is prone to the CGLIB problem. Having said that, I haven't used Struts
2.1.x at all.
The exception being thrown is known to be ok. The parameters will first
try to be set as properties on the Result class, then the ones which are
not reserved as special properties will be set in the url by
ServletActionRedirectResult.
This is/was a known issue for 2.0.x and 2.1.0 as well. Sometime during
2.1.1 development, WW-2170 [1] was fixed, which should stop this issue.
Toni, are you using the latest version of Struts 2.1 from trunk?
[1] https://issues.apache.org/struts/browse/WW-2170
Brad Cupit
Louisiana State University - UIS

Attachment:
user_185600.ezm (zipped)
I have the following button-action:
<s:form action="test_exitForm" method="post" validate="false" >
<s:submit type="image" src="images/exit22.png" action="test_exitForm"
theme="ajax" targets="id_close" showLoadingText="false"
indicator="loadingImage"/>
</s:form>
this button, when clicked, does some action (removes a form from the screen)
I would like to 'convert' the button (the image-button) into a simple link:
close-form (so the user actually clicks the link and not the button)
does anyone have any idea how to do that? put in mind that the 'targets' is
important.
Thank you!
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_185602.ezm (zipped)currently i am using struts-2.0.11.1
On 4/19/08, Dave Newton <newton.dave@(protected):
>
> Which version of Struts?
>
> --- aum strut <aum.struts@(protected):
>
> > Hi all,
> >
> > a little point which i want to know.
> > i have a form by which we can add billing detais in the database
> >
> > form is working fine, it is adding the value to the database as
> expected,
> > the problem whcih i am facing is even after successfully submitting the
> > values, it is not clearing the form values which has been added
> >
> > i can clear the fields values using java script,but i want to know is
> it
> > possible using Struts2,is theer any was that when ever data is submitted
> > successfully in the database form fields values should get cleared.
> >
> >
> > any help in this regard will be much appriciated.
> >
> >
> > thanks in advance
> > --aum
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185603.ezm (zipped)Are you using Spring?
Would it be possible for you to provide more useful information in your
initial emails rather than generating a stream of a half-dozen or more? It's
rather frustrating; we've gone through this before.
One common error is to not have your action defined as being "prototype"
scope. Since actions are instantiated on each request (normally) it's not
typical to see this behavior without some effort on your part or
mis-configuration.
Dave
--- aum strut <aum.struts@(protected):
> currently i am using struts-2.0.11.1
>
> On 4/19/08, Dave Newton <newton.dave@(protected):
> >
> > Which version of Struts?
> >
> > --- aum strut <aum.struts@(protected):
> >
> > > Hi all,
> > >
> > > a little point which i want to know.
> > > i have a form by which we can add billing detais in the database
> > >
> > > form is working fine, it is adding the value to the database as
> > expected,
> > > the problem whcih i am facing is even after successfully submitting the
> > > values, it is not clearing the form values which has been added
> > >
> > > i can clear the fields values using java script,but i want to know is
> > it
> > > possible using Struts2,is theer any was that when ever data is
> submitted
> > > successfully in the database form fields values should get cleared.
> > >
> > >
> > > any help in this regard will be much appriciated.
> > >
> > >
> > > thanks in advance
> > > --aum
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment:
user_185605.ezm (zipped)yes you are right
not providing complete information in one mail is really not good
i wil take this in to account in future...
well i am not using spring in my application i have a simple form which is
sending the input values to my action where i am adding these in to the data
base using simple jdbc call everything is working fine i am even getting
back the success response in my add form.
i am not able to understand what u mean by "not have your action defined as
being "prototype"
scope"
aum
On 4/19/08, Dave Newton <newton.dave@(protected):
>
> Are you using Spring?
>
> Would it be possible for you to provide more useful information in your
> initial emails rather than generating a stream of a half-dozen or more?
> It's
> rather frustrating; we've gone through this before.
>
> One common error is to not have your action defined as being "prototype"
> scope. Since actions are instantiated on each request (normally) it's not
> typical to see this behavior without some effort on your part or
> mis-configuration.
>
> Dave
>
> --- aum strut <aum.struts@(protected):
>
> > currently i am using struts-2.0.11.1
> >
> > On 4/19/08, Dave Newton <newton.dave@(protected):
> > >
> > > Which version of Struts?
> > >
> > > --- aum strut <aum.struts@(protected):
> > >
> > > > Hi all,
> > > >
> > > > a little point which i want to know.
> > > > i have a form by which we can add billing detais in the database
> > > >
> > > > form is working fine, it is adding the value to the database as
> > > expected,
> > > > the problem whcih i am facing is even after successfully submitting
> the
> > > > values, it is not clearing the form values which has been added
> > > >
> > > > i can clear the fields values using java script,but i want to know
> is
> > > it
> > > > possible using Struts2,is theer any was that when ever data is
> > submitted
> > > > successfully in the database form fields values should get cleared.
> > > >
> > > >
> > > > any help in this regard will be much appriciated.
> > > >
> > > >
> > > > thanks in advance
> > > > --aum
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185606.ezm (zipped)If your using Spring as the objectFactory then you would need to
define your action bean as prototype instead of singleton in your
applicationContext.xml
for example:
<bean id="personAction" scope="prototype" class="some.class.PersonAction"/>
On Fri, Apr 18, 2008 at 10:59 PM, aum strut <aum.struts@(protected):
> yes you are right
>
> not providing complete information in one mail is really not good
>
> i wil take this in to account in future...
>
> well i am not using spring in my application i have a simple form which is
> sending the input values to my action where i am adding these in to the data
> base using simple jdbc call everything is working fine i am even getting
> back the success response in my add form.
>
> i am not able to understand what u mean by "not have your action defined as
> being "prototype"
> scope"
>
> aum
>
>
>
>
> On 4/19/08, Dave Newton <newton.dave@(protected):
> >
> > Are you using Spring?
> >
> > Would it be possible for you to provide more useful information in your
> > initial emails rather than generating a stream of a half-dozen or more?
> > It's
> > rather frustrating; we've gone through this before.
> >
> > One common error is to not have your action defined as being "prototype"
> > scope. Since actions are instantiated on each request (normally) it's not
> > typical to see this behavior without some effort on your part or
> > mis-configuration.
> >
> > Dave
> >
> > --- aum strut <aum.struts@(protected):
> >
> > > currently i am using struts-2.0.11.1
> > >
> > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > >
> > > > Which version of Struts?
> > > >
> > > > --- aum strut <aum.struts@(protected):
> > > >
> > > > > Hi all,
> > > > >
> > > > > a little point which i want to know.
> > > > > i have a form by which we can add billing detais in the database
> > > > >
> > > > > form is working fine, it is adding the value to the database as
> > > > expected,
> > > > > the problem whcih i am facing is even after successfully submitting
> > the
> > > > > values, it is not clearing the form values which has been added
> > > > >
> > > > > i can clear the fields values using java script,but i want to know
> > is
> > > > it
> > > > > possible using Struts2,is theer any was that when ever data is
> > > submitted
> > > > > successfully in the database form fields values should get cleared.
> > > > >
> > > > >
> > > > > any help in this regard will be much appriciated.
> > > > >
> > > > >
> > > > > thanks in advance
> > > > > --aum
> > > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > For additional commands, e-mail: user-help@(protected)
> > > >
> > > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment:
user_185609.ezm (zipped)It would be a lot easier helping if you show us some configuration
files and code....
Nils-H
On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected):
> yes you are right
>
> not providing complete information in one mail is really not good
>
> i wil take this in to account in future...
>
> well i am not using spring in my application i have a simple form which is
> sending the input values to my action where i am adding these in to the data
> base using simple jdbc call everything is working fine i am even getting
> back the success response in my add form.
>
> i am not able to understand what u mean by "not have your action defined as
> being "prototype"
> scope"
>
> aum
>
>
>
>
> On 4/19/08, Dave Newton <newton.dave@(protected):
> >
> > Are you using Spring?
> >
> > Would it be possible for you to provide more useful information in your
> > initial emails rather than generating a stream of a half-dozen or more?
> > It's
> > rather frustrating; we've gone through this before.
> >
> > One common error is to not have your action defined as being "prototype"
> > scope. Since actions are instantiated on each request (normally) it's not
> > typical to see this behavior without some effort on your part or
> > mis-configuration.
> >
> > Dave
> >
> > --- aum strut <aum.struts@(protected):
> >
> > > currently i am using struts-2.0.11.1
> > >
> > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > >
> > > > Which version of Struts?
> > > >
> > > > --- aum strut <aum.struts@(protected):
> > > >
> > > > > Hi all,
> > > > >
> > > > > a little point which i want to know.
> > > > > i have a form by which we can add billing detais in the database
> > > > >
> > > > > form is working fine, it is adding the value to the database as
> > > > expected,
> > > > > the problem whcih i am facing is even after successfully submitting
> > the
> > > > > values, it is not clearing the form values which has been added
> > > > >
> > > > > i can clear the fields values using java script,but i want to know
> > is
> > > > it
> > > > > possible using Struts2,is theer any was that when ever data is
> > > submitted
> > > > > successfully in the database form fields values should get cleared.
> > > > >
> > > > >
> > > > > any help in this regard will be much appriciated.
> > > > >
> > > > >
> > > > > thanks in advance
> > > > > --aum
> > > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > For additional commands, e-mail: user-help@(protected)
> > > >
> > > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment:
user_185610.ezm (zipped)i am not using Spring at all.here is the code for my configuration and
action class
my *Quotation.jsp page* by which i am adding data
<%@(protected)" %>
<html>
<head>
<title>Quotation Form</title>
<s:head theme="ajax"/>
</head>
<body>
<center><font face="verdana" size="2" color="red"><s:actionmessage></
s:actionmessage></font></center>
<h1 align="center"> Quotation Form</h1>
<s:form action="SaveBill">
<table align="center">
<s:datetimepicker label="Date:" name="date"/></td><td>
<s:textfield label="Voucher Number:" name="voucherNumber"/>
<s:textfield label="Customer Name:" name="customerName"/>
<s:textarea label="Address" name="address" cols="20" rows="4"/>
<s:textfield label="Contact No:" name="contactNo"/>
<s:textfield label="Item Name:" name="itemName"/>
<s:textfield label="Purity:" name="purity"/>
<s:textfield label="Gross Weight(Gms):" name="grossWeight"/>
<s:textfield label="Net Weight(Gms):" name="netWeight"/>
<s:textfield label="Diamond Weight:" name="diamondWeight"/>
<s:textfield label="Gold Rate(Rs):" name="goldRate"/>
<s:textfield label="Amount:" name="amount"/>
<s:submit label="Save" align="center" />
</table>
</s:form>
</body>
</html>
*my action class*
package raisonne.billgeneration;
import
com.opensymphony.xwork2.ActionSupport;
import raisonne.billgeneration.GetBillConnection;
public class SaveBillingData extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = -5856152810070496725L;
private int rowInserted=0;
private String date=null;
private String voucherNumber=null;
private String customerName=null;
private String address=null;
private String contactNo=null;
private String itemName=null;
private String purity=null;
private double grossWeight=0.0;
private double netWeight=0.0;
private double diamondWeight=0.0;
private double goldRate=0.0;
private double amount=0.0;
/*
Getter and Setter Method
*/
public String execute() throws Exception{
GetBillConnection billCollection =new GetBillConnection();
rowInserted=billCollection.AddBillingData(getDate(),getVoucherNumber(),
getCustomerName(),getAddress(),getContactNo(),
getItemName(),getPurity(),getGrossWeight(),
getNetWeight(),getDiamondWeight(),getGoldRate(),getAmount());
if(rowInserted>0){
addActionMessage("Quotation data has been submitted successfully");
return SUCCESS;
}
else{
addActionMessage("Error while saving Quotation data, Pleaes retry");
return INPUT;
}
}
}
lastly *Struts.xml file*
<package name="raisonne.billgeneration" extends="struts-default" namespace=
"/">
<action name="SaveBill" class="raisonne.billgeneration.SaveBillingData">
<result name="success">/BillGeneration/Quotation.jsp</result>
<result name="input">/Login/Login.jsp</result>
</action>
</package>
-aum
On 4/19/08, Nils-Helge Garli Hegvik <nilsga@(protected):
>
> It would be a lot easier helping if you show us some configuration
> files and code....
>
> Nils-H
>
> On Sat, Apr 19, 2008 at 6:59 AM, aum strut <aum.struts@(protected):
> > yes you are right
> >
> > not providing complete information in one mail is really not good
> >
> > i wil take this in to account in future...
> >
> > well i am not using spring in my application i have a simple form which
> is
> > sending the input values to my action where i am adding these in to the
> data
> > base using simple jdbc call everything is working fine i am even
> getting
> > back the success response in my add form.
> >
> > i am not able to understand what u mean by "not have your action
> defined as
> > being "prototype"
> > scope"
> >
> > aum
> >
> >
> >
> >
> > On 4/19/08, Dave Newton <newton.dave@(protected):
> > >
> > > Are you using Spring?
> > >
> > > Would it be possible for you to provide more useful information in
> your
> > > initial emails rather than generating a stream of a half-dozen or
> more?
> > > It's
> > > rather frustrating; we've gone through this before.
> > >
> > > One common error is to not have your action defined as being
> "prototype"
> > > scope. Since actions are instantiated on each request (normally) it's
> not
> > > typical to see this behavior without some effort on your part or
> > > mis-configuration.
> > >
> > > Dave
> > >
> > > --- aum strut <aum.struts@(protected):
> > >
> > > > currently i am using struts-2.0.11.1
> > > >
> > > > On 4/19/08, Dave Newton <newton.dave@(protected):
> > > > >
> > > > > Which version of Struts?
> > > > >
> > > > > --- aum strut <aum.struts@(protected):
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > a little point which i want to know.
> > > > > > i have a form by which we can add billing detais in the
> database
> > > > > >
> > > > > > form is working fine, it is adding the value to the database as
> > > > > expected,
> > > > > > the problem whcih i am facing is even after successfully
> submitting
> > > the
> > > > > > values, it is not clearing the form values which has been added
> > > > > >
> > > > > > i can clear the fields values using java script,but i want to
> know
> > > is
> > > > > it
> > > > > > possible using Struts2,is theer any was that when ever data is
> > > > submitted
> > > > > > successfully in the database form fields values should get
> cleared.
> > > > > >
> > > > > >
> > > > > > any help in this regard will be much appriciated.
> > > > > >
> > > > > >
> > > > > > thanks in advance
> > > > > > --aum
> > > > > >
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > For additional commands, e-mail: user-help@(protected)
> > > > >
> > > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185604.ezm (zipped)Hi Gabriel,
I just wanted to say that I ended up putting instance variables with
getters/setters for the request parameters (as you suggested). I
wasn't aware they auto-binded like that.
Thanks for your response.
Dustin.
On Wed, Apr 16, 2008 at 4:55 PM, Gabriel Belingueres
<belingueres@(protected):
> You can of course set up instance variables in your action class with
> identical names as the parameters you intend to use.
>
> 2008/4/16, Dustin S. <icedout3e@(protected)>:
>
>
> > I noticed the the map for setParameters is <String, String[]>. If I
> > intend to always only use [0], is there any easy way to accomplish
> > this without having to do [0] everytime I get() a parameter from the
> > map? I noticed there is SingleValueMap in webwork for this purpose.
> > Does something exist like this in Struts 2 or possibly is there any
> > easier way to get params from a url (page?parm1=value1¶m2=value2)
> > that I am not seeing?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185607.ezm (zipped)Jukka Välimaa wrote:
> Thanks for input,
>
> Yes, I have debug on. Interestingly enough, with firefox it gives me just
> this:
> DEBUG: Error running scripts from content
>
> However, I just noticed that with IE, I get this:
> DEBUG: Error running scripts from content:Could not complete the operation
> due to error 80020101
>
>
Hi Jukka,
I have confirmed that the plugin will execute inline scripts if (and
only if) executeScripts="true" and separateScripts="true".
The errors you're getting are caused by invalid javascript evaluation.
80020101 is probably a missing semi-colon.
Use a javascript delinter to find the javascript errors:
http://www.jslint.com/lint.html
http://www.javascriptlint.com/
Your work-around is fine. In fact, I discourage any use of inline
scripts and recommend binding to the events published by the dojo widgets.
regards,
Jeromy Evans

Attachment:
user_185608.ezm (zipped)Hi,
a few years ago everyone told that's not good to have the sturts.jar's
in a shared location in a tomcat-instance.
What about now (struts 2)?
I'm asking because I've got several webapps which belongs together and
most of them are build using struts 2 and
spring. After assembling the war (directory or file) I've seen that the
huge size (between 12 to 17mb) of the webapps is
related to the number of deployed jars. So I'd like to clean up a little
and put some of the commonly used
jars in the ${catalina.home}/lib folder. What about the new s2-jar's? Do
I ran into trouble when I'm putting it into the
global lib-folder or do I get (not-wanted) side-effects from deploying
them into this location?
Thanks for your help!
Marc

Attachment:
user_185615.ezm (zipped)Well it depends if you are ALWAYS developing using the same library
versions or not.
Be aware that Struts level of compatibility changes from version to
version: For example, from 2.09 to 2.0.11 imposes several constraints
in its tag library, so you may want to prevent this to be in a common
place.
However regarding Spring, upgrades from v2.0.x to v.2.0.y are drop in
replacements, so it would not hurt (in theory at least)
2008/4/19, Marc Ende <mlists@(protected)>:
> Hi,
>
> a few years ago everyone told that's not good to have the sturts.jar's in a
> shared location in a tomcat-instance.
> What about now (struts 2)?
> I'm asking because I've got several webapps which belongs together and most
> of them are build using struts 2 and
> spring. After assembling the war (directory or file) I've seen that the huge
> size (between 12 to 17mb) of the webapps is
> related to the number of deployed jars. So I'd like to clean up a little and
> put some of the commonly used
> jars in the ${catalina.home}/lib folder. What about the new s2-jar's? Do I
> ran into trouble when I'm putting it into the
> global lib-folder or do I get (not-wanted) side-effects from deploying them
> into this location?
>
> Thanks for your help!
>
> Marc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185611.ezm (zipped)Hi,
I have a tag <s:iterator value="list">...</s:iterator> but I would to show the element of the list in different page.
Infact the list's elements are the result of a search in a SearchEngine so I would have the links to page 1 2 3 4 5... and for each page I want view only x results.
For example,if I have 100 results and I want to show only 10 results for each page, so I have in the page the links page 1 2 3 4 5 6 7 8 9 10
Daniele

Attachment:
user_185612.ezm (zipped)you can store in session and retrieve later using
http://struts.apache.org/2.0.11.1/docs/ognl-basics.html
----- Original Message -----
From: <Danieleippoliti@(protected)>
To: "struts mailing list" <user@(protected)>
Sent: Saturday, April 19, 2008 7:24 AM
Subject: result in different pages
Hi,
I have a tag <s:iterator value="list">...</s:iterator> but I would to show
the element of the list in different page.
Infact the list's elements are the result of a search in a SearchEngine so I
would have the links to page 1 2 3 4 5... and for each page I want view only
x results.
For example,if I have 100 results and I want to show only 10 results for
each page, so I have in the page the links page 1 2 3 4 5 6 7 8 9 10
Daniele
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185613.ezm (zipped)Hi,
how can I show up a colored message when doing
declarative validation via xml file.
I tried to surround the message text by a div, but
then the messages werent shown any longer:
>>>
<message><div>You must enter your fistname.</div></message>
<<<
Therefore, I dont know how to color that output string.
Can anyone help me?
Thanks and best regards
Peter

Attachment:
user_185614.ezm (zipped) From looking at the struts2 architecture, one of the big questions that I can't
find the answer to is how struts/xwork moves objects such as the properties on
an action into the PageContext.
When an interceptor is executing for example, calling
ServletActionContext.getPageContext() will return null until the action has been
invoked.
Invoking the action also executes the Result, so the JSP is called and the
PageContext is created.
But how does struts do that? I've got a feeling my knowledge of the Servlet
Container could be better :(
Thanks for any info,
regards
Adam

Attachment:
user_185616.ezm (zipped)Hello Adam
On Sat, Apr 19, 2008 at 7:29 PM, Adam Hardy
<ahardy.struts@(protected):
> From looking at the struts2 architecture, one of the big questions that I
> can't find the answer to is how struts/xwork moves objects such as the
> properties on an action into the PageContext.
Actually it's not done at all. I guess your real question is "I create
some objects in my action and want to render them somehow in the view.
How do I do that?"
Upon request to your struts web application the filter creates a value
stack which holds all the information needed. The action responsible
for the "page" of I may say so is put onto the stack and the single
interceptors on the stack set the parameters from the configuration or
the requested URI into the stack. Usually this leads to the population
of action properties if you did everything right, meaning the URI
parameter ?foo=1 will lead to a call of setFoo("1").
The same stack is still available when the result associated with the
action is rendered, which may be a JSP page, and you can access
information easily by using OGNL expressions to extract the
information you need.
> When an interceptor is executing for example, calling
> ServletActionContext.getPageContext() will return null until the action has
> been invoked.
Is there a page context yet when you are some method calls away from a
servlet filter?
> Invoking the action also executes the Result, so the JSP is called and the
> PageContext is created.
>
> But how does struts do that? I've got a feeling my knowledge of the Servlet
> Container could be better :(
I suggest some basic reading on struts, here[1] for example.
Cheers,
-Ralf
[1] http://struts.apache.org/2.0.11.1/docs/home.html

Attachment:
user_185618.ezm (zipped)Ralf Fischer on 19/04/08 18:43, wrote:
> On Sat, Apr 19, 2008 at 7:29 PM, Adam Hardy
> <ahardy.strut@(protected):
>> From looking at the struts2 architecture, one of the big questions that I
>> can't find the answer to is how struts/xwork moves objects such as the
>> properties on an action into the PageContext.
>
> Actually it's not done at all. I guess your real question is "I create
> some objects in my action and want to render them somehow in the view.
> How do I do that?"
Sorry, your guess was wide of the mark. My mistake for not being more explicit.
I am familiar enough with the struts framework to know how I can put getters and
setters on my action and use properties accordingly in my JSP with JSTL or OGNL
or whatever, but my question is one meta-level up from your answer, i.e. how is
that done by struts?
The struts interceptors encompass both the actions and the results, but how does
struts put the action properties into the pageContext?
Adam

Attachment:
user_185619.ezm (zipped)--- Adam Hardy <ahardy.struts@(protected):
> The struts interceptors encompass both the actions and the results, but how
> does struts put the action properties into the pageContext?
It doesn't; it puts the action on the stack. The tags use OGNL to get values
from the stack context, or when using JSP 2.0 EL the S2 request wrapper will
go to the stack if the value isn't found in the normal contexts.
I guess I'm not really sure what you're asking.
Dave

Attachment:
user_185620.ezm (zipped)Dave Newton on 19/04/08 23:54, wrote:
> --- Adam Hardy <ahardy.struts@(protected):
>> The struts interceptors encompass both the actions and the results, but how
>> does struts put the action properties into the pageContext?
>
> It doesn't; it puts the action on the stack. The tags use OGNL to get values
> from the stack context, or when using JSP 2.0 EL the S2 request wrapper will
> go to the stack if the value isn't found in the normal contexts.
>
> I guess I'm not really sure what you're asking.
I think you've understood what I'm asking.
So how does the stack context get put into the pageContext? The pageContext only
comes into existence when the JSP is called via (presumably) a
RequestDispatcher.forward() - what I can't figure out is how struts gets
involved in the JSP when I'm not using struts tags there or anything except some
JSTL to ask for an action property such as "${myPropertyOnAction}"
So you say the StrutsRequestWrapper holds the struts context and is accessed
somewhere in the Result to pull everything down into the PageContext?
I don't understand the javadoc for StrutsRequestWrapper which says
"All Struts requests are wrapped with this class, which provides simple JSTL
accessibility. This is because JSTL works with request attributes, so this class
delegates to the value stack ...."
JSTL only works with request attributes when you explicitly say
"${requestScope[thing]}"
No?
Adam

Attachment:
user_185621.ezm (zipped)--- Adam Hardy <ahardy.struts@(protected):
> So you say the StrutsRequestWrapper holds the struts context [...]
No, I'm saying it has access to it via ActionContext.getContext().
> and is accessed somewhere in the Result to pull everything down
> into the PageContext?
I'm not sure what that means.
All the request wrapper does (slightly simplified) is call super.getAttribute
(where super is an HttpServletRequestWrapper). If nothing is returned from
that, as would be the case with a typical action and action property, then
the wrapper will query the stack for the value.
You should probably just look at the source code, no?
Dave

Attachment:
user_185622.ezm (zipped)Dave Newton on 20/04/08 00:23, wrote:
> --- Adam Hardy <ahardy.struts@(protected):
>> So you say the StrutsRequestWrapper holds the struts context [...]
>
> No, I'm saying it has access to it via ActionContext.getContext().
>
>> and is accessed somewhere in the Result to pull everything down
>> into the PageContext?
>
> I'm not sure what that means.
>
> All the request wrapper does (slightly simplified) is call super.getAttribute
> (where super is an HttpServletRequestWrapper). If nothing is returned from
> that, as would be the case with a typical action and action property, then
> the wrapper will query the stack for the value.
>
> You should probably just look at the source code, no?
Yes, I guess I should if I had a team of sherpas for the expedition. I once
scaled the face of the Hibernate Source Massif and only 3 of the team came back
alive.
But seriously, I appreciate your comments a lot since they buy me out of lot of
hard source code reading, which is not something too pleasant when you don't
know where you're aiming for, as you probably know.
What you're saying is clear except one thing - in JSTL I can access the action.
And in JSTL, I'm not calling request.getAttribute() - I'm _not_ doing this:
${requestScope['myObject']}
I'm just doing this:
${myObject}
and struts somehow gives me the right info, which to my mind means that Struts
has put that object into the PageContext already.

Attachment:
user_185623.ezm (zipped)--- Adam Hardy <ahardy.struts@(protected):
> What you're saying is clear except one thing - in JSTL I can access the
> action. And in JSTL, I'm not calling request.getAttribute() - I'm _not_
doing this:
>
> ${requestScope['myObject']}
>
> I'm just doing this:
>
> ${myObject}
>
> and struts somehow gives me the right info, which to my mind means that
> Struts has put that object into the PageContext already.
I told you precisely what it did: if the request wrapper can't find the
attribute in normal scope, it goes to the stack.
Here is the entire relevant source; it's 36 lines. With comments.
public Object getAttribute(String s) {
if (s != null && s.startsWith("javax.servlet")) {
// don't bother with the standard javax.servlet attributes, we
can short-circuit this
// see WW-953 and the forums post linked in that issue for more
info
return super.getAttribute(s);
}
ActionContext ctx = ActionContext.getContext();
Object attribute = super.getAttribute(s);
if (ctx != null) {
if (attribute == null) {
boolean alreadyIn = false;
Boolean b = (Boolean)
ctx.get("__requestWrapper.getAttribute");
if (b != null) {
alreadyIn = b.booleanValue();
}
// note: we don't let # come through or else a request for
// #attr.foo or #request.foo could cause an endless loop
if (!alreadyIn && s.indexOf("#") == -1) {
try {
// If not found, then try the ValueStack
ctx.put("__requestWrapper.getAttribute",
Boolean.TRUE);
ValueStack stack = ctx.getValueStack();
if (stack != null) {
attribute = stack.findValue(s);
}
} finally {
ctx.put("__requestWrapper.getAttribute",
Boolean.FALSE);
}
}
}
}
return attribute;
}
Dave

Attachment:
user_185617.ezm (zipped)
Hi konference
I read the article there:
http://struts.apache.org/2.0.9/docs/scope-interceptor.html
and a want use scope interceptor, but it not work my. I dont know exactly,
that i good understand it.
I want save into session model: Employee.
//############################
In my Action Class I have this code:
-----------------------------------
public class TestScope extends ActionSupport implements
ModelDriven<Employee> {
private Employee emp = new Employee(new Integer(10), "tomas", "jurman");
public Employee getModel() {
return emp;
}
public void setModel(Employee model) {
this.emp = model;
}
}
//###########################
in struts.xml I have this part of code:
note: instead tag param i give here tag para because it dont show it
-------------------------------------------------
<interceptors>
<interceptor-stack name="eventStack">
<interceptor-ref name="scope">
<para name="session">model</para>
<para name="autoCreateSession">true</para>
</interceptor-ref>
<interceptor-ref name="paramsPrepareParamsStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="eventStack" />
<action name="scopeStart" class="cz.jurman.scope.TestScope">
<interceptor-ref name="eventStack">
<para name="scope.type">start</para>
</interceptor-ref>
<result name="success">/jsp/start.jsp</result>
</action>
//#########################
in JSP i read the session:
----------------------------------------
<s:property value="%{#session.model}" />
//###############################################
Thanks for help very much
Tomas Jurman
Czech Republic
-----
Tomas Jurman
Czech Republic
--
Sent from the Struts - User mailing list archive at Nabble.com.