Author Login
Post Reply
user Digest 27 Mar 2008 13:59:36 -0000 Issue 7946
Topics (messages 184670 through 184699):
Struts2 / Spring not working a a WAR in Weblogic9.1
184670 by: mpaschke
Re: Struts 2.1 autocompleter, get the value
184671 by: Musachy Barroso
184681 by: sassien
Re: OGNL runtime viewer
184672 by: stanlick
184675 by: Musachy Barroso
184676 by: stanlick.gmail.com
how to do: a double validation?
184673 by: xianwinwin
184674 by: Dave Newton
184678 by: xianwinwin
184679 by: Dave Newton
Re: Struts2 Action instances are not getting garbage collected
184677 by: Laurie Harper
184686 by: Prajapati Manish Narandas
184687 by: Alex Shneyderman
@ExpressionValidator - how to set the expression correctly ? (amount either greater than 0 or null? )
184680 by: xianwinwin
184698 by: Randy Burgess
Re: Struts2 Annotation based Validation
184682 by: Tauri Valor
184683 by: Dave Newton
184684 by: Tauri Valor
184688 by: Lukasz Lenart
Help on migration from struts1 to struts2
184685 by: vj,sandeep
How to use <data-source> in your own java file?
184689 by: Chen Chunwei
184690 by: Antonio Petrelli
184691 by: Chen Chunwei
Replacement for
org.apache.struts.taglib.html.FormTag and org.apache.struts.taglib.html.Constants.
184692 by: sandyvj83
184693 by: Antonio Petrelli
Struts 1 Javascript Question
184694 by: bhaarat Sharma
184695 by: Antonio Petrelli
Please answer this struts basic qtn
184696 by: pannar
184697 by: Antonio Petrelli
Dojo not working in Struts2.
184699 by: sharath karnati
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_184670.ezm (zipped)
I'm having a problem with using Struts2 and Spring with Weblogic9.1. When I
deploy the application as an exploded directory, no problem. Struts2
autowires without a problem. When I deploy as a WAR, with NO other changes,
autowire can't find the beans. Is there some special classpath setting I'm
missing, something I need to change when deploying as a war?
I have the basic settings correct (I think)
struts.properties:
struts.objectFactory=spring
struts.objectFactory.spring.autoWire=name
struts.objectFactory.spring.useClassCache=true
application-context.xml:
<beans default-autowire="autodetect">
...
Thanks!
Mike
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184671.ezm (zipped)By "get the selected value", do you mean to use the value on your
action? If that is the case, all you have to do is set name="myVar",
and then have a "myVar" field and a public setMyVar(...) method on
your action.
musachy
On Wed, Mar 26, 2008 at 1:19 PM, sassien <sassien@(protected):
>
> Hi everyone,
>
> I'm new to struts 2, and I finally managed to link 2 autocompleters using a
> few examples like this one:
> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp
>
> or this one:
>
> http://struts.apache.org/2.x/docs/autocompleter.html
>
> As it is done in the example, the first list does not come from an action,
> and we can get the value which is selected. The problem is: when the list is
> made by an action, like this one:
>
> <sx:autocompleter href="%{jsonList}" formId="selectForm"
> listenTopics="/changed"/>
>
> ok the list is made by the action and it works, but I really can't manage to
> get the selected value from it.
> I add name="anyVariableName", exactly the same way I do for the first
> version, but the value is never taken, I can see it in the log file from my
> application.
>
> I hope I managed to write a clear question, and I hope, too, that someone
> will be able to help me with this problem. I am sure it is not complicated,
> but up to now I have not been able to find it by myself...
>
> thanks,
> sassien
> --
> View this message in context: http://www.nabble.com/Struts-2.1-autocompleter%2C-get-the-value-tp16307105p16307105.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)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_184681.ezm (zipped)
Yes I mean to use the value on my action, and I did set name="myVar" and I do
have a "myVar" field and a public setMyVar() method on my action.
This is strange, because when I write my autocompleter this way:
<sx:autocompleter name="myValue" list="{'fruits','colors'}"
valueNotifyTopics="/changed" />
here the value is "stored" and I can use it in my action.
But if I write exactly the same autocompleter, but using an action, like
here:
<sx:autocompleter href="%{jsonList}" name="myValue"
valueNotifyTopics="/changed" />
... in this case it doesn't work... I mean the select box does work, it is
displayed, but no value is returned to the action. :-\
so I guess I must do something wrong, but I have to say I really don't know
what.
Maybe I have to specify that the action I use to fill the list is not the
same as the one which get the results.
Musachy Barroso wrote:
>
> By "get the selected value", do you mean to use the value on your
> action? If that is the case, all you have to do is set name="myVar",
> and then have a "myVar" field and a public setMyVar(...) method on
> your action.
>
> musachy
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184672.ezm (zipped)Wes --
I have a situation where the ParametersInterceptor cannot set a value on my
action on account of an invalid method signature. I know all about this,
but I'm bewildered at what *is* happening! It appears to be setting the
value someplace {valuestack?} because my subsequent page is revealing the
correct data selected from the <s:select/> control. Is there a way I can
issue a find() against the valuestack using the OGNL viewer?
Scott
Wesley Wannemacher wrote:
>
> Scott,
>
> Using the OGNL console is like working interactively with perl or
> python, you just issue commands in OGNL and they will be evaluated and
> printed in the console. Here is a quick sample session ->
>
> Welcome to the OGNL console!
> :-> #request
> {struts.valueStack=
com.opensymphony.xwork2.ognl.OgnlValueStack@(protected),
> __cleanup_recursion_counter=1, decorator=none}
>
> :-> execute()
> success
>
> :-> input()
> input
>
> :-> noMethod()
> null
>
> :-> #session
> {__sitemesh__robot=false,
> org.apache.struts2.interceptor.debugging.VALUE_STACK=com.opensymphony.xw
> ork2.ognl.OgnlValueStack@(protected)}
>
> :-> #application
> {
org.apache.myfaces.config.RuntimeConfig=org.apache.myfaces.config.Runti
> meConfig@(protected),
> [snip]
>
>
>> -----Original Message-----
>> From: stanlick [mailto:stanlick@(protected)]
>> Sent: Wednesday, September 26, 2007 11:29 AM
>> To: user@(protected)
>> Subject: Re: OGNL runtime viewer
>>
>>
>> Does *anyone* know where I can find the list of commands
>> understood by the OGNL console?
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184675.ezm (zipped)If you are on 2.1 you can use the context browser to navigate the
context. I think the value stack object is in the context, but I don't
remember the key and don't have the code at hand now.
musachy
On Wed, Mar 26, 2008 at 3:21 PM, stanlick <stanlick@(protected):
>
> Wes --
>
> I have a situation where the ParametersInterceptor cannot set a value on my
> action on account of an invalid method signature. I know all about this,
> but I'm bewildered at what *is* happening! It appears to be setting the
> value someplace {valuestack?} because my subsequent page is revealing the
> correct data selected from the <s:select/> control. Is there a way I can
> issue a find() against the valuestack using the OGNL viewer?
>
> Scott
>
>
>
>
> Wesley Wannemacher wrote:
> >
> > Scott,
> >
> > Using the OGNL console is like working interactively with perl or
> > python, you just issue commands in OGNL and they will be evaluated and
> > printed in the console. Here is a quick sample session ->
> >
> > Welcome to the OGNL console!
> > :-> #request
> > {struts.valueStack=
com.opensymphony.xwork2.ognl.OgnlValueStack@(protected),
> > __cleanup_recursion_counter=1, decorator=none}
> >
> > :-> execute()
> > success
> >
> > :-> input()
> > input
> >
> > :-> noMethod()
> > null
> >
> > :-> #session
> > {__sitemesh__robot=false,
> > org.apache.struts2.interceptor.debugging.VALUE_STACK=com.opensymphony.xw
> > ork2.ognl.OgnlValueStack@(protected)}
> >
> > :-> #application
> > {
org.apache.myfaces.config.RuntimeConfig=org.apache.myfaces.config.Runti
> > meConfig@(protected),
> > [snip]
> >
> >
> >> -----Original Message-----
> >> From: stanlick [mailto:stanlick@(protected)]
> >> Sent: Wednesday, September 26, 2007 11:29 AM
> >> To: user@(protected)
> >> Subject: Re: OGNL runtime viewer
> >>
> >>
> >> Does *anyone* know where I can find the list of commands
> >> understood by the OGNL console?
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/OGNL-runtime-viewer-tp12865906p16313828.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)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_184676.ezm (zipped)2.0.11
On Wed, Mar 26, 2008 at 4:00 PM, Musachy Barroso <musachy@(protected):
> If you are on 2.1 you can use the context browser to navigate the
> context. I think the value stack object is in the context, but I don't
> remember the key and don't have the code at hand now.
>
> musachy
>
> On Wed, Mar 26, 2008 at 3:21 PM, stanlick <stanlick@(protected):
> >
> > Wes --
> >
> > I have a situation where the ParametersInterceptor cannot set a value
> on my
> > action on account of an invalid method signature. I know all about
> this,
> > but I'm bewildered at what *is* happening! It appears to be setting
> the
> > value someplace {valuestack?} because my subsequent page is revealing
> the
> > correct data selected from the <s:select/> control. Is there a way I
> can
> > issue a find() against the valuestack using the OGNL viewer?
> >
> > Scott
> >
> >
> >
> >
> > Wesley Wannemacher wrote:
> > >
> > > Scott,
> > >
> > > Using the OGNL console is like working interactively with perl or
> > > python, you just issue commands in OGNL and they will be evaluated
> and
> > > printed in the console. Here is a quick sample session ->
> > >
> > > Welcome to the OGNL console!
> > > :-> #request
> > > {struts.valueStack=
com.opensymphony.xwork2.ognl.OgnlValueStack@(protected)
> ,
> > > __cleanup_recursion_counter=1, decorator=none}
> > >
> > > :-> execute()
> > > success
> > >
> > > :-> input()
> > > input
> > >
> > > :-> noMethod()
> > > null
> > >
> > > :-> #session
> > > {__sitemesh__robot=false,
> > >
> org.apache.struts2.interceptor.debugging.VALUE_STACK=com.opensymphony.xw
> > > ork2.ognl.OgnlValueStack@(protected)}
> > >
> > > :-> #application
> > > {
>
org.apache.myfaces.config.RuntimeConfig=org.apache.myfaces.config.Runti
> > > meConfig@(protected),
> > > [snip]
> > >
> > >
> > >> -----Original Message-----
> > >> From: stanlick [mailto:stanlick@(protected)]
> > >> Sent: Wednesday, September 26, 2007 11:29 AM
> > >> To: user@(protected)
> > >> Subject: Re: OGNL runtime viewer
> > >>
> > >>
> > >> Does *anyone* know where I can find the list of commands
> > >> understood by the OGNL console?
> > >>
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> > >
> >
> > --
> > View this message in context:
> http://www.nabble.com/OGNL-runtime-viewer-tp12865906p16313828.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)
> >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Scott
stanlick@(protected)

Attachment:
user_184673.ezm (zipped)
hi there,
say a user inputs a value for a double field (say amount of money); the
value should be a double (eg, 53.23)
Question: if the user enters something like ABCD how can I provide the error
message?
I would like to do that with annotation? (say....you enter an invalid
value...)
what type of validation whould that be?!?!?!
@Validations(
stringLengthFields ={
@StringLengthFieldValidator(type = ValidatorType.SIMPLE,
trim = true, minLength="1" , fieldName = "age", message = "you forgot this
one!!!! ")
}
)
public String updatePolicy()
{
// do something here
}
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184674.ezm (zipped)--- xianwinwin <xianwinwin@(protected):
>
> say a user inputs a value for a double field (say amount of money); the
> value should be a double (eg, 53.23)
>
> Question: if the user enters something like ABCD how can I provide the
> error message?
> I would like to do that with annotation? (say....you enter an invalid
> value...)
>
>
> what type of validation whould that be?!?!?!
Er... a Double validation?
http://struts.apache.org/2.x/docs/doublerangefieldvalidator-annotation.html
Dave

Attachment:
user_184678.ezm (zipped)
Thank you Dave!!!
yes, this works for checking the range but I wish to check the validity of
the field.
meaning, I'd like to provide my error message in case the user gave wrong
input. how do I do that?
Thank you again
newton.dave wrote:
>
> --- xianwinwin <xianwinwin@(protected):
>>
>> say a user inputs a value for a double field (say amount of money); the
>> value should be a double (eg, 53.23)
>>
>> Question: if the user enters something like ABCD how can I provide the
>> error message?
>> I would like to do that with annotation? (say....you enter an invalid
>> value...)
>>
>>
>> what type of validation whould that be?!?!?!
>
> Er... a Double validation?
>
> http://struts.apache.org/2.x/docs/doublerangefieldvalidator-annotation.html
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184679.ezm (zipped)--- xianwinwin <xianwinwin@(protected):
> yes, this works for checking the range but I wish to check the validity of
> the field. meaning, I'd like to provide my error message in case the user
> gave wrong input. how do I do that?
That would depend on what "wrong input" means.
If the existing validators do not provide the checking you need you can
create your own, register it via XML configuration, and use the
@CustomValidator (I think) annotation.
Dave

Attachment:
user_184677.ezm (zipped)Prajapati Manish Narandas wrote:
> Hi All,
> I am using struts2 with spring object factory.
> Here, spring is creating action class objects with request scope and
> injecting service layer dependency and service layer objects are singleton
> scope.
>
> here, even i have given request scope it doesnt ensure 100 % garbage
> collection of my all action class objects.
>
> Can anybody tell me a way so i can find all action objects garbage
> collected once action class has done
> its work.
What makes you think the action instances are not being garbage
collected? As long as they are request scoped they will be eligible for
garbage collection as soon as the request they are associated with has
completed processing, unless you are keeping a longer-lived reference to
them somewhere.
L.

Attachment:
user_184686.ezm (zipped)Thanx Laurie Harper,
I am using jprofiler to monitor instances.
you are right that it may be possible that my action classes might be
referencing
to any long lived objects and that prevents it from being garbage collected.
yeah, for some action classes spring inject singleton scoped service
dependecies so that might be reason for those action for not getting garbage
collected
but i have one action class which doesn't have any thing which can prevent
that class from
being garbage collected.
its as given below:
*
public* *class* AuctionCentralAction *extends* ActionSupport{
/**
*
*/
*private* *static* *final* *long* *serialVersionUID* = 1L;
*private* String catalogList;
*private* String previousCatalog;
*private* String previousCatalogList;
/**
* This method is called while loading the Auction central page.
* *@(protected)
*
*/
*public* String initialize() {
*this*.catalogList="Auction";
*this*.previousCatalogList = "Auction";
*this*.previousCatalog = "0";
*return* "auctionCentralAction";
}
/**
* This method is for validating the user going prior to the My personal
Account page.
* If user is valid then he will take to My personal Account page otherwise
same page will
* be displayed.
* *@(protected)
*
*/
*public* String viewPersonalAccountInfo()
{
String returnString;
UserContext user = ContextProviderRegistry.*getInstance*
().getContext().getUserContext();
String userRole = user.getUserRole();
*if*(userRole.equalsIgnoreCase("ROLE_USER") == *true*){
returnString = "viewPersonalInfo";
}*else*{
returnString = "auctionCentralAction";
}
*return* returnString;
}
*public* String getCatalogList() {
*return* catalogList;
}
*public* *void* setCatalogList(String catalogList) {
*this*.catalogList = catalogList;
}
*public* String getPreviousCatalog() {
*return* previousCatalog;
}
*public* *void* setPreviousCatalog(String previousCatalog) {
*this*.previousCatalog = previousCatalog;
}
*public* String getPreviousCatalogList() {
*return* previousCatalogList;
}
*public* *void* setPreviousCatalogList(String previousCatalogList) {
*this*.previousCatalogList = previousCatalogList;
}
}
In my case ,initialize() method will be executed, can anybody tell me
what's there in
the above class which can prevent this class from being garbage collected.
static data member or what?
thanx in advance,
Manish
On Thu, Mar 27, 2008 at 2:46 AM, Laurie Harper <laurie@(protected):
> Prajapati Manish Narandas wrote:
> > Hi All,
> > I am using struts2 with spring object factory.
> > Here, spring is creating action class objects with request scope and
> > injecting service layer dependency and service layer objects are
> singleton
> > scope.
> >
> > here, even i have given request scope it doesnt ensure 100 % garbage
> > collection of my all action class objects.
> >
> > Can anybody tell me a way so i can find all action objects garbage
> > collected once action class has done
> > its work.
>
>
> What makes you think the action instances are not being garbage
> collected? As long as they are request scoped they will be eligible for
> garbage collection as soon as the request they are associated with has
> completed processing, unless you are keeping a longer-lived reference to
> them somewhere.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184687.ezm (zipped)> yeah, for some action classes spring inject singleton scoped service
> dependecies so that might be reason for those action for not getting garbage
> collected
This can not be. The only way your action will not be garbage
collected if that action instance is refferenced from a long lived
object; not the other way around. Your actions should/could reference
singletons - nothing's wrong with that.
> but i have one action class which doesn't have any thing which can prevent
> that class from
> being garbage collected.
Nothing, that I can see. How do you know that it is not garbage
collected? Garbage collection is a tricky business. Just because you
do not see action classes being collected does not mean they are not
eligible. It might simply mean that GC does not need to collect them.
Alex.

Attachment:
user_184680.ezm (zipped)
Hi,
I have the following Expression Validator:
@ExpressionValidator(expression = "amount > 0", message = "err message")
what should come in the expression if amount can be either greater than 0 or
null?
thank you!
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184698.ezm (zipped)Did you try
@ExpressionValidator(expression = "(amount > 0) || (amount == null)",
message = "err message")
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
> From: xianwinwin <xianwinwin@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Wed, 26 Mar 2008 16:34:48 -0700 (PDT)
> To: <user@(protected)>
> Subject: @ExpressionValidator - how to set the expression correctly ? (amount
> either greater than 0 or null? )
>
>
> Hi,
>
> I have the following Expression Validator:
>
> @ExpressionValidator(expression = "amount > 0", message = "err message")
>
> what should come in the expression if amount can be either greater than 0 or
> null?
>
> thank you!
> --
> View this message in context:
> http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-corre
> ctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16319035.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)
>
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_184682.ezm (zipped)
Lukasz,
I tried as you advised. I get the default error message 'Please enter a
value for first name ' which is in the "message" .
Im expecting the error messaage from the properties file.
I think Im placing my properties file in the wrong location. And therefore
my validation returns me the default error message.
Im not sure where to place my properties file.
Thanks,
Tauri.
Lukasz Lenart wrote:
>
> You mess too many thing, please try like this:
>
> @RequiredStringValidator(key = "error.required", message = "Please
> enter a value for First name")
>
> error.required = ${fieldName} is required!
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184683.ezm (zipped)--- Tauri Valor <sudheersmail@(protected):
> I tried as you advised. I get the default error message 'Please enter a
> value for first name ' which is in the "message" .
>
> Im expecting the error messaage from the properties file.
>
> I think Im placing my properties file in the wrong location. And therefore
> my validation returns me the default error message.
>
> Im not sure where to place my properties file.
Depends. it can be in the same ackage as the action class and named
${actionClassName}.properties, for example. The localization docs [1] gives a
set of rules for locating resource files.
Dave
[1] http://struts.apache.org/2.0.11.1/docs/localization.html

Attachment:
user_184684.ezm (zipped)
Lukasz,
I tried as you advised. I get the default error message 'Please enter a
value for first name ' which is in the "message" .
Im expecting the error messaage from the properties file.
I think Im placing my properties file in the wrong location. And therefore
my validation returns me the default error message.
Im not sure where to place my properties file.
Thanks,
Tauri.
Lukasz Lenart wrote:
>
> You mess too many thing, please try like this:
>
> @RequiredStringValidator(key = "error.required", message = "Please
> enter a value for First name")
>
> error.required = ${fieldName} is required!
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184688.ezm (zipped)> > Im not sure where to place my properties file.
I almost always put my messages to file named package.properties in
the same folder as my action's classes.
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart

Attachment:
user_184685.ezm (zipped)Hi,
I am migrating an existing application from struts 1 to struts 2. It uses
MessageResources. I found out that the replacement for the same in struts2
(2.0.11)is WrapperMessageResources which extends from the MessageResources.
But to use the WrapperMessageRessource I need to use the struts
1.3.5-core.jar provided along with the struts 2.0.11 release otherwise I get
a compilation error as "MessageResources class not found. It is used
indirectly by one of the class files". So is it proper to use the struts
1.3.5-core.jar? If not Pls suggest a replacement for MessageResources.
Thanks,
Sandeep

Attachment:
user_184689.ezm (zipped)Hi all,
I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.
Talos

Attachment:
user_184690.ezm (zipped)2008/3/27, Chen Chunwei <out-chenchunwei@(protected)>:
> I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.
Use the "getDataSource" method in your action. Anyway, notice that it
is discouraged to use a data source this way. It is better to use JNDI
to take it from the container.
Antonio

Attachment:
user_184691.ezm (zipped)Thanks Antonio
I will try it.
Talos
----- Original Message -----
From: "Antonio Petrelli" <antonio.petrelli@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: How to use <data-source> in your own java file?
2008/3/27, Chen Chunwei <out-chenchunwei@(protected)>:
> I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.
Use the "getDataSource" method in your action. Anyway, notice that it
is discouraged to use a data source this way. It is better to use JNDI
to take it from the container.
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_184692.ezm (zipped)
Attachment:
user_184693.ezm (zipped)2008/3/27, sandyvj83 <sandeepvj83@(protected)>:
>
> Does someone know the replacement for
>
org.apache.struts.taglib.html.FormTag> and
org.apache.struts.taglib.html.Constants in struts 2.
Err... sorry Sandeep but I think that you are following a wrong approach.
If you want to convert an application from Struts 1 to Struts 2 you need to
learn Struts 2 almost from scratch. Don't think in "replacements", since
Struts 1 and 2 are two different things.
Antonio

Attachment:
user_184694.ezm (zipped)Hello
I am using struts 1 to show a link to the user like this
<html:link
page="/editProjectMonitor.do" paramId="report_id"
paramName="report"
paramProperty="reportId" target="_blank">
Edit</html:link>
However I want this link to open up from Javascript instead! For javascript
I have a code like the following
function openPopup() {
windowReference = window.open('/cmrs/editProjectMonitor.do?report_id=<%=WHAT
TO PUT HERE? SO I CAN GETT report_id value%>','windowName');
if (!windowReference.opener)
windowReference.opener = self;
}
what can i pass so that report_id value will come. I know in struts2 I could
have used the s:property tag...is there something similar in struts1?
Thanks!!

Attachment:
user_184695.ezm (zipped)2008/3/27, bhaarat Sharma <bhaarat.s@(protected)>:
> Hello
>
> I am using struts 1 to show a link to the user like this
> <html:link
> page="/editProjectMonitor.do" paramId="report_id"
> paramName="report"
> paramProperty="reportId" target="_blank">
> Edit</html:link>
>
> However I want this link to open up from Javascript instead!
Oh, the lazyness...
http://struts.apache.org/1.x/struts-taglib/tlddoc/html/link.html
The <html:link> has a "onclick" attribute. Imagine what's this for?
Antonio

Attachment:
user_184696.ezm (zipped)
Hi,
There was a interview question in Struts framework.
When i extend the Action class to implement the db/business logic, is it
possible to invoke my own business logic methods without overriding
execute() method of Action class??
regards
pannar
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184697.ezm (zipped)2008/3/27, pannar <nsveera2000@(protected)>:
>
> There was a interview question in Struts framework.
Mmm... ready for a "do your own homework" answer?
When i extend the Action class to implement the db/business logic
Bad habit, the db/business logic should be elsewhere, not in actions...
is it
> possible to invoke my own business logic methods without overriding
> execute() method of Action class??
If you don't know it, then probably you don't know Struts 1: I feel that you
wanted to fool your interviewer, right?
Sorry for the rant.
Antonio

Attachment:
user_184699.ezm (zipped)Hi All,
Please find 'test4Dialog.jsp' in attachment. This .jsp file is placed inside /WEB-INF/pages directory.
The same page I configured in struts2 action with below code
<action name="Dojo">
<result>/pages/test4Dialog.jsp</result>
</action>
dojo is not defined
dojo.require("dojo.parser");
I didn't place any dojo plugin jar files in my library? I think struts2 is supporting Dojo inclusively.
If I need
to install Dojo plugin to correct this problem then where I can find this .jar file(dojo plugin)?
Please let me know, how to correct this problem.
Have a nice day.
Thanks,
Sharath.
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.<html>
<head>
<s:head theme="ajax" debug="true"/>
<title>TooltipDialog demo</title>
<script type="text/javascript">
djConfig = { parseOnLoad: true }
</script>
<script src="dojoroot/dojo/dojo.js"></script>
<style type="text/css">
@import "dojoroot/dojo/resources/dojo.css";
@import "dojoroot/dijit/themes/tundra/tundra.css";
</style>
<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.form.Button");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.TextBox");
function checkPw(dialogFields) {
if (dialogFields.confirmpw != dialogFields.newpw)
alert("Confirmation password is different.");
}
</script>
</head>
<body class="tundra">
<div dojoType="dijit.form.DropDownButton">
<span>Login Form</span>
<div dojoType="dijit.TooltipDialog" id="dialog1"
title="Login Form" execute="checkPw(arguments[0]);">
<table>
<tr>
<td><label for="name" title="User name">
Username</label></td>
<td><input dojoType="dijit.form.TextBox"
type="text" name="oldpw"></td>
</tr>
<tr>
<td><label for="loc">Password: </label></td>
<td><input dojoType="dijit.form.TextBox"
type="password" name="newpw"></td>
</tr>
<tr>
<td><label for="desc">Confirm Password: </label></td>
<td><input dojoType="dijit.form.TextBox"
type="password" name="confirmpw"></td>
</tr>
<tr>
<td colspan="2" align="center">
<button dojoType="dijit.form.Button"
type="submit">Login</button></td>
</tr>
</table>
</div>
</div>
</body>
</html>