Author Login
Post Reply
user Digest 15 Apr 2008 12:23:44 -0000 Issue 7979
Topics (messages 185422 through 185444):
Re: When do I need to extend "ActionSupport"?
185422 by: Wes Wannemacher
Re: Validation for multiple fields
185423 by: Wes Wannemacher
Re: [S2] Spring: Interceptors, prototype or singleton?
185424 by: Martin Gainty
185426 by: Don Brown
Re: [S2] Textfield key with resource bundle
185425 by: Jeromy Evans
How do I insert a file into mySQL?
185427 by: ryan webb
Re: Struts 2 + AjaxTags + DisplayTag
185428 by: Márcio Gurgel
Migrating data from one select box to other.
185429 by: Arpan Debroy
185430 by: Ryan
185432 by: Arpan Debroy
185433 by: Arpan Debroy
<s:action /> tag doesn't work in sitemesh decorator file...
185431 by: caritasem
Is there such a thing as flash in S2?
185434 by: Alex Shneyderman
185435 by: Don Brown
185436 by: Don Brown
HOW TO SPECIFY AN ACTION WITH A PARAMETER
185437 by: Danieleippoliti\.libero\.it
185440 by: Ralf Fischer
Re: [OT] Scheduled DB clean up service with Spring
185438 by: Peter Theissen
185439 by: Nils-Helge Garli Hegvik
Type conversion with enum elements
185441 by: Ramanathan RV
185442 by: Giovanni Azua
185443 by: Ralf Fischer
[OT] Re: How do I insert a file into mySQL?
185444 by: Dave Newton
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_185422.ezm (zipped)
On Mon, 2008-04-14 at 12:49 -0700, Dave Newton wrote:
> --- "Zheng, Xiahong" <Xiahong.Zheng@(protected):
> > Struts 2 promotes POJO based action. However I found most of the Action
> > classes from the sample application extends ActionSupport? By looking at
> > the ActionSupport class in Xwork, I found it implements quite a few
> > interfaces, e.g. Valicateable, ValidationAware, TextProvider,
> > LocalProvider and Action. My question is if I don't extend
> > ActionSupport, do I lose all the above functionalities, validation,
> > locale, etc, even if I have the corresponding interceptors configured?
>
> Yes (more or less; some annotations may provide functionality without
> explicit interface implementation).
>
> The interceptors (and other functions that expect the interfaces, like I18N)
> use the interfaces as markers to indicate that a various action should be
> performed, identify the existence of functionality, and so on.
>
> Dave
>
I will add to what Dave says, and ask why you wouldn't want to extend
ActionSupport? Although extending ActionSupport may seem like you are
tying yourself to the framework, I have never had a problem because the
functionality that ActionSupport adds is only loosely coupled to the
framework. Perhaps a better way to say it is that I've never had to
create mock objects to unit test an action that extends ActionSupport.
So, a MyAction action = new MyAction(); String res = action.execute();
Will work in JUnit w/o any special housekeeping (except calling
appropriate setters). If you still aren't convinced, then wrap your
POJOs with a thin class that implements ActionSupport i.e. -
public class MyAction extends ActionSupport {
private MyPOJO pojo;
public MyPOJO getPojo() {
return pojo;
}
public void setPojo( MyPOJO pojo) {
this.pojo = pojo;
}
}
Then you can name your form fields like -
<s:textfield name="pojo.memberVar" />
This way your POJOs are completely de-coupled from the framework. And,
to make things easier, you can implement ModelDriven which will allow
you to deal with your POJO directly within your form widgets. I would
add a code example, but it is all well-documented in the online docs.
-Wes

Attachment:
user_185423.ezm (zipped)
On Mon, 2008-04-14 at 16:51 -0300, Décio Heinzelmann Luckow wrote:
> Hi All,
>
> Struts have some way to do the validation for multiple fields?
>
> Décio
Yes

Attachment:
user_185424.ezm (zipped)Could you provide a scenario where one bean is injected into another?
Thanks
M-
----- Original Message -----
From: "Randy Burgess" <RBurgess@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Monday, April 14, 2008 3:55 PM
Subject: Re: [S2] Spring: Interceptors, prototype or singleton?
> So the interceptor would have to be declared at the action level in this
> case then? If I have a spring bean named myBean that is default scope and
I
> inject another bean declared as a prototype into it, the injected bean
will
> still be a singleton since there will be only one instance of myBean.
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>
>
>
> > From: Don Brown <donald.brown@(protected)>
> > Reply-To: Struts Users Mailing List <user@(protected)>
> > Date: Tue, 15 Apr 2008 01:12:49 +1000
> > To: Struts Users Mailing List <user@(protected)>
> > Subject: Re: [S2] Spring: Interceptors, prototype or singleton?
> >
> > To clarify, interceptors aren't technically singletons as each
> > instance in an interceptor stack gets its own interceptor instance.
> > However, for all requests using that stack, the same interceptor will
> > be used. Therefore, you do need to be careful. For example, most
> > interceptors take parameters that configure their use within the
> > stack, like the "validation" interceptor that takes a list of excluded
> > methods from validation. Interceptors can be configured at the stack
> > level or at the action level. If at the action level, you will get a
> > unique interceptor instance for that action.
> >
> > If you want Spring to construct your interceptor, I recommend the
> > prototype scope, so that Struts gets a new instance of the interceptor
> > as expected.
> >
> > Don
> >
> > On Tue, Apr 15, 2008 at 12:48 AM, Randy Burgess <RBurgess@(protected)>
wrote:
> >> Interceptors are Singletons according to the documentation. If it were
me I
> >> would come up with another method besides Spring for changing object
> >> properties.
> >>
> >> Regards,
> >> Randy Burgess
> >> Sr. Web Applications Developer
> >> Nuvox Communications
> >>
> >>
> >>
> >>> From: GF <ganfab@(protected)>
> >>> Reply-To: Struts Users Mailing List <user@(protected)>
> >>> Date: Mon, 14 Apr 2008 14:51:25 +0200
> >>> To: Struts Users ML <user@(protected)>
> >>> Subject: [S2] Spring: Interceptors, prototype or singleton?
> >>
> >>
> >>>
> >>> In a guide I found on the web, the interceptor was defined as
singleton in
> >>> the Spring's ApplicationContext.
> >>>
> >>> If I need to use "changeable" object properties, I need to have it as
> >>> Prototype, otherwise different requests will result in a object
property
> >>> overwriting.
> >>> Is there any issues about defining an interceptor as Prototype, or is
it ok?
> >>>
> >>> Thanks
> >>>
> >>> GF
> >>
> >>
> >>
> >> 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.
> >>
> >> ---------------------------------------------------------------------
> >> 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)
> >
>
>
>
> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185426.ezm (zipped)That is correct, but should be highly discouraged. If your
interceptor accepted any parameters, multiple configurations would
step on each other, resulting in nondeterministic behavior.
Interceptors should also be of the 'prototype' scope.
Don
On Tue, Apr 15, 2008 at 5:55 AM, Randy Burgess <RBurgess@(protected):
> So the interceptor would have to be declared at the action level in this
> case then? If I have a spring bean named myBean that is default scope and I
> inject another bean declared as a prototype into it, the injected bean will
> still be a singleton since there will be only one instance of myBean.
>
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>
>
>
> > From: Don Brown <donald.brown@(protected)>
>
> > Reply-To: Struts Users Mailing List <user@(protected)>
> > Date: Tue, 15 Apr 2008 01:12:49 +1000
>
> > To: Struts Users Mailing List <user@(protected)>
> > Subject: Re: [S2] Spring: Interceptors, prototype or singleton?
>
>
> >
> > To clarify, interceptors aren't technically singletons as each
> > instance in an interceptor stack gets its own interceptor instance.
> > However, for all requests using that stack, the same interceptor will
> > be used. Therefore, you do need to be careful. For example, most
> > interceptors take parameters that configure their use within the
> > stack, like the "validation" interceptor that takes a list of excluded
> > methods from validation. Interceptors can be configured at the stack
> > level or at the action level. If at the action level, you will get a
> > unique interceptor instance for that action.
> >
> > If you want Spring to construct your interceptor, I recommend the
> > prototype scope, so that Struts gets a new instance of the interceptor
> > as expected.
> >
> > Don
> >
> > On Tue, Apr 15, 2008 at 12:48 AM, Randy Burgess <RBurgess@(protected):
> >> Interceptors are Singletons according to the documentation. If it were me I
> >> would come up with another method besides Spring for changing object
> >> properties.
> >>
> >> Regards,
> >> Randy Burgess
> >> Sr. Web Applications Developer
> >> Nuvox Communications
> >>
> >>
> >>
> >>> From: GF <ganfab@(protected)>
> >>> Reply-To: Struts Users Mailing List <user@(protected)>
> >>> Date: Mon, 14 Apr 2008 14:51:25 +0200
> >>> To: Struts Users ML <user@(protected)>
> >>> Subject: [S2] Spring: Interceptors, prototype or singleton?
> >>
> >>
> >>>
> >>> In a guide I found on the web, the interceptor was defined as singleton in
> >>> the Spring's ApplicationContext.
> >>>
> >>> If I need to use "changeable" object properties, I need to have it as
> >>> Prototype, otherwise different requests will result in a object property
> >>> overwriting.
> >>> Is there any issues about defining an interceptor as Prototype, or is it ok?
> >>>
> >>> Thanks
> >>>
> >>> GF
> >>
> >>
> >>
> >> 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.
> >>
> >> ---------------------------------------------------------------------
> >> 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)
> >
>
>
>
> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185425.ezm (zipped)Kelly.Graus wrote:
>
> Hi Jeremy,
>
> I worked on this all morning, and I believe I'm at the exact same place I
> was before when it was breaking, but everything works fine now.
>
> My model doesn't have a getText( String ) function, so I don't think that
> was it.
>
> If I run across it again, I will make a copy of the project and send it to
> you.
>
> Kelly
>
Thanks for putting some time and effort in to help!
regards,
Jeromy Evans

Attachment:
user_185427.ezm (zipped)Hi!
I want to store a file (any file mp3, avi, etc) on the database without
using blob datatype.
I just want to put the address of the file (in my Hard Disck) in mySQL and
load the address of the file to be played on web page.
but I have no idea how this can be done.
+---------------------------------------------
| id | address |
+---------------------------------------------
| 1 |c:\videos\video1.avi |
+---------------------------------------------
-just like you tube =)
Any help / suggestion is very much welcome!
God bless!
-Ryan Webb

Attachment:
user_185428.ezm (zipped)Matt, tanks for your help. But I need to persist with displayTags /:
I guess that there's some kind of validation inside struts 2 that doesnt
allow the correct work of ajaxtags..
Just take a look at my generated url from displaytag pagination.
http://localhost:8080/SGVDBA/view/usuario/UsuPesquisaResultados.jsp?
currentUsu.eMail=¤tUsu.chv=¤tUsu.dtGvr=&struts.enableJSONValidation=true
&buttonPesquisar=Pesquisar&dojo.currentUsu.dtGvr=&d-49489-p=2
Tanks all!
2008/4/14, matt.payne <matthew.b.payne@(protected)>:
>
>
> You could try struts2 + jquery + jgrid
> (http://trirand.com/jqgrid/jqgrid.html)
> If you need ajax, you need something that returns an json or xml response
> (insert you velocity, freemarker, json result, jsp result here).
>
> Matt
>
>
>
> Márcio Gurgel wrote:
> >
> > Hi all!
> >
> > Since this morning I'm having troubles to configure ajaxTags in my
> > project.
> > I followed the steps from ajaxTags web site, I also saw the ajaxTags
> show
> > case wich contains a example of display:table.
> > But doen't work...
> >
> > Is there some kind os special configuration for struts 2?
> > My displayTable is inside a <sx:tabbedPanel><sx:div>
> >
> > I also tried to use: useSelectedTabCookie="useSelectedTabCookie" to
> select
> > the correct tab when my displayTable pagination submits the page.
> > In this case, the content of the first tab doesn't appear.
> >
> > Regards.
> >
> > Márcio Gurgel
> >
> >
>
>
> --
> View this message in context:
> http://www.nabble.com/Struts-2-%2B-AjaxTags-%2B-DisplayTag-tp16670438p16689458.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185429.ezm (zipped)I have two select box. Suppose the initial values of the select boxes are as
follow :-
<s:select name = "select1" list="#{'Mandatory':'Mandatory',
'Optional':'Optional', 'Critical':'Critical'}" size="3"/>
<s:select name = "select2" list="#{'Mandatory':'Mandatory'}" size="3"/>
There will be two button "Add" and "Remove". So when user select one
element of "select1" and click "Add" button, the element should migrate to
the "select2" box.
And the "remove" button will do the opposite.
Can anyone please tell me how to do that in struts2 or how to write the
javascript for that.
--
Thanks & Regards
Arpan Debroy

Attachment:
user_185430.ezm (zipped)I believe these will help you out a bit:
http://struts.apache.org/2.0.11/docs/optiontransferselect.html
http://www.roseindia.net/struts/struts2/struts2uitags/optiontransferselect-tag.shtml
Cheers!
Ryan
On Tue, Apr 15, 2008 at 1:54 AM, Arpan Debroy <arpan.debroy@(protected)>
wrote:
> I have two select box. Suppose the initial values of the select boxes are
> as
> follow :-
>
> <s:select name = "select1" list="#{'Mandatory':'Mandatory',
> 'Optional':'Optional', 'Critical':'Critical'}" size="3"/>
>
> <s:select name = "select2" list="#{'Mandatory':'Mandatory'}" size="3"/>
>
> There will be two button "Add" and "Remove". So when user select one
> element of "select1" and click "Add" button, the element should migrate to
> the "select2" box.
> And the "remove" button will do the opposite.
>
> Can anyone please tell me how to do that in struts2 or how to write the
> javascript for that.
>
> --
> Thanks & Regards
> Arpan Debroy
>

Attachment:
user_185432.ezm (zipped)Hi Ryan,
Thats lovely.. :)
But I don't want so many buttons.
I need only two button as "Add" and "Remove".
How to do that?
On Tue, Apr 15, 2008 at 12:31 PM, Ryan <griggsrl@(protected):
> I believe these will help you out a bit:
>
> http://struts.apache.org/2.0.11/docs/optiontransferselect.html
>
> http://www.roseindia.net/struts/struts2/struts2uitags/optiontransferselect-tag.shtml
>
> Cheers!
> Ryan
>
>
> On Tue, Apr 15, 2008 at 1:54 AM, Arpan Debroy <arpan.debroy@(protected)>
> wrote:
>
> > I have two select box. Suppose the initial values of the select boxes
> are
> > as
> > follow :-
> >
> > <s:select name = "select1" list="#{'Mandatory':'Mandatory',
> > 'Optional':'Optional', 'Critical':'Critical'}" size="3"/>
> >
> > <s:select name = "select2" list="#{'Mandatory':'Mandatory'}" size="3"/>
> >
> > There will be two button "Add" and "Remove". So when user select one
> > element of "select1" and click "Add" button, the element should migrate
> to
> > the "select2" box.
> > And the "remove" button will do the opposite.
> >
> > Can anyone please tell me how to do that in struts2 or how to write the
> > javascript for that.
> >
> > --
> > Thanks & Regards
> > Arpan Debroy
> >
>
--
Thanks & Regards
Arpan Debroy

Attachment:
user_185433.ezm (zipped)Thanks Ryan,
My purpose is done. There are lot of options to change the label of the
buttons and to remove them from the page also.
On Tue, Apr 15, 2008 at 12:55 PM, Arpan Debroy <arpan.debroy@(protected)>
wrote:
> Hi Ryan,
> Thats lovely.. :)
> But I don't want so many buttons.
> I need only two button as "Add" and "Remove".
> How to do that?
>
>
> On Tue, Apr 15, 2008 at 12:31 PM, Ryan <griggsrl@(protected):
>
> > I believe these will help you out a bit:
> >
> > http://struts.apache.org/2.0.11/docs/optiontransferselect.html
> >
> > http://www.roseindia.net/struts/struts2/struts2uitags/optiontransferselect-tag.shtml
> >
> > Cheers!
> > Ryan
> >
> >
> > On Tue, Apr 15, 2008 at 1:54 AM, Arpan Debroy <arpan.debroy@(protected)>
> > wrote:
> >
> > > I have two select box. Suppose the initial values of the select boxes
> > are
> > > as
> > > follow :-
> > >
> > > <s:select name = "select1" list="#{'Mandatory':'Mandatory',
> > > 'Optional':'Optional', 'Critical':'Critical'}" size="3"/>
> > >
> > > <s:select name = "select2" list="#{'Mandatory':'Mandatory'}"
> > size="3"/>
> > >
> > > There will be two button "Add" and "Remove". So when user select one
> > > element of "select1" and click "Add" button, the element should
> > migrate to
> > > the "select2" box.
> > > And the "remove" button will do the opposite.
> > >
> > > Can anyone please tell me how to do that in struts2 or how to write
> > the
> > > javascript for that.
> > >
> > > --
> > > Thanks & Regards
> > > Arpan Debroy
> > >
> >
>
>
>
> --
> Thanks & Regards
> Arpan Debroy
>
>
--
Thanks & Regards
Arpan Debroy

Attachment:
user_185431.ezm (zipped)
Attachment:
user_185434.ezm (zipped)Flash scope is fairly common nowdays (for displaying messages) I
wonder if S2 2.011, has anything similar?
thanks,
Alex.

Attachment:
user_185435.ezm (zipped)There is the Struts 2 Scope Plugin [1], which does flash scope and a
lot more. Also, the message store interceptor, available in core
out-of-the-box, will persist action and error messages across a
redirect in a "flash" scope, which is very handy for registering
validation errors on a POST but having the response redirect the user
to a GET.
Don
[1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
<a.shneyderman@(protected):
> Flash scope is fairly common nowdays (for displaying messages) I
> wonder if S2 2.011, has anything similar?
>
> thanks,
> Alex.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185436.ezm (zipped)Oh, didn't see the 2.0.11.1 requirement...not sure if the message
store interceptor code is in that branch, but the scope plugin should
work just fine.
Don
On Tue, Apr 15, 2008 at 7:19 PM, Don Brown <donald.brown@(protected):
> There is the Struts 2 Scope Plugin [1], which does flash scope and a
> lot more. Also, the message store interceptor, available in core
> out-of-the-box, will persist action and error messages across a
> redirect in a "flash" scope, which is very handy for registering
> validation errors on a POST but having the response redirect the user
> to a GET.
>
> Don
>
> [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>
>
>
> On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
> <a.shneyderman@(protected):
> > Flash scope is fairly common nowdays (for displaying messages) I
> > wonder if S2 2.011, has anything similar?
> >
> > thanks,
> > Alex.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment:
user_185437.ezm (zipped)hello everybody,
my need would be to click a link in my web page,
and to associate a variable parameter to it,
giving the possibility to the action java code to
recognize the parameter string and compute a logic
depending on its value; to be more clear, i visualize
a dinamyc number of links, one for each id reflecting a
DB query computed before to obtain the id value list, and thus, i would like to use this id as a parameter for the same action for every link; tha action should use the id parameter to compute a second query, with the id used as a key-field.
How to specify the invocation of an action passing a parameter? i mean, how to invoke it via html, and how to
read the parameter via action java code?
Thanks a lot for every answer,
Marco and Daniele

Attachment:
user_185440.ezm (zipped)On Tue, Apr 15, 2008 at 11:33 AM, Danieleippoliti@(protected)
<Danieleippoliti@(protected):
> hello everybody,
> my need would be to click a link in my web page,
> and to associate a variable parameter to it,
> giving the possibility to the action java code to
> recognize the parameter string and compute a logic
> depending on its value; to be more clear, i visualize
> a dinamyc number of links, one for each id reflecting a
> DB query computed before to obtain the id value list, and thus, i would like to use this id as a parameter for the same action for every link; tha action should use the id parameter to compute a second query, with the id used as a key-field.
This is all what web applications are about, don't you think? :-)
> How to specify the invocation of an action passing a parameter? i mean, how to invoke it via html, and how to
> read the parameter via action java code?
You don't need to "read" parameters passed like in plain servlets,
they're injected into your action when it has the appropriate
properties (setter/getter). Take a look at the bootstrap section[1]
from the struts tutorials[2] on the homepage as a starting point, and
take a look at the showcase app, it should have tons of examples for
this.
Cheers,
-Ralf
[1] http://struts.apache.org/2.0.11.1/docs/bootstrap.html
[2] http://struts.apache.org/2.0.11.1/docs/tutorials.html

Attachment:
user_185438.ezm (zipped)
Attachment:
user_185439.ezm (zipped)The error message is pretty clear, you're missing some classes in your
classpath. The compile time classpath and runtime classpath is usually
not the same. Make sure that you have the required jar files in your
runtime classpath.
Nils-H
On Tue, Apr 15, 2008 at 12:04 PM, Peter Theissen <peter.theissen@(protected):
> Hi,
>
> back again with my problem. The root cause is:
> >>>
> SCHWERWIEGEND: Exception sending context initialized event to listener
> instance of class
org.springframework.web.context.ContextLoaderListener>
org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'personService': Injection of persistence methods failed;
> nested exception is
>
org.springframework.beans.factory.CannotLoadBeanClassException: Error
> loading class [
org.springframework.scheduling.quartz.SimpleTriggerBean] for
> bean with name 'simpleTrigger' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: problem with class file or dependent
> class; nested exception is
java.lang.NoClassDefFoundError:
> org/quartz/SimpleTrigger
> at
>
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues (
PersistenceAnnotationBeanPostProcessor.java:323)
> at
>
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:966)
> at
>
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> at
>
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> at
java.security.AccessController.doPrivileged(Native Method)
> at
>
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> at
>
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> at
>
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> at
>
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> at
>
org.springframework.beans.factory.support.AbstractBeanFactory.getBean (
AbstractBeanFactory.java:184)
> at
>
org.springframework.beans.factory.support.AbstractBeanFactory.getBean (
AbstractBeanFactory.java:163)
> at
>
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (
DefaultListableBeanFactory.java:430)
> at
>
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (
AbstractApplicationContext.java:729)
> at
>
org.springframework.context.support.AbstractApplicationContext.refresh (
AbstractApplicationContext.java:381)
> at
>
org.springframework.web.context.ContextLoader.createWebApplicationContext (
ContextLoader.java:254)
> at
>
org.springframework.web.context.ContextLoader.initWebApplicationContext (
ContextLoader.java:198)
> at
>
org.springframework.web.context.ContextLoaderListener.contextInitialized (
ContextLoaderListener.java:45)
> at
>
org.apache.catalina.core.StandardContext.listenerStart (
StandardContext.java:3843)
> at
>
org.apache.catalina.core.StandardContext.start (
StandardContext.java:4350)
> at
org.apache.catalina.core.ContainerBase.start (
ContainerBase.java:1045)
> at
org.apache.catalina.core.StandardHost.start (
StandardHost.java:719)
> at
org.apache.catalina.core.ContainerBase.start (
ContainerBase.java:1045)
> at
org.apache.catalina.core.StandardEngine.start (
StandardEngine.java:443)
> at
>
org.apache.catalina.core.StandardService.start (
StandardService.java:516)
> at
org.apache.catalina.core.StandardServer.start (
StandardServer.java:710)
> at
org.apache.catalina.startup.Catalina.start (
Catalina.java:578)
> at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at
java.lang.reflect.Method.invoke(Unknown Source)
> at
org.apache.catalina.startup.Bootstrap.start (
Bootstrap.java:288)
> at
org.apache.catalina.startup.Bootstrap.main (
Bootstrap.java:413)
> Caused by:
org.springframework.beans.factory.CannotLoadBeanClassException:
> Error loading class
> [
org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name
> 'simpleTrigger' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: problem with class file or dependent
> class; nested exception is
java.lang.NoClassDefFoundError:
> org/quartz/SimpleTrigger
> at
>
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass (
AbstractBeanFactory.java:1140)
> at
>
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType (
AbstractAutowireCapableBeanFactory.java:514)
> at
>
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:222)
> at
>
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType (
DefaultListableBeanFactory.java:304)
> at
>
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType (
DefaultListableBeanFactory.java:298)
> at
>
org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors (
BeanFactoryUtils.java:224)
> at
>
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory (
PersistenceAnnotationBeanPostProcessor.java:501)
> at
>
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory (
PersistenceAnnotationBeanPostProcessor.java:471)
> at
>
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:596)
> at
>
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:567)
> at
>
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:193)
> at
>
org.springframework.beans.factory.annotation.InjectionMetadata.injectMethods (
InjectionMetadata.java:116)
> at
>
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues (
PersistenceAnnotationBeanPostProcessor.java:320)
> ... 31 more
> Caused by:
java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger
> at
java.lang.ClassLoader.defineClass1(Native Method)
> at
java.lang.ClassLoader.defineClass(Unknown Source)
> at
java.security.SecureClassLoader.defineClass(Unknown Source)
> at
>
org.apache.catalina.loader.WebappClassLoader.findClassInternal (
WebappClassLoader.java:1819)
> at
>
org.apache.catalina.loader.WebappClassLoader.findClass (
WebappClassLoader.java:872)
> at
>
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1327)
> at
>
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1206)
> at
org.springframework.util.ClassUtils.forName (
ClassUtils.java:230)
> at
>
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass (
AbstractBeanDefinition.java:381)
> at
>
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass (
AbstractBeanFactory.java:1134)
> ... 43 more
> Caused by:
java.lang.ClassNotFoundException:
org.quartz.SimpleTrigger> at
>
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1360)
> at
>
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1206)
> at
java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 53 more
> <<<
>
> Best regards
> Peter
>
>
>
>
> > Peter Theissen wrote:
> >
> > > Hi,
> > >
> > > the quartz scheduler from Spring seemed to be a quite nice solution for
> > > my DB clean up service. Thanks for that hint.
> > > Now I have a quite curios problem. If I, e.g. create a bean in
> > > applicationContext.xml as follows:
> > > >>>
> > > <bean id="simpleTrigger"
> class="
org.springframework.scheduling.quartz.SimpleTriggerBean">
> > >
> > > <!-- props are first commented out, since they are not important for
> this issue
> > > <property name="jobDetail" ref="jobInvokation"/>
> > > <property name="repeatInterval" value="10000"/>
> > > -->
> > >
> > > </bean>
> > > <<<
> > > I get a
org.springframework.beans.factory.BeanCreationException:
> > > nested exception is
>
org.springframework.beans.factory.CannotLoadBeanClassException:
> > > Error loading class
> [
org.springframework.scheduling.quartz.SimpleTriggerBean]
> > >
> > > But anyhow, if I import the class using:
> > > import
org.springframework.scheduling.quartz.SimpleTriggerBean;
> > > in some POJO in the project everything is fine.
> > >
> > > What am I missing?
> > >
> >
> > The 'root cause' section of the stack trace? That should tell you why
> Spring can't instantiate the bean.
> >
> > L.
> >
> >
> > ---------------------------------------------------------------------
> > 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_185441.ezm (zipped)Hello,
I wish to display/read value that belongs to an enumerated type. Struts
seems to handle Class and Enum differently. For instance,
*xwork-conversion*
com.company.utils.Constants.EducationalQualification=com.company.ui.utils.EducationalQualificationConverter
java.util.Date=com.loandukaan.ui.utils.DateConverter
For the date parameter, the converter gets invoked. Whereas, for the type
EducationalQualification, the converter doesnt get invoked and the set
method in the form bean fails. Any thoughts?
--
Thanks
Ram

Attachment:
user_185442.ezm (zipped)hi,
A simple workaround would be defining the bean property as String type
rather than as the actual enum.
Then use the two enum type built in operations "name()" and "valueOf()"
to implement the getter and setter respectively.
If there is actually an elegant way to do it, I would also be interested
to know.
regards,
Giovanni
Ramanathan RV wrote:
> Hello,
>
> I wish to display/read value that belongs to an enumerated type. Struts
> seems to handle Class and Enum differently. For instance,
>
> *xwork-conversion*
> com.company.utils.Constants.EducationalQualification=com.company.ui.utils.EducationalQualificationConverter
>
java.util.Date=com.loandukaan.ui.utils.DateConverter
>
> For the date parameter, the converter gets invoked. Whereas, for the type
> EducationalQualification, the converter doesnt get invoked and the set
> method in the form bean fails. Any thoughts?
>
>
>
>

Attachment:
user_185443.ezm (zipped)Hi
On Tue, Apr 15, 2008 at 12:29 PM, Ramanathan RV <ramanathanrv@(protected):
> Hello,
>
> I wish to display/read value that belongs to an enumerated type. Struts
> seems to handle Class and Enum differently. For instance,
>
> *xwork-conversion*
> com.company.utils.Constants.EducationalQualification=com.company.ui.utils.EducationalQualificationConverter
>
java.util.Date=com.loandukaan.ui.utils.DateConverter
>
> For the date parameter, the converter gets invoked. Whereas, for the type
> EducationalQualification, the converter doesnt get invoked and the set
> method in the form bean fails. Any thoughts?
Actually this is xwork-behaviour. It already provides the class
com.opensymphony.xwork2.util.EnumTypeConverter[1], which you can
simply use to convert your Enum:
xwork-conversion.properties:
foo.bar.MyEnumeration = com.opensymphony.xwork2.util.EnumTypeConverter
If you don't like the default behaviour using the Enum name() as
representation in the page, you can always write your own type
converter[2].
Cheers,
-Ralf
[1] http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/util/EnumTypeConverter.html
[2] http://struts.apache.org/2.0.11.1/docs/type-conversion.html

Attachment:
user_185444.ezm (zipped)Perhaps this would be better asked on a mailing list relating to databases.
--- ryan webb <webb.ryan1@(protected):
> I want to store a file (any file mp3, avi, etc) on the database without
> using blob datatype.
No, you want to store the path of a file in the database.
> I just want to put the address of the file (in my Hard Disck) [...]
See?
> in mySQL and load the address of the file to be played on web page.
> but I have no idea how this can be done.
That confuses me. Why wouldn't you just store the path of the file in the
database like you're saying you want to? You provided an example of it.
What are you really asking, and how is it related to Struts?
Dave