s:url - escapeAmp Problem

2009-01-07 Thread Himanshu Rathore
Hi,

Can anyone please tell me what I'm doing wrong?


s:url id=url action=register_load escapeAmp=true

s:param name=userId value=%{userId}/

s:param name=callingPage value='callingPage'/

/s:url
URL is still showing me amp; instead of .

-- 
Regards,
Himanshu Rathore


Conditional Annotation based Validation

2009-01-07 Thread Dirk Forchel

I have two radio buttons for a form property named privatePerson with two
possible values ('true' and 'false') which toogles the view of my input form
with three different input fields (number1, number2, name).
If the user choose private the number1, number2 and name input fields are
shown, if the user choose non-private only the number1 input field is
shown.
For the first choise I would use annotation based validation like

@Validations(
   requiredStrings = {...@requiredstringvalidator(type = ValidatorType.SIMPLE,
fieldName = name, message = You must enter a name.)},
   stringLengthFields = {...@stringlengthfieldvalidator(type =
ValidatorType.SIMPLE, trim = true, minLength=6, maxLength = 6, fieldName
= number1, message = The first part of the number must be 6 digits
long.), @StringLengthFieldValidator(type = ValidatorType.SIMPLE, trim =
true, minLength=4, maxLength = 4, fieldName = number2, message = The
second part of the number must be 4 digits long.),
}
)
public String execute() throws Exception {
...
}

If the user selects non-private only the following validator should be
used.

@Validations(
stringLengthFields = {...@stringlengthfieldvalidator(type =
ValidatorType.SIMPLE, trim = true, minLength=8, maxLength = 8, fieldName
= number1, message = The first part of the number must be 8 digits
long.),
}
)
public String execute() throws Exception {
...
}


How can I accomplish this conditional annotation based validation?
-- 
View this message in context: 
http://www.nabble.com/Conditional-Annotation-based-Validation-tp21328921p21328921.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: confirm unsubscribe from user@struts.apache.org

2009-01-07 Thread battipatisainagendra Bhavaniprasad
Hi,
I am prasad i am new to open source.I am interested in
participating in ASF (Any Project).Let me tell about me first.I am basically
test engineer with 5+ years of exp.I know selenium tool which is web
functional testing tool.I visited the ASF home page but there are many
projects.Let me know who ever is eagerly waiting for some testing work using
selenium,i am ready to contribute.

please reply ASAP.

Rgds,
Prasad


On Wed, Jan 7, 2009 at 4:27 PM, battipatisainagendra Bhavaniprasad 
sainagendrabhavanipra...@gmail.com wrote:



 On Wed, Jan 7, 2009 at 4:26 PM, user-h...@struts.apache.org wrote:

 Hi! This is the ezmlm program. I'm managing the
 user@struts.apache.org mailing list.

 I'm working for my owner, who can be reached
 at user-ow...@struts.apache.org.

 To confirm that you would like

   sainagendrabhavanipra...@gmail.com

 removed from the user mailing list, please send a short reply
 to this address:

   user-uc.1231325797.hbihlapfbfnjhjfopdcf-sainagendrabhavaniprasad=
 gmail@struts.apache.org

 Usually, this happens when you just hit the reply button.
 If this does not work, simply copy the address and paste it into
 the To: field of a new message.

 or click here:
mailto:
 user-uc.1231325797.hbihlapfbfnjhjfopdcf-sainagendrabhavaniprasad=
 gmail@struts.apache.org

 I haven't checked whether your address is currently on the mailing list.
 To see what address you used to subscribe, look at the messages you are
 receiving from the mailing list. Each message has your address hidden
 inside its return path; for example, m...@xdd.ff.com receives messages
 with return path: user-return-number-mary=xdd.ff@struts.apache.org
 .

 Some mail programs are broken and cannot handle long addresses. If you
 cannot reply to this request, instead send a message to
 user-requ...@struts.apache.org and put the entire address listed above
 into the Subject: line.


 --- Administrative commands for the user list ---

 I can handle administrative requests automatically. Please
 do not send them to the list address! Instead, send
 your message to the correct command address:

 To subscribe to the list, send a message to:
   user-subscr...@struts.apache.org

 To remove your address from the list, send a message to:
   user-unsubscr...@struts.apache.org

 Send mail to the following for info and FAQ for this list:
   user-i...@struts.apache.org
   user-...@struts.apache.org

 Similar addresses exist for the digest list:
   user-digest-subscr...@struts.apache.org
   user-digest-unsubscr...@struts.apache.org

 To get messages 123 through 145 (a maximum of 100 per request), mail:
   user-get.123_...@struts.apache.org

 To get an index with subject and author for messages 123-456 , mail:
   user-index.123_...@struts.apache.org

 They are always returned as sets of 100, max 2000 per request,
 so you'll actually get 100-499.

 To receive all messages with the same subject as message 12345,
 send a short message to:
   user-thread.12...@struts.apache.org

 The messages should contain one line or word of text to avoid being
 treated as s...@m, but I will ignore their content.
 Only the ADDRESS you send to is important.

 You can start a subscription for an alternate address,
 for example j...@host.domain, just add a hyphen and your
 address (with '=' instead of '@') after the command word:
 user-subscribe-john=host.dom...@struts.apache.org

 To stop subscription for this address, mail:
 user-unsubscribe-john=host.dom...@struts.apache.org

 In both cases, I'll send a confirmation message to that address. When
 you receive it, simply reply to it to complete your subscription.

 If despite following these instructions, you do not get the
 desired results, please contact my owner at
 user-ow...@struts.apache.org. Please be patient, my owner is a
 lot slower than I am ;-)

 --- Enclosed is a copy of the request I received.

 Return-Path: sainagendrabhavanipra...@gmail.com
 Received: (qmail 96416 invoked by uid 99); 7 Jan 2009 10:56:37 -
 Received: from athena.apache.org (HELO athena.apache.org)
 (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2009 02:56:37
 -0800
 X-ASF-Spam-Status: No, hits=-2.9 required=10.0

  
 tests=ASF_EMPTY_LIST_OPS,ASF_LIST_OPS,EMPTY_MESSAGE,HTML_MESSAGE,MISSING_SUBJECT,SPF_PASS
 X-Spam-Check-By: apache.org
 Received-SPF: pass (athena.apache.org: domain of
 sainagendrabhavanipra...@gmail.com designates 209.85.198.232 as permitted
 sender)
 Received: from [209.85.198.232] (HELO rv-out-0506.google.com)
 (209.85.198.232)
by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2009 10:56:30
 +
 Received: by rv-out-0506.google.com with SMTP id l9so9400596rvb.47
for user-unsubscr...@struts.apache.org; Wed, 07 Jan 2009
 02:56:10 -0800 (PST)
 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from:to
 :subject:mime-version:content-type;
  

Re: s:url - escapeAmp Problem

2009-01-07 Thread Bert Van den Brande
From the documentation : http://struts.apache.org/2.1.2/docs/url.html
escapeAmp : Specifies whether to escape ampersand () to (amp or not

So I guess in order to have the url showing  you need to set
escapeAmp to false ...

On Wed, Jan 7, 2009 at 10:14 AM, Himanshu Rathore
mymailsubscript...@gmail.com wrote:
 Hi,

 Can anyone please tell me what I'm doing wrong?


 s:url id=url action=register_load escapeAmp=true

 s:param name=userId value=%{userId}/

 s:param name=callingPage value='callingPage'/

 /s:url
 URL is still showing me amp; instead of .

 --
 Regards,
 Himanshu Rathore


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



How to Contribute Selenium Tests to Struts (was Re: confirm unsubscribe from user@struts.apache.org)

2009-01-07 Thread Ted Husted
Apache open source projects, like Struts, communicate through the public
mailing lists. Be sure to take the time to carefully read the Struts Mailing
List page. (I wish it could be shorter, but every point on the page is
important.)

When looking for development work, the best place to ask is the dev list.
All project, including Struts, are always looking for more unit and
acceptance tests. Take the time to download the distribution and setup a
development environment to run the tests that we already have, and then look
for gaps in the testing coverage.

The most important tip is show us the code. Go ahead and create some
Selenium tests for the example applications, and post them to the dev list.
Open source projects prize self-starters.

HTH, Ted.

On Wed, Jan 7, 2009 at 6:03 AM, battipatisainagendra Bhavaniprasad 
sainagendrabhavanipra...@gmail.com wrote:

 Hi,
 I am prasad i am new to open source.I am interested in
 participating in ASF (Any Project).Let me tell about me first.I am basically
 test engineer with 5+ years of exp.I know selenium tool which is web
 functional testing tool.I visited the ASF home page but there are many
 projects.Let me know who ever is eagerly waiting for some testing work using
 selenium,i am ready to contribute.

 please reply ASAP.

 Rgds,
 Prasad


 On Wed, Jan 7, 2009 at 4:27 PM, battipatisainagendra Bhavaniprasad 
 sainagendrabhavanipra...@gmail.com wrote:



 On Wed, Jan 7, 2009 at 4:26 PM, user-h...@struts.apache.org wrote:

 Hi! This is the ezmlm program. I'm managing the
 user@struts.apache.org mailing list.

 I'm working for my owner, who can be reached
 at user-ow...@struts.apache.org.

 To confirm that you would like

   sainagendrabhavanipra...@gmail.com

 removed from the user mailing list, please send a short reply
 to this address:

   user-uc.1231325797.hbihlapfbfnjhjfopdcf-sainagendrabhavaniprasad=
 gmail@struts.apache.org

 Usually, this happens when you just hit the reply button.
 If this does not work, simply copy the address and paste it into
 the To: field of a new message.

 or click here:
mailto:
 user-uc.1231325797.hbihlapfbfnjhjfopdcf-sainagendrabhavaniprasad=
 gmail@struts.apache.org

 I haven't checked whether your address is currently on the mailing list.
 To see what address you used to subscribe, look at the messages you are
 receiving from the mailing list. Each message has your address hidden
 inside its return path; for example, m...@xdd.ff.com receives messages
 with return path: user-return-number-mary=xdd.ff.com@
 struts.apache.org.

 Some mail programs are broken and cannot handle long addresses. If you
 cannot reply to this request, instead send a message to
 user-requ...@struts.apache.org and put the entire address listed above
 into the Subject: line.


 --- Administrative commands for the user list ---

 I can handle administrative requests automatically. Please
 do not send them to the list address! Instead, send
 your message to the correct command address:

 To subscribe to the list, send a message to:
   user-subscr...@struts.apache.org

 To remove your address from the list, send a message to:
   user-unsubscr...@struts.apache.org

 Send mail to the following for info and FAQ for this list:
   user-i...@struts.apache.org
   user-...@struts.apache.org

 Similar addresses exist for the digest list:
   user-digest-subscr...@struts.apache.org
   user-digest-unsubscr...@struts.apache.org

 To get messages 123 through 145 (a maximum of 100 per request), mail:
   user-get.123_...@struts.apache.org

 To get an index with subject and author for messages 123-456 , mail:
   user-index.123_...@struts.apache.org

 They are always returned as sets of 100, max 2000 per request,
 so you'll actually get 100-499.

 To receive all messages with the same subject as message 12345,
 send a short message to:
   user-thread.12...@struts.apache.org

 The messages should contain one line or word of text to avoid being
 treated as s...@m, but I will ignore their content.
 Only the ADDRESS you send to is important.

 You can start a subscription for an alternate address,
 for example j...@host.domain, just add a hyphen and your
 address (with '=' instead of '@') after the command word:
 user-subscribe-john=host.dom...@struts.apache.org

 To stop subscription for this address, mail:
 user-unsubscribe-john=host.dom...@struts.apache.org

 In both cases, I'll send a confirmation message to that address. When
 you receive it, simply reply to it to complete your subscription.

 If despite following these instructions, you do not get the
 desired results, please contact my owner at
 user-ow...@struts.apache.org. Please be patient, my owner is a
 lot slower than I am ;-)

 --- Enclosed is a copy of the request I received.

 Return-Path: sainagendrabhavanipra...@gmail.com
 Received: (qmail 96416 invoked by uid 99); 7 Jan 2009 10:56:37 -
 Received: from athena.apache.org (HELO athena.apache.org)
 (140.211.11.136)
by apache.org 

Re: Struts 2.1.2 - Xwork 2.1.1 ParametersInterceptor ERROR

2009-01-07 Thread Musachy Barroso
Is trying to set the field {5543}_traineeNights in
IntegrationStageOfAction which is not a valid java identifier

musachy

On Wed, Jan 7, 2009 at 1:26 AM, nodje nodje...@gmail.com wrote:

 Hi,

 i'm getting this error:

 ERROR ParametersInterceptor.error:24 | ParametersInterceptor -
 [setParameters]: Unexpected Exception caught setting '{5543}_traineeNights'
 on 'class
 com.company.client.project.integrationstage.action.IntegrationStageOfAction:
 Error setting expression '{5543} _traineeNights' with value
 '[Ljava.lang.String;@d1f2da5'
 ognl.ExpressionSyntaxException: Malformed OGNL expression: {5543}
 _traineeKmNumbers [ognl.ParseException: Encountered _traineeKmNumbers at
 line 1, column 7.

 Is the usage of curly braces in parameters name a problem?

 cheers



 --
 View this message in context: 
 http://www.nabble.com/Struts-2.1.2---Xwork-2.1.1-ParametersInterceptor-ERROR-tp21325653p21325653.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: s:url - escapeAmp Problem

2009-01-07 Thread Himanshu Rathore
Hi Bert,

Thanks for your help.

On Wed, Jan 7, 2009 at 5:56 PM, Bert Van den Brande cyr...@gmail.comwrote:

 From the documentation : http://struts.apache.org/2.1.2/docs/url.html
 escapeAmp : Specifies whether to escape ampersand () to (amp or not

 So I guess in order to have the url showing  you need to set
 escapeAmp to false ...

 On Wed, Jan 7, 2009 at 10:14 AM, Himanshu Rathore
 mymailsubscript...@gmail.com wrote:
  Hi,
 
  Can anyone please tell me what I'm doing wrong?
 
 
  s:url id=url action=register_load escapeAmp=true
 
  s:param name=userId value=%{userId}/
 
  s:param name=callingPage value='callingPage'/
 
  /s:url
  URL is still showing me amp; instead of .
 
  --
  Regards,
  Himanshu Rathore
 

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




-- 
Regards,
Himanshu Rathore


Re: Conditional Annotation based Validation

2009-01-07 Thread Dave Newton
AFAIK the expression validator is available via annotations. You can 
also use a custom validator but I find it a little clumsy with annotations.


Personally, as soon as validation gets even remotely complicated I fall 
back to using Java-based validation--I just think it's easier to 
maintain and much more clear.


I'll sometimes use a combination of both Java-based and either XML or 
annotations if it makes sense to.


On a side note, IIRC the trim attribute/parameter only applies the 
trim during validation--not on the value set on the action property.


Dave

Dirk Forchel wrote:

I have two radio buttons for a form property named privatePerson with two
possible values ('true' and 'false') which toogles the view of my input form
with three different input fields (number1, number2, name).
If the user choose private the number1, number2 and name input fields are
shown, if the user choose non-private only the number1 input field is
shown.
For the first choise I would use annotation based validation like

@Validations(
   requiredStrings = {...@requiredstringvalidator(type = ValidatorType.SIMPLE,
fieldName = name, message = You must enter a name.)},
   stringLengthFields = {...@stringlengthfieldvalidator(type =
ValidatorType.SIMPLE, trim = true, minLength=6, maxLength = 6, fieldName
= number1, message = The first part of the number must be 6 digits
long.), @StringLengthFieldValidator(type = ValidatorType.SIMPLE, trim =
true, minLength=4, maxLength = 4, fieldName = number2, message = The
second part of the number must be 4 digits long.),
  		}
)

public String execute() throws Exception {
...
}

If the user selects non-private only the following validator should be
used.

@Validations(
stringLengthFields = {...@stringlengthfieldvalidator(type =
ValidatorType.SIMPLE, trim = true, minLength=8, maxLength = 8, fieldName
= number1, message = The first part of the number must be 8 digits
long.),
}
)

public String execute() throws Exception {
...
}


How can I accomplish this conditional annotation based validation?




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



Re: Getting an URL for an Action

2009-01-07 Thread Musachy Barroso
hum, there is no right way after all. If you end up using UrlHelper,
take a look at how it is used in ServletUrlRenderer:renderFormUrl,
different methods are used depending on whether an action mapping was
found or not.

musachy

On Wed, Jan 7, 2009 at 12:00 AM, Chris Pratt thechrispr...@gmail.com wrote:
 Is there a right way to do it?
  (*Chris*)

 On Tue, Jan 6, 2009 at 5:24 PM, Musachy Barroso musa...@gmail.com wrote:

 I wouldn't advise you to use UrlHelper, given that Struts 2 doesn't
 have an API, that class can change without warning (it does from time
 to time)

 musachy

 On Tue, Jan 6, 2009 at 7:56 PM, Chris Pratt thechrispr...@gmail.com
 wrote:
  I'm trying to turn an action name into an URL from within another action.
  I've tried:
 
  UrlHelper.buildUrl(action-name,request,response,null)
 
  Which seems to just return action-name.  And I've tried:
 
  UrlHelper.buildUrl(/action-name,request,response,null)
 
  Which returns /context/action-name, which is a little closer, but still
  isn't the full, working URL.
 
  What am I missing?
   (*Chris*)
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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






-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re : Performance issue

2009-01-07 Thread François Rouxel
Are you using many interceptors?

  




- Message d'origine 
De : Pierre Thibaudeau pierre.thibaud...@gmail.com
À : Struts Users Mailing List user@struts.apache.org
Envoyé le : Mardi, 6 Janvier 2009, 16h19mn 36s
Objet : Re: Performance issue

Yes the model is *exactly* the same in the two cases.  In fact, both
S1 and S2 exist concurrently in the same Tomcat application.

Each test is run using JMeter, with 10 users who randomly try to
access one of 42 different pages involving 10 different types of
results (that is, roughly speaking, 10 different JSPs, abstracting
from the fact that each page is really composed of 6 or 7 different
JSP tiles).  In total, roughly 1,600 pages were queried for each test.
Moreover, each test was performed after re-starting Tomcat, once the
pages had been warmed up.

My last post in this thread was fairly extreme, and I felt the need to
make new tests that relied on fewer assumptions and more on hard
facts.  So I modified the pages tested as best I could, in order to
make the respective S1 pages and S2 pages as close to identical as
possible.  In particular, this meant beefing up my old S1 pages,
adding to them some of the more recent sections that existed only in
the S2 version:  mostly (but not exclusively) a lot of javascrip/dojo
stuff, which is not interpreted anyway by JMeter. (I don't rely on S2
for dojo, but provide my own; and yes, I package and shrinksafe it).

Since my original timing for S1 pages were so ridiculously low (often
under 10 ms!!!), the new beefed-up S1 pages were bound to be
significantly slower.
On average, with the beefed-up pages, S1 pages take 74 ms to load.

Since last running the S2 tests (about 4 days ago), I did a fair
amount of optimizing and I replaced the most obvious s:tags by
c:ones in about half of the JSPs. I therefore re-ran the tests just
before writing this current post.
There is a marked improvement and, on average, S2 pages load in 169 ms.

In other words, I may have been a little (!) hasty in posting my
previous statement! (*blushing*)  My apologies to all the people who
care about S2!!!
We are happily very far from the apocalyptic 30x factor that I had
previously observed.  (Some tests last week were showing averages of
580 ms per S2-page!)

As I am under pressure, I may not have time immediately to set up a
new test to compare the most recent result with the case of S2 pages
that entirely rely on s:tags, though that would be very
enlightening.  If I can get round to it, I promise to post the
results!

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




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



Re: unable to upload a txt file using fileupload ,

2009-01-07 Thread srinivasa_v .
when i try upload a file of 0 bytes its giving an exception, where can
i define minSize for file

regards
srinivas

On Tue, Jan 6, 2009 at 8:14 PM, Dave Newton newton.d...@yahoo.com wrote:

  srinivasa_v . wrote:

 Iam unable to upload a txt file using fileupload ,

 param name=allowedTypes

 image/jpeg,image/gif,image/pjpeg,image/bmp,text/html,text/plain,text/css,text/txt
 /param



 That's not much information to go on.

 Dave

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




Tiles with Struts 2.1.5

2009-01-07 Thread Ercan Kayaonu
Hi,
I'm using Struts 2.1.5 with convention plugin. I'm in the learning process
and trying several things (action, rule annotations, hibernate etc).
Everything was working ok until today.  i started using Tiles.
I copied

struts2-tiles-plugin-2.1.5.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar files into my lib folder. These files come with struts
2.1.5.

I added
listener

listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-class
/listener
to web.xml file.

This is my struts.xml:
struts
package name=default extends=struts-default  (There was also
namespace=/, but later i removed it. but nothing changed)
result-types
result-type name=tiles
class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package
/struts

I couldn't quite understand this package thing. Maybe the problem is with my
struts file. I can also paste tiles.xml if it is necessary to diagnose the
problem.
I get
HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are the
lines from eclipse console:

SEVERE: Exception sending context initialized event to listener instance of
class org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
at org.apache.tiles.definition.UrlDefinitionsFactory.init
at
org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
at org.apache.tiles.impl.BasicTilesContainer.init
..

Thanks in advance. Sorry for keeping it long.


Re: Tiles with Struts 2.1.5

2009-01-07 Thread Musachy Barroso
You are missing dependencies, in this case Commons Digester
(http://commons.apache.org/digester/)

musachy

On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
 Hi,
 I'm using Struts 2.1.5 with convention plugin. I'm in the learning process
 and trying several things (action, rule annotations, hibernate etc).
 Everything was working ok until today.  i started using Tiles.
 I copied

 struts2-tiles-plugin-2.1.5.jar
 tiles-api-2.0.6.jar
 tiles-core-2.0.6.jar
 tiles-jsp-2.0.6.jar files into my lib folder. These files come with struts
 2.1.5.

 I added
listener

 listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-class
/listener
 to web.xml file.

 This is my struts.xml:
 struts
package name=default extends=struts-default  (There was also
 namespace=/, but later i removed it. but nothing changed)
result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package
 /struts

 I couldn't quite understand this package thing. Maybe the problem is with my
 struts file. I can also paste tiles.xml if it is necessary to diagnose the
 problem.
 I get
 HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are the
 lines from eclipse console:

 SEVERE: Exception sending context initialized event to listener instance of
 class org.apache.struts2.tiles.StrutsTilesListener
 java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
at org.apache.tiles.definition.UrlDefinitionsFactory.init
at
 org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
at org.apache.tiles.impl.BasicTilesContainer.init
 ..

 Thanks in advance. Sorry for keeping it long.




-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: Design Question

2009-01-07 Thread Musachy Barroso
Plugins are not that different than putting all those mappings,
classes, etc in the webapp. The limitations would be the same as the
S2 limitations (in theory at least).

musachy

On Tue, Jan 6, 2009 at 7:24 PM, Dan Daly dancd...@yahoo.com wrote:
 Hello,

 I am working on an application that needs different sets of functionality 
 based on where it is installed.  The Struts 2 plugin mechanism looks like a 
 perfect solution as it would all us to write sets of plugins that we could 
 install as needed.

 The upper bound on the number of plug-ins that might be shipped with any 
 single installation would be around 30-40.  Does this sound like a reasonable 
 or am I pushing the envelope on the use of plug-ins?

 Thanks,
 dan







-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



[S2] best practice for reading POST body in an action

2009-01-07 Thread John Cartwright

Hello All,

Is there a best practice for using the body of a POST request w/in an 
action?  The request is not key/value pairs but a blob of XML.  Before I 
dropped back to using a traditional HTTPServletRequest approach, I'd see 
if there was a better way in S2.


Thanks!

--john


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



[S2] remove empty request parameters

2009-01-07 Thread John Cartwright

Hello All,

Can someone provide a recommendation for removing empty request 
parameters before the Params interceptor sees them?  Can Params 
interceptor simply be configured to ignore request parameters with no value?


Thanks!

--john


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



[S2] expected error in using ParamsPrepareParams stack and model-driven actions

2009-01-07 Thread John Cartwright

Hello All,

Is it expected to receive errors from the first invocation of the Params 
interceptor since there are not commonly setters for all the model 
properties and prepare has not yet had  a chance to retrieve the model?


Thanks!

--john


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



Re: [S2] remove empty request parameters

2009-01-07 Thread Dave Newton

John Cartwright wrote:
Can someone provide a recommendation for removing empty request 
parameters before the Params interceptor sees them?  Can Params 
interceptor simply be configured to ignore request parameters with no 
value?


I'd probably just create a quick interceptor to do that, if that's 
actually the functionality you require.


Dave


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



RE: Tiles with Struts 2.1.5

2009-01-07 Thread Biesbrock, Kevin
Aha!  I had this same problem and was planning on submitting it today.
You beat me to it.

Commons Digester does not appear to be released with Struts 2.x ...
unless it is not named with Digester or I'm missing it.


Beez
( 4961 

-Original Message-
From: Musachy Barroso [mailto:musa...@gmail.com] 
Sent: Wednesday, January 07, 2009 10:43 AM
To: Struts Users Mailing List
Subject: Re: Tiles with Struts 2.1.5

You are missing dependencies, in this case Commons Digester
(http://commons.apache.org/digester/)

musachy

On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com
wrote:
 Hi,
 I'm using Struts 2.1.5 with convention plugin. I'm in the learning 
 process and trying several things (action, rule annotations, hibernate
etc).
 Everything was working ok until today.  i started using Tiles.
 I copied

 struts2-tiles-plugin-2.1.5.jar
 tiles-api-2.0.6.jar
 tiles-core-2.0.6.jar
 tiles-jsp-2.0.6.jar files into my lib folder. These files come with 
 struts 2.1.5.

 I added
listener


listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-c
lass
/listener
 to web.xml file.

 This is my struts.xml:
 struts
package name=default extends=struts-default  (There was
also
 namespace=/, but later i removed it. but nothing changed)
result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package
 /struts

 I couldn't quite understand this package thing. Maybe the problem is 
 with my struts file. I can also paste tiles.xml if it is necessary to 
 diagnose the problem.
 I get
 HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are
the
 lines from eclipse console:

 SEVERE: Exception sending context initialized event to listener 
 instance of class org.apache.struts2.tiles.StrutsTilesListener
 java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
at org.apache.tiles.definition.UrlDefinitionsFactory.init
at
 org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
at org.apache.tiles.impl.BasicTilesContainer.init
 ..

 Thanks in advance. Sorry for keeping it long.




--
Hey you! Would you help me to carry the stone? Pink Floyd

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




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



Re: Tiles with Struts 2.1.5

2009-01-07 Thread Ercan Kayaonu
Thank you Musachy,
That solved my problem, but
I got this error, which might be very familiar for most of you:

The Result type [tiles] which is defined in the Result annotation on the
class [class actions.admin.LoginAction] or determined by the file extension
or is the default result type for the PackageConfig of the action, could not
be found as a result-type defined for the Struts/XWork package
[actions.admin#convention-default#/admin/login] - [unknown location]

actions.admin.LoginAction.java:

  @Action(value=/admin/login/index,result...@result(name=success,
type=tiles, location=admin.login) })   (I have definition in tiles.xml
for admin.login.)
  public String execute() {
return SUCCESS;
}

struts.xml :
package name=default  namespace=/ extends=struts-default
result-types
result-type name=tiles
class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package

Can anyone explain what name=default stands for, because i changed it as
name=admin, i got the same error.
and also [actions.admin#convention-default#/admin/login] .  What is
#convention-default# ? Is it actions because convention plugin looks for
actions package. Or is it something we define in config files?
Thanks in advance.


On Wed, Jan 7, 2009 at 3:42 PM, Musachy Barroso musa...@gmail.com wrote:

 You are missing dependencies, in this case Commons Digester
 (http://commons.apache.org/digester/)

 musachy

 On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
  Hi,
  I'm using Struts 2.1.5 with convention plugin. I'm in the learning
 process
  and trying several things (action, rule annotations, hibernate etc).
  Everything was working ok until today.  i started using Tiles.
  I copied
 
  struts2-tiles-plugin-2.1.5.jar
  tiles-api-2.0.6.jar
  tiles-core-2.0.6.jar
  tiles-jsp-2.0.6.jar files into my lib folder. These files come with
 struts
  2.1.5.
 
  I added
 listener
 
 
 listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-class
 /listener
  to web.xml file.
 
  This is my struts.xml:
  struts
 package name=default extends=struts-default  (There was also
  namespace=/, but later i removed it. but nothing changed)
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
  /struts
 
  I couldn't quite understand this package thing. Maybe the problem is with
 my
  struts file. I can also paste tiles.xml if it is necessary to diagnose
 the
  problem.
  I get
  HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are
 the
  lines from eclipse console:
 
  SEVERE: Exception sending context initialized event to listener instance
 of
  class org.apache.struts2.tiles.StrutsTilesListener
  java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
 at org.apache.tiles.definition.UrlDefinitionsFactory.init
 at
  org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
 at org.apache.tiles.impl.BasicTilesContainer.init
  ..
 
  Thanks in advance. Sorry for keeping it long.
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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




Re: Tiles with Struts 2.1.5

2009-01-07 Thread Ercan Kayaonu
There's commons-digester-1.8.jar under struts 2.1.5 lib files. you also need
commons-beanutils-1.7.0.jar.
The location for 2.1.5 is
http://people.apache.org/builds/struts/2.1.5/

On Wed, Jan 7, 2009 at 4:21 PM, Biesbrock, Kevin
biesbrock.ke...@aoins.comwrote:

 Aha!  I had this same problem and was planning on submitting it today.
 You beat me to it.

 Commons Digester does not appear to be released with Struts 2.x ...
 unless it is not named with Digester or I'm missing it.


 Beez
 ( 4961

 -Original Message-
 From: Musachy Barroso [mailto:musa...@gmail.com]
 Sent: Wednesday, January 07, 2009 10:43 AM
 To: Struts Users Mailing List
 Subject: Re: Tiles with Struts 2.1.5

 You are missing dependencies, in this case Commons Digester
 (http://commons.apache.org/digester/)

 musachy

 On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com
 wrote:
  Hi,
  I'm using Struts 2.1.5 with convention plugin. I'm in the learning
  process and trying several things (action, rule annotations, hibernate
 etc).
  Everything was working ok until today.  i started using Tiles.
  I copied
 
  struts2-tiles-plugin-2.1.5.jar
  tiles-api-2.0.6.jar
  tiles-core-2.0.6.jar
  tiles-jsp-2.0.6.jar files into my lib folder. These files come with
  struts 2.1.5.
 
  I added
 listener
 
 
 listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-c
 lass
 /listener
  to web.xml file.
 
  This is my struts.xml:
  struts
 package name=default extends=struts-default  (There was
 also
  namespace=/, but later i removed it. but nothing changed)
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
  /struts
 
  I couldn't quite understand this package thing. Maybe the problem is
  with my struts file. I can also paste tiles.xml if it is necessary to
  diagnose the problem.
  I get
  HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are
 the
  lines from eclipse console:
 
  SEVERE: Exception sending context initialized event to listener
  instance of class org.apache.struts2.tiles.StrutsTilesListener
  java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
 at org.apache.tiles.definition.UrlDefinitionsFactory.init
 at
  org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
 at org.apache.tiles.impl.BasicTilesContainer.init
  ..
 
  Thanks in advance. Sorry for keeping it long.
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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




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




Re: Tiles with Struts 2.1.5

2009-01-07 Thread Musachy Barroso
To use a result, the action needs to be in the package that defines
the result, or in a package that extends the package where the result
is defined.  There are several ways to fix this, in this case you can
just set the parent package of the action, to your package:

@ParentPackage(admin)

or change the default parent package for all your actions (the ones
configured by Convention):

constant name=struts.convention.default.parent.package value=admin /

musachy

On Wed, Jan 7, 2009 at 11:25 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
 Thank you Musachy,
 That solved my problem, but
 I got this error, which might be very familiar for most of you:

 The Result type [tiles] which is defined in the Result annotation on the
 class [class actions.admin.LoginAction] or determined by the file extension
 or is the default result type for the PackageConfig of the action, could not
 be found as a result-type defined for the Struts/XWork package
 [actions.admin#convention-default#/admin/login] - [unknown location]

 actions.admin.LoginAction.java:

  @Action(value=/admin/login/index,result...@result(name=success,
 type=tiles, location=admin.login) })   (I have definition in tiles.xml
 for admin.login.)
  public String execute() {
return SUCCESS;
}

 struts.xml :
package name=default  namespace=/ extends=struts-default
result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package

 Can anyone explain what name=default stands for, because i changed it as
 name=admin, i got the same error.
 and also [actions.admin#convention-default#/admin/login] .  What is
 #convention-default# ? Is it actions because convention plugin looks for
 actions package. Or is it something we define in config files?
 Thanks in advance.


 On Wed, Jan 7, 2009 at 3:42 PM, Musachy Barroso musa...@gmail.com wrote:

 You are missing dependencies, in this case Commons Digester
 (http://commons.apache.org/digester/)

 musachy

 On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
  Hi,
  I'm using Struts 2.1.5 with convention plugin. I'm in the learning
 process
  and trying several things (action, rule annotations, hibernate etc).
  Everything was working ok until today.  i started using Tiles.
  I copied
 
  struts2-tiles-plugin-2.1.5.jar
  tiles-api-2.0.6.jar
  tiles-core-2.0.6.jar
  tiles-jsp-2.0.6.jar files into my lib folder. These files come with
 struts
  2.1.5.
 
  I added
 listener
 
 
 listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-class
 /listener
  to web.xml file.
 
  This is my struts.xml:
  struts
 package name=default extends=struts-default  (There was also
  namespace=/, but later i removed it. but nothing changed)
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
  /struts
 
  I couldn't quite understand this package thing. Maybe the problem is with
 my
  struts file. I can also paste tiles.xml if it is necessary to diagnose
 the
  problem.
  I get
  HTTP Status 404 - /adv_ment/admin/login/index   problem. And these are
 the
  lines from eclipse console:
 
  SEVERE: Exception sending context initialized event to listener instance
 of
  class org.apache.struts2.tiles.StrutsTilesListener
  java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
 at org.apache.tiles.definition.UrlDefinitionsFactory.init
 at
  org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
 at org.apache.tiles.impl.BasicTilesContainer.init
  ..
 
  Thanks in advance. Sorry for keeping it long.
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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






-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: [S2] remove empty request parameters

2009-01-07 Thread John Cartwright
Thanks for your prompt response Dave.  So an custom interceptor before 
Params could modify the servlet request and Params interceptor would 
never seem them? Is there not a way to configure the existing Params 
interceptor to ignore any request parameters w/ a value of empty string?


The problem that I have is that Params is instantiating empty embedded 
objects.  For example, I have a Name class for my model.  Name contains 
a Contact class.  So when the request contains blank strings for all the 
Contact fields (e.g. contact.name, contact.phone, etc.), Params 
interceptor creates a new Contact instance w/ all empty fields and 
assigns that reference to the model.


I feel like I'm going against the grain of S2 somehow.

Thanks again for your advice!

--john


Dave Newton wrote:

John Cartwright wrote:
Can someone provide a recommendation for removing empty request 
parameters before the Params interceptor sees them?  Can Params 
interceptor simply be configured to ignore request parameters with no 
value?


I'd probably just create a quick interceptor to do that, if that's 
actually the functionality you require.


Dave


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




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



RE: Tiles with Struts 2.1.5

2009-01-07 Thread Biesbrock, Kevin
My bad.  The commons-digester does not exist in the 2.0.12 release (I
thought I was using 2.1.5 already).

I'll just obtain the 1.8 version either from the website or from the
S2.1.5 lib.

Thanks,

Beez
( 4961 

-Original Message-
From: Ercan Kayaonu [mailto:ekaya...@gmail.com] 
Sent: Wednesday, January 07, 2009 11:30 AM
To: Struts Users Mailing List
Subject: Re: Tiles with Struts 2.1.5

There's commons-digester-1.8.jar under struts 2.1.5 lib files. you also
need commons-beanutils-1.7.0.jar.
The location for 2.1.5 is
http://people.apache.org/builds/struts/2.1.5/

On Wed, Jan 7, 2009 at 4:21 PM, Biesbrock, Kevin
biesbrock.ke...@aoins.comwrote:

 Aha!  I had this same problem and was planning on submitting it today.
 You beat me to it.

 Commons Digester does not appear to be released with Struts 2.x ...
 unless it is not named with Digester or I'm missing it.


 Beez
 ( 4961

 -Original Message-
 From: Musachy Barroso [mailto:musa...@gmail.com]
 Sent: Wednesday, January 07, 2009 10:43 AM
 To: Struts Users Mailing List
 Subject: Re: Tiles with Struts 2.1.5

 You are missing dependencies, in this case Commons Digester
 (http://commons.apache.org/digester/)

 musachy

 On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com
 wrote:
  Hi,
  I'm using Struts 2.1.5 with convention plugin. I'm in the learning 
  process and trying several things (action, rule annotations, 
  hibernate
 etc).
  Everything was working ok until today.  i started using Tiles.
  I copied
 
  struts2-tiles-plugin-2.1.5.jar
  tiles-api-2.0.6.jar
  tiles-core-2.0.6.jar
  tiles-jsp-2.0.6.jar files into my lib folder. These files come with 
  struts 2.1.5.
 
  I added
 listener
 
 
 listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener
 -c
 lass
 /listener
  to web.xml file.
 
  This is my struts.xml:
  struts
 package name=default extends=struts-default  (There was
 also
  namespace=/, but later i removed it. but nothing changed)
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
  /struts
 
  I couldn't quite understand this package thing. Maybe the problem is

  with my struts file. I can also paste tiles.xml if it is necessary 
  to diagnose the problem.
  I get
  HTTP Status 404 - /adv_ment/admin/login/index   problem. And these
are
 the
  lines from eclipse console:
 
  SEVERE: Exception sending context initialized event to listener 
  instance of class org.apache.struts2.tiles.StrutsTilesListener
  java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
 at org.apache.tiles.definition.UrlDefinitionsFactory.init
 at
 
org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory
 at org.apache.tiles.impl.BasicTilesContainer.init
  ..
 
  Thanks in advance. Sorry for keeping it long.
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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




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




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



Re: [S2] remove empty request parameters

2009-01-07 Thread Musachy Barroso
Parameters interceptor can ignore parameters based on the name, but
not on value. You could extend the parameters interceptor and check
for values before binding, or what Dave suggested. A tip there, if you
go with Dave's suggestion, have into account that the parameters in
the context is a new map, built from the parameters in the request, so
removing them from that map won't remove them from the request.

musachy

On Wed, Jan 7, 2009 at 11:35 AM, John Cartwright
john.c.cartwri...@noaa.gov wrote:
 Thanks for your prompt response Dave.  So an custom interceptor before
 Params could modify the servlet request and Params interceptor would never
 seem them? Is there not a way to configure the existing Params interceptor
 to ignore any request parameters w/ a value of empty string?

 The problem that I have is that Params is instantiating empty embedded
 objects.  For example, I have a Name class for my model.  Name contains a
 Contact class.  So when the request contains blank strings for all the
 Contact fields (e.g. contact.name, contact.phone, etc.), Params interceptor
 creates a new Contact instance w/ all empty fields and assigns that
 reference to the model.

 I feel like I'm going against the grain of S2 somehow.

 Thanks again for your advice!

 --john


 Dave Newton wrote:

 John Cartwright wrote:

 Can someone provide a recommendation for removing empty request
 parameters before the Params interceptor sees them?  Can Params interceptor
 simply be configured to ignore request parameters with no value?

 I'd probably just create a quick interceptor to do that, if that's
 actually the functionality you require.

 Dave


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



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





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: [S2] remove empty request parameters

2009-01-07 Thread Musachy Barroso
By the way, the Parameters interceptor uses the wrap parameters map,
so removing them from there would work.

musachy

On Wed, Jan 7, 2009 at 11:52 AM, Musachy Barroso musa...@gmail.com wrote:
 Parameters interceptor can ignore parameters based on the name, but
 not on value. You could extend the parameters interceptor and check
 for values before binding, or what Dave suggested. A tip there, if you
 go with Dave's suggestion, have into account that the parameters in
 the context is a new map, built from the parameters in the request, so
 removing them from that map won't remove them from the request.

 musachy

 On Wed, Jan 7, 2009 at 11:35 AM, John Cartwright
 john.c.cartwri...@noaa.gov wrote:
 Thanks for your prompt response Dave.  So an custom interceptor before
 Params could modify the servlet request and Params interceptor would never
 seem them? Is there not a way to configure the existing Params interceptor
 to ignore any request parameters w/ a value of empty string?

 The problem that I have is that Params is instantiating empty embedded
 objects.  For example, I have a Name class for my model.  Name contains a
 Contact class.  So when the request contains blank strings for all the
 Contact fields (e.g. contact.name, contact.phone, etc.), Params interceptor
 creates a new Contact instance w/ all empty fields and assigns that
 reference to the model.

 I feel like I'm going against the grain of S2 somehow.

 Thanks again for your advice!

 --john


 Dave Newton wrote:

 John Cartwright wrote:

 Can someone provide a recommendation for removing empty request
 parameters before the Params interceptor sees them?  Can Params interceptor
 simply be configured to ignore request parameters with no value?

 I'd probably just create a quick interceptor to do that, if that's
 actually the functionality you require.

 Dave


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



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





 --
 Hey you! Would you help me to carry the stone? Pink Floyd




-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: how to get config info from portlet.xml in struts2 action

2009-01-07 Thread Nils-Helge Garli Hegvik
Why do you have the servet-config interceptor in your stack? And what
container are you running on? The portlet framework does nothing with
the portlet context object that is passed to the action, so I don't
see any reason why it shouldn't work unless the container does
something funny...

Nils-H

On Wed, Jan 7, 2009 at 4:15 AM, Daoyue Ming daoyuem...@gmail.com wrote:
 sorry, look at it wrongly.  The init-param is not within portlet-class
 So it roll back to my first question, why I can't get config info from
 portlet.xml, and which place shall I put it in portlet.xml if it is
 not init-param

 On Wed, Jan 7, 2009 at 11:02 AM, Daoyue Ming daoyuem...@gmail.com wrote:
 found it is quite stupid to put inside the ini-param in
 Jsr168Dispatcher portlet-class tag.

 let's say if I need some config for the portlet, where shall I put it
 in?  Is portlet-preference tag a better place to put in?

 On Wed, Jan 7, 2009 at 9:56 AM, Daoyue Ming daoyuem...@gmail.com wrote:
 Here is my code:
 [portlet.xml]

  portlet
portlet-namesample/portlet-name
display-namesample/display-name

 portlet-classorg.apache.struts2.portlet.dispatcher.Jsr168Dispatcher/portlet-class
  init-param
nameviewNamespace/name
value/view/value
  /init-param
  init-param
namedefaultViewAction/name
valuelinkCategories/value
  /init-param
  init-param
namecategoryId/name
value2/value
  /init-param
supports
  mime-typetext/html/mime-type
portlet-modeview/portlet-mode
/supports
portlet-info
  titlesample/title
  short-titlesample/short-title
  keywordssample/keywords
/portlet-info
  /portlet

 [struts.xml]
package name=default extends=struts-portlet-default 
 namespace=/view
interceptors
interceptor name=business
 class=com.shmc.portal.base.web.interceptor.BusinessInterceptor/

 interceptor-stack name=simplePortletStack
interceptor-ref name=portletState/
interceptor-ref name=exception /
interceptor-ref name=servlet-config /
interceptor-ref name=params
param 
 name=excludeParamsdojo\..*,^struts\..*/param
/interceptor-ref
interceptor-ref name=conversionError /
interceptor-ref name=portletAware/
interceptor-ref name=business/
/interceptor-stack
/interceptors
action name=linkCategories class=linkCategoryAction 
 method=list
result
 name=success/WEB-INF/pages/link/linkCategory_list.jsp/result
result
 name=input/WEB-INF/pages/link/linkCategory_list.jsp/result
interceptor-ref name=simplePortletStack/
/action
/package

 [action]
 public class LinkCategoryAction extends BaseAction implements
 PortletContextAware {

 public void setPortletContext(PortletContext portletContext) {
this.portletContext = portletContext;
}

 public String list() {
String categoryId = portletContext.getInitParameter(categoryId);
System.out.println(categoryId=+categoryId);
Enumeration enu = portletContext.getInitParameterNames();
System.out.println(getInitParameterNames);
printEnu(enu);
return SUCCESS;
 }
 }

 here only extract some important points, what I get from
 getInitParameterNames enumeration is all the config from web.xml not
 portlet.xml.

 On Wed, Jan 7, 2009 at 2:46 AM, Nils-Helge Garli Hegvik
 nil...@gmail.com wrote:
 Can you show us some code and configurations?

 Nils-H

 On Tue, Jan 6, 2009 at 11:20 AM, Daoyue Ming daoyuem...@gmail.com wrote:
 I have a problem to get the configuration inside portlet.xml in
 action, what I do is inside the portlet.xml, I add some config like
 the way struts2 did for defaultViewAction.  Then in my struts2 action,
 I implements PortletContextAware, and try to get the config by using
 portletContext.getInitParameter  method.  However what is returnted
 from getInitParameter is the configuration in web.xml, not
 portlet.xml.

 Is there any valid way to get it?

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



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





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



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



Re: Getting an URL for an Action

2009-01-07 Thread Chris Pratt
Strange?  I would have thought this was a fairly commonly needed feature and
the code in ServletUrlRenderer has a lot of hoops to jump through to make
something seemingly simple work.  Thanks for your help, I guess I'll just
have to hard code it for now.
  (*Chris*)

On Wed, Jan 7, 2009 at 5:46 AM, Musachy Barroso musa...@gmail.com wrote:

 hum, there is no right way after all. If you end up using UrlHelper,
 take a look at how it is used in ServletUrlRenderer:renderFormUrl,
 different methods are used depending on whether an action mapping was
 found or not.

 musachy

 On Wed, Jan 7, 2009 at 12:00 AM, Chris Pratt thechrispr...@gmail.com
 wrote:
  Is there a right way to do it?
   (*Chris*)
 
  On Tue, Jan 6, 2009 at 5:24 PM, Musachy Barroso musa...@gmail.com
 wrote:
 
  I wouldn't advise you to use UrlHelper, given that Struts 2 doesn't
  have an API, that class can change without warning (it does from time
  to time)
 
  musachy
 
  On Tue, Jan 6, 2009 at 7:56 PM, Chris Pratt thechrispr...@gmail.com
  wrote:
   I'm trying to turn an action name into an URL from within another
 action.
   I've tried:
  
   UrlHelper.buildUrl(action-name,request,response,null)
  
   Which seems to just return action-name.  And I've tried:
  
   UrlHelper.buildUrl(/action-name,request,response,null)
  
   Which returns /context/action-name, which is a little closer, but
 still
   isn't the full, working URL.
  
   What am I missing?
(*Chris*)
  
 
 
 
  --
  Hey you! Would you help me to carry the stone? Pink Floyd
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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




Re: struts 2.1.5 listed on http://struts.apache.org/2.x/

2009-01-07 Thread hernan gonzalez
Now it says 2.1.6 ...
Please fix it, it's the first page that Googles shows searching by struts2.

Hernán J. González
http://hjg.com.ar/



On Mon, Jan 5, 2009 at 4:37 PM, Chris Pratt thechrispr...@gmail.com wrote:
 That is the official page, in fact 2.1.5 isn't actually on the page that
 button is linked to.  My guess would be something in the CI Script updates
 the blue button automatically and it was unintentionally triggered.
  (*Chris*)

 On Mon, Jan 5, 2009 at 9:14 AM, bradcupit b...@lsu.edu wrote:



 Wendy Smoak-3 wrote:
 
  From http://struts.apache.org, that page is linked under 'Development'
  as 'Struts 2.x Draft Docs'
 

 Oh wow, I didn't realize that page was a development page. That actually
 explains a bit. :-)


 Wendy Smoak-3 wrote:
 
  I'm curious, how did you get to that page?
 

 I've had the link for quite a while, and assumed it was the main Struts 2
 page. I just did a Google search for struts 2, without the quotes, and
 the
 first link Google pulls up is http://struts.apache.org/2.x/
 --
 View this message in context:
 http://www.nabble.com/struts-2.1.5-listed-on-http%3A--struts.apache.org-2.x--tp21293172p21295111.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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






--

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



Re: struts 2.1.5 listed on http://struts.apache.org/2.x/

2009-01-07 Thread Wendy Smoak
On Wed, Jan 7, 2009 at 10:03 AM, hernan gonzalez hgonza...@gmail.com wrote:
 Now it says 2.1.6 ...
 Please fix it, it's the first page that Googles shows searching by struts2.

One of the devs already added a robots.txt file to try to convince
Google not to index the *draft* docs at struts.apache.org/2.x, but it
will take time some time to see if that works.

The latest official release in the 2.1 series is 2.1.2 Beta, which can
be downloaded from http://struts.apache.org/download.html

2.1.5 and 2.1.6 are *not* official releases (though there's a vote
going on now for 2.1.6).

-- 
Wendy

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



Re: struts 2.1.5 listed on http://struts.apache.org/2.x/

2009-01-07 Thread Musachy Barroso
Murphy's law at its best :)

musachy

On Wed, Jan 7, 2009 at 12:03 PM, hernan gonzalez hgonza...@gmail.com wrote:
 Now it says 2.1.6 ...
 Please fix it, it's the first page that Googles shows searching by struts2.

 Hernán J. González
 http://hjg.com.ar/



 On Mon, Jan 5, 2009 at 4:37 PM, Chris Pratt thechrispr...@gmail.com wrote:
 That is the official page, in fact 2.1.5 isn't actually on the page that
 button is linked to.  My guess would be something in the CI Script updates
 the blue button automatically and it was unintentionally triggered.
  (*Chris*)

 On Mon, Jan 5, 2009 at 9:14 AM, bradcupit b...@lsu.edu wrote:



 Wendy Smoak-3 wrote:
 
  From http://struts.apache.org, that page is linked under 'Development'
  as 'Struts 2.x Draft Docs'
 

 Oh wow, I didn't realize that page was a development page. That actually
 explains a bit. :-)


 Wendy Smoak-3 wrote:
 
  I'm curious, how did you get to that page?
 

 I've had the link for quite a while, and assumed it was the main Struts 2
 page. I just did a Google search for struts 2, without the quotes, and
 the
 first link Google pulls up is http://struts.apache.org/2.x/
 --
 View this message in context:
 http://www.nabble.com/struts-2.1.5-listed-on-http%3A--struts.apache.org-2.x--tp21293172p21295111.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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






 --

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





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: [S2] remove empty request parameters

2009-01-07 Thread John Cartwright
Thanks Musachy.  I've been looking at the src for 
ParameterRemoverInterceptor and it looks like I can easily modify it to 
meet my needs.  I just wanted to insure that I was approaching the 
problem in a S2 way since it would seem to be a common problem.


--john


Musachy Barroso wrote:

By the way, the Parameters interceptor uses the wrap parameters map,
so removing them from there would work.

musachy

On Wed, Jan 7, 2009 at 11:52 AM, Musachy Barroso musa...@gmail.com wrote:
  

Parameters interceptor can ignore parameters based on the name, but
not on value. You could extend the parameters interceptor and check
for values before binding, or what Dave suggested. A tip there, if you
go with Dave's suggestion, have into account that the parameters in
the context is a new map, built from the parameters in the request, so
removing them from that map won't remove them from the request.

musachy

On Wed, Jan 7, 2009 at 11:35 AM, John Cartwright
john.c.cartwri...@noaa.gov wrote:


Thanks for your prompt response Dave.  So an custom interceptor before
Params could modify the servlet request and Params interceptor would never
seem them? Is there not a way to configure the existing Params interceptor
to ignore any request parameters w/ a value of empty string?

The problem that I have is that Params is instantiating empty embedded
objects.  For example, I have a Name class for my model.  Name contains a
Contact class.  So when the request contains blank strings for all the
Contact fields (e.g. contact.name, contact.phone, etc.), Params interceptor
creates a new Contact instance w/ all empty fields and assigns that
reference to the model.

I feel like I'm going against the grain of S2 somehow.

Thanks again for your advice!

--john


Dave Newton wrote:
  

John Cartwright wrote:


Can someone provide a recommendation for removing empty request
parameters before the Params interceptor sees them?  Can Params interceptor
simply be configured to ignore request parameters with no value?
  

I'd probably just create a quick interceptor to do that, if that's
actually the functionality you require.

Dave


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




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


  


--
Hey you! Would you help me to carry the stone? Pink Floyd






  


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



Re: Tiles with Struts 2.1.5

2009-01-07 Thread Ercan Kayaonu
Hi,
Sorry for disturbing you guys this much. Be sure that i first google to
solve the problem and read related parts of the documentation. But
unfortunately some of them are very concise. Anyways.

I tried both
constant name=struts.convention.default.parent.package
value=actions /
and
constant name=struts.convention.default.parent.package value=admin
/
but I got this error: Unable to locate parent package [actions] - [unknown
location]   and this for second one.
   Unable to locate parent package [admin] -
[unknown location]

I also tried annotation method. My LoginAction.java class is already under
actions.admin package. (LoginAction.java is directly under admin package and
there's no other package under admin). so the parent class for this package
is i guess admin. Why do i have to set it again. For all my actions, the
default package is actions. But this didn't work also. I mean, constant
name=struts.convention.default.parent.package value=actions /.

Quote: To use a result, the action needs to be in the package that defines
the result
Sorry, but could you please clarify what it mean to be in the package that
defines the result. do you mean in struts.xml where we define
result-types. I also tried changing those lines as follows
package name=default  namespace=*actions.admin*
extends=struts-default
result-types
result-type name=tiles
class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package
But no luck. My problem is playing with several setting blindly. I haven't
fully understood some of the concepts i guess. Documentations give examples
in a isolated manner. You can't relate to under parts of the system. For
example, from tiles plugin documentation

result-types
result-type name=tiles
class=org.apache.struts2.views.tiles.TilesResult/
/result-types

What should be the package name, namespace etc. there's no clue. I couldn't
find the solution in tiles.apache.org also.  Can someone advice a tutorial
on tiles and struts2 (step by step).

Thanks for your efforts.


On Wed, Jan 7, 2009 at 4:30 PM, Musachy Barroso musa...@gmail.com wrote:

 To use a result, the action needs to be in the package that defines
 the result, or in a package that extends the package where the result
 is defined.  There are several ways to fix this, in this case you can
 just set the parent package of the action, to your package:

 @ParentPackage(admin)

 or change the default parent package for all your actions (the ones
 configured by Convention):

 constant name=struts.convention.default.parent.package value=admin /

 musachy

 On Wed, Jan 7, 2009 at 11:25 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
  Thank you Musachy,
  That solved my problem, but
  I got this error, which might be very familiar for most of you:
 
  The Result type [tiles] which is defined in the Result annotation on the
  class [class actions.admin.LoginAction] or determined by the file
 extension
  or is the default result type for the PackageConfig of the action, could
 not
  be found as a result-type defined for the Struts/XWork package
  [actions.admin#convention-default#/admin/login] - [unknown location]
 
  actions.admin.LoginAction.java:
 
   @Action(value=/admin/login/index,result...@result(name=success,
  type=tiles, location=admin.login) })   (I have definition in
 tiles.xml
  for admin.login.)
   public String execute() {
 return SUCCESS;
 }
 
  struts.xml :
 package name=default  namespace=/ extends=struts-default
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
 
  Can anyone explain what name=default stands for, because i changed it
 as
  name=admin, i got the same error.
  and also [actions.admin#convention-default#/admin/login] .  What is
  #convention-default# ? Is it actions because convention plugin looks
 for
  actions package. Or is it something we define in config files?
  Thanks in advance.
 
 
  On Wed, Jan 7, 2009 at 3:42 PM, Musachy Barroso musa...@gmail.com
 wrote:
 
  You are missing dependencies, in this case Commons Digester
  (http://commons.apache.org/digester/)
 
  musachy
 
  On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com
 wrote:
   Hi,
   I'm using Struts 2.1.5 with convention plugin. I'm in the learning
  process
   and trying several things (action, rule annotations, hibernate etc).
   Everything was working ok until today.  i started using Tiles.
   I copied
  
   struts2-tiles-plugin-2.1.5.jar
   tiles-api-2.0.6.jar
   tiles-core-2.0.6.jar
   tiles-jsp-2.0.6.jar files into my lib folder. These files come with
  struts
   2.1.5.
  
   I added
  listener
  
  
 
 listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-class
  /listener
   to web.xml file.
  
   This is my struts.xml:
   struts
  package name=default extends=struts-default  (There was
 also
   namespace=/, 

Re: Tiles with Struts 2.1.5

2009-01-07 Thread Antonio
2009/1/7 Ercan Kayaonu ekaya...@gmail.com:
 Can someone advice a tutorial
 on tiles and struts2 (step by step).

Heh, Tiles and Struts 2 seem to be two isolated worlds.
The strangest thing is that a lot of people are using this pair, but
no one is contributing.
If you *really* want them to work well together, stop complaining and
start contributing.

Ciao
Antonio

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



Re: Tiles with Struts 2.1.5

2009-01-07 Thread Musachy Barroso
The value attribute needs to match the name of a package that is
defined somewhere, if you do this:

constant name=struts.convention.default.parent.package value=admin/

make sure that your package is like

package name=admin.../package

musachy

On Wed, Jan 7, 2009 at 12:17 PM, Ercan Kayaonu ekaya...@gmail.com wrote:
 Hi,
 Sorry for disturbing you guys this much. Be sure that i first google to
 solve the problem and read related parts of the documentation. But
 unfortunately some of them are very concise. Anyways.

 I tried both
constant name=struts.convention.default.parent.package
 value=actions /
 and
constant name=struts.convention.default.parent.package value=admin
 /
 but I got this error: Unable to locate parent package [actions] - [unknown
 location]   and this for second one.
   Unable to locate parent package [admin] -
 [unknown location]

 I also tried annotation method. My LoginAction.java class is already under
 actions.admin package. (LoginAction.java is directly under admin package and
 there's no other package under admin). so the parent class for this package
 is i guess admin. Why do i have to set it again. For all my actions, the
 default package is actions. But this didn't work also. I mean, constant
 name=struts.convention.default.parent.package value=actions /.

 Quote: To use a result, the action needs to be in the package that defines
 the result
 Sorry, but could you please clarify what it mean to be in the package that
 defines the result. do you mean in struts.xml where we define
 result-types. I also tried changing those lines as follows
package name=default  namespace=*actions.admin*
 extends=struts-default
result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package
 But no luck. My problem is playing with several setting blindly. I haven't
 fully understood some of the concepts i guess. Documentations give examples
 in a isolated manner. You can't relate to under parts of the system. For
 example, from tiles plugin documentation

 result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult/
 /result-types

 What should be the package name, namespace etc. there's no clue. I couldn't
 find the solution in tiles.apache.org also.  Can someone advice a tutorial
 on tiles and struts2 (step by step).

 Thanks for your efforts.


 On Wed, Jan 7, 2009 at 4:30 PM, Musachy Barroso musa...@gmail.com wrote:

 To use a result, the action needs to be in the package that defines
 the result, or in a package that extends the package where the result
 is defined.  There are several ways to fix this, in this case you can
 just set the parent package of the action, to your package:

 @ParentPackage(admin)

 or change the default parent package for all your actions (the ones
 configured by Convention):

 constant name=struts.convention.default.parent.package value=admin /

 musachy

 On Wed, Jan 7, 2009 at 11:25 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
  Thank you Musachy,
  That solved my problem, but
  I got this error, which might be very familiar for most of you:
 
  The Result type [tiles] which is defined in the Result annotation on the
  class [class actions.admin.LoginAction] or determined by the file
 extension
  or is the default result type for the PackageConfig of the action, could
 not
  be found as a result-type defined for the Struts/XWork package
  [actions.admin#convention-default#/admin/login] - [unknown location]
 
  actions.admin.LoginAction.java:
 
   @Action(value=/admin/login/index,result...@result(name=success,
  type=tiles, location=admin.login) })   (I have definition in
 tiles.xml
  for admin.login.)
   public String execute() {
 return SUCCESS;
 }
 
  struts.xml :
 package name=default  namespace=/ extends=struts-default
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
 
  Can anyone explain what name=default stands for, because i changed it
 as
  name=admin, i got the same error.
  and also [actions.admin#convention-default#/admin/login] .  What is
  #convention-default# ? Is it actions because convention plugin looks
 for
  actions package. Or is it something we define in config files?
  Thanks in advance.
 
 
  On Wed, Jan 7, 2009 at 3:42 PM, Musachy Barroso musa...@gmail.com
 wrote:
 
  You are missing dependencies, in this case Commons Digester
  (http://commons.apache.org/digester/)
 
  musachy
 
  On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com
 wrote:
   Hi,
   I'm using Struts 2.1.5 with convention plugin. I'm in the learning
  process
   and trying several things (action, rule annotations, hibernate etc).
   Everything was working ok until today.  i started using Tiles.
   I copied
  
   struts2-tiles-plugin-2.1.5.jar
   tiles-api-2.0.6.jar
   tiles-core-2.0.6.jar
   

Re: Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.

2009-01-07 Thread bakann

Hi,
I have a struts2 webapp that works fine on tomcat 6. 
But when deploy the webapp on weblogic 10 (with the weblogic.xml file), it
is not working and I have got a similar stacktrace :

7 janv. 2009 18 h 10 CET Error HTTP fr-dy01 examplesServer
[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default
(self-tuning)' WLS Kernel   1231348252833 BEA-101165 Could not
load user defined filter in web.xml:
org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action -
zip:D:/bea10/wlserver_10.0/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/presentation/t11f9i/war/WEB-INF/lib/_wl_cls_gen.jar!/struts.xml:29:64
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
at
weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Unknown
Source)
at
weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:88)
at
weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1725)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at
weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
at
weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:139)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
Action class [mp.web.action.IndexAction] not found - action -
zip:D:/bea10/wlserver_10.0/samples/domains/wl_server/servers/examplesServer/tmp/_WL_user/presentation/t11f9i/war/WEB-INF/lib/_wl_cls_gen.jar!/struts.xml:29:64
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:410)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:360)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:465)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:270)
at
org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:110)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)
at

Re: Getting an URL for an Action

2009-01-07 Thread Dave Newton

Chris Pratt wrote:

Strange?  I would have thought this was a fairly commonly needed feature


I've never needed to generate a URL from an action name within another 
action across a half-dozen S2 apps--it can't be *that* common... I think 
the most hackish thing I've done like that is to use an action name as a 
dynamic result parameter for a redirectAction result type.


IMO actions should never generate a URL since they're supposed to be 
decoupled from the underlying action access mechanism. What's your use 
case that this solves?


Dave


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



Re: Tiles with Struts 2.1.5

2009-01-07 Thread Musachy Barroso
btw this is not related to tiles, it all applies to any plugin that
defines results.

musachy

On Wed, Jan 7, 2009 at 12:23 PM, Musachy Barroso musa...@gmail.com wrote:
 The value attribute needs to match the name of a package that is
 defined somewhere, if you do this:

 constant name=struts.convention.default.parent.package value=admin/

 make sure that your package is like

 package name=admin.../package

 musachy

 On Wed, Jan 7, 2009 at 12:17 PM, Ercan Kayaonu ekaya...@gmail.com wrote:
 Hi,
 Sorry for disturbing you guys this much. Be sure that i first google to
 solve the problem and read related parts of the documentation. But
 unfortunately some of them are very concise. Anyways.

 I tried both
constant name=struts.convention.default.parent.package
 value=actions /
 and
constant name=struts.convention.default.parent.package value=admin
 /
 but I got this error: Unable to locate parent package [actions] - [unknown
 location]   and this for second one.
   Unable to locate parent package [admin] -
 [unknown location]

 I also tried annotation method. My LoginAction.java class is already under
 actions.admin package. (LoginAction.java is directly under admin package and
 there's no other package under admin). so the parent class for this package
 is i guess admin. Why do i have to set it again. For all my actions, the
 default package is actions. But this didn't work also. I mean, constant
 name=struts.convention.default.parent.package value=actions /.

 Quote: To use a result, the action needs to be in the package that defines
 the result
 Sorry, but could you please clarify what it mean to be in the package that
 defines the result. do you mean in struts.xml where we define
 result-types. I also tried changing those lines as follows
package name=default  namespace=*actions.admin*
 extends=struts-default
result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult /
/result-types
 /package
 But no luck. My problem is playing with several setting blindly. I haven't
 fully understood some of the concepts i guess. Documentations give examples
 in a isolated manner. You can't relate to under parts of the system. For
 example, from tiles plugin documentation

 result-types
result-type name=tiles
 class=org.apache.struts2.views.tiles.TilesResult/
 /result-types

 What should be the package name, namespace etc. there's no clue. I couldn't
 find the solution in tiles.apache.org also.  Can someone advice a tutorial
 on tiles and struts2 (step by step).

 Thanks for your efforts.


 On Wed, Jan 7, 2009 at 4:30 PM, Musachy Barroso musa...@gmail.com wrote:

 To use a result, the action needs to be in the package that defines
 the result, or in a package that extends the package where the result
 is defined.  There are several ways to fix this, in this case you can
 just set the parent package of the action, to your package:

 @ParentPackage(admin)

 or change the default parent package for all your actions (the ones
 configured by Convention):

 constant name=struts.convention.default.parent.package value=admin /

 musachy

 On Wed, Jan 7, 2009 at 11:25 AM, Ercan Kayaonu ekaya...@gmail.com wrote:
  Thank you Musachy,
  That solved my problem, but
  I got this error, which might be very familiar for most of you:
 
  The Result type [tiles] which is defined in the Result annotation on the
  class [class actions.admin.LoginAction] or determined by the file
 extension
  or is the default result type for the PackageConfig of the action, could
 not
  be found as a result-type defined for the Struts/XWork package
  [actions.admin#convention-default#/admin/login] - [unknown location]
 
  actions.admin.LoginAction.java:
 
   @Action(value=/admin/login/index,result...@result(name=success,
  type=tiles, location=admin.login) })   (I have definition in
 tiles.xml
  for admin.login.)
   public String execute() {
 return SUCCESS;
 }
 
  struts.xml :
 package name=default  namespace=/ extends=struts-default
 result-types
 result-type name=tiles
  class=org.apache.struts2.views.tiles.TilesResult /
 /result-types
  /package
 
  Can anyone explain what name=default stands for, because i changed it
 as
  name=admin, i got the same error.
  and also [actions.admin#convention-default#/admin/login] .  What is
  #convention-default# ? Is it actions because convention plugin looks
 for
  actions package. Or is it something we define in config files?
  Thanks in advance.
 
 
  On Wed, Jan 7, 2009 at 3:42 PM, Musachy Barroso musa...@gmail.com
 wrote:
 
  You are missing dependencies, in this case Commons Digester
  (http://commons.apache.org/digester/)
 
  musachy
 
  On Wed, Jan 7, 2009 at 10:38 AM, Ercan Kayaonu ekaya...@gmail.com
 wrote:
   Hi,
   I'm using Struts 2.1.5 with convention plugin. I'm in the learning
  process
   and trying several things (action, rule annotations, hibernate 

Re: Tiles with Struts 2.1.5

2009-01-07 Thread Wendy Smoak
On Wed, Jan 7, 2009 at 8:38 AM, Ercan Kayaonu ekaya...@gmail.com wrote:

 I'm using Struts 2.1.5 with convention plugin. I'm in the learning process
 and trying several things (action, rule annotations, hibernate etc).

Since we're on the user list, be aware that Struts 2.1.5 is not an
official release.  It was a test build posted on the dev list for
evaluation, and shouldn't be used unless you're comfortable out on the
bleeding edge.  And if you _are_, come join us on the dev list where a
vote for 2.1.6 is underway, and help test that. :)

-- 
Wendy

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



Re: Getting an URL for an Action

2009-01-07 Thread Chris Pratt
Basically, I have some tried and true tag libraries for generating pretty,
MIME Emails that work great with Struts.  They support all manner of
attachments and have worked great for years.  Occasionally I need to attach
something (in this case a PDF) that is generated by another action.  So the
main action needs to have a property that returns a list of things to be
attached, which in this case is a URL to the Action that generates the
dynamic PDF.

I'm sure there's a way to refactor all this into some unrecognizable form,
but this is tried and true, supports JSP and Tiles including properly
formatted, pretty HTML and plain text MIME emails, and really I can't see
any reason that this should be precluded from working with any system that
supports JSP Tag Libraries.

Can you see a better way to get the generated attachment into the email?
  (*Chris*)

On Wed, Jan 7, 2009 at 9:23 AM, Dave Newton newton.d...@yahoo.com wrote:

 Chris Pratt wrote:

 Strange?  I would have thought this was a fairly commonly needed feature


 I've never needed to generate a URL from an action name within another
 action across a half-dozen S2 apps--it can't be *that* common... I think the
 most hackish thing I've done like that is to use an action name as a dynamic
 result parameter for a redirectAction result type.

 IMO actions should never generate a URL since they're supposed to be
 decoupled from the underlying action access mechanism. What's your use case
 that this solves?

 Dave



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




Re: Getting an URL for an Action

2009-01-07 Thread Musachy Barroso
If the MIME Emails are generated by tags, why don't you build the URL
in the jsps?

musachy

On Wed, Jan 7, 2009 at 12:45 PM, Chris Pratt thechrispr...@gmail.com wrote:
 Basically, I have some tried and true tag libraries for generating pretty,
 MIME Emails that work great with Struts.  They support all manner of
 attachments and have worked great for years.  Occasionally I need to attach
 something (in this case a PDF) that is generated by another action.  So the
 main action needs to have a property that returns a list of things to be
 attached, which in this case is a URL to the Action that generates the
 dynamic PDF.

 I'm sure there's a way to refactor all this into some unrecognizable form,
 but this is tried and true, supports JSP and Tiles including properly
 formatted, pretty HTML and plain text MIME emails, and really I can't see
 any reason that this should be precluded from working with any system that
 supports JSP Tag Libraries.

 Can you see a better way to get the generated attachment into the email?
  (*Chris*)

 On Wed, Jan 7, 2009 at 9:23 AM, Dave Newton newton.d...@yahoo.com wrote:

 Chris Pratt wrote:

 Strange?  I would have thought this was a fairly commonly needed feature


 I've never needed to generate a URL from an action name within another
 action across a half-dozen S2 apps--it can't be *that* common... I think the
 most hackish thing I've done like that is to use an action name as a dynamic
 result parameter for a redirectAction result type.

 IMO actions should never generate a URL since they're supposed to be
 decoupled from the underlying action access mechanism. What's your use case
 that this solves?

 Dave



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






-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: Getting an URL for an Action

2009-01-07 Thread Chris Pratt
In this case it has to do with the fact that we're using Tiles to ensure
that we get a consistent look for all our emails.  Basically I've created a
Tiles Layout that constructs the emails using tiles to include the
text/plain and text/html versions of the content and using action properties
to control to, from, cc, bcc, subject and the attachments.  I guess I'm
confused as to why it's a sin to ask the system for information it obviously
has to have?
  (*Chris*)

On Wed, Jan 7, 2009 at 9:58 AM, Musachy Barroso musa...@gmail.com wrote:

 If the MIME Emails are generated by tags, why don't you build the URL
 in the jsps?

 musachy

 On Wed, Jan 7, 2009 at 12:45 PM, Chris Pratt thechrispr...@gmail.com
 wrote:
  Basically, I have some tried and true tag libraries for generating
 pretty,
  MIME Emails that work great with Struts.  They support all manner of
  attachments and have worked great for years.  Occasionally I need to
 attach
  something (in this case a PDF) that is generated by another action.  So
 the
  main action needs to have a property that returns a list of things to be
  attached, which in this case is a URL to the Action that generates the
  dynamic PDF.
 
  I'm sure there's a way to refactor all this into some unrecognizable
 form,
  but this is tried and true, supports JSP and Tiles including properly
  formatted, pretty HTML and plain text MIME emails, and really I can't see
  any reason that this should be precluded from working with any system
 that
  supports JSP Tag Libraries.
 
  Can you see a better way to get the generated attachment into the email?
   (*Chris*)
 
  On Wed, Jan 7, 2009 at 9:23 AM, Dave Newton newton.d...@yahoo.com
 wrote:
 
  Chris Pratt wrote:
 
  Strange?  I would have thought this was a fairly commonly needed
 feature
 
 
  I've never needed to generate a URL from an action name within another
  action across a half-dozen S2 apps--it can't be *that* common... I think
 the
  most hackish thing I've done like that is to use an action name as a
 dynamic
  result parameter for a redirectAction result type.
 
  IMO actions should never generate a URL since they're supposed to be
  decoupled from the underlying action access mechanism. What's your use
 case
  that this solves?
 
  Dave
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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




Re: Getting an URL for an Action

2009-01-07 Thread Musachy Barroso
It is not a sin, we are suggesting alternatives, based on the fact
that there is not built in way of doing what you are asking.

musahcy

On Wed, Jan 7, 2009 at 1:05 PM, Chris Pratt thechrispr...@gmail.com wrote:
 In this case it has to do with the fact that we're using Tiles to ensure
 that we get a consistent look for all our emails.  Basically I've created a
 Tiles Layout that constructs the emails using tiles to include the
 text/plain and text/html versions of the content and using action properties
 to control to, from, cc, bcc, subject and the attachments.  I guess I'm
 confused as to why it's a sin to ask the system for information it obviously
 has to have?
  (*Chris*)

 On Wed, Jan 7, 2009 at 9:58 AM, Musachy Barroso musa...@gmail.com wrote:

 If the MIME Emails are generated by tags, why don't you build the URL
 in the jsps?

 musachy

 On Wed, Jan 7, 2009 at 12:45 PM, Chris Pratt thechrispr...@gmail.com
 wrote:
  Basically, I have some tried and true tag libraries for generating
 pretty,
  MIME Emails that work great with Struts.  They support all manner of
  attachments and have worked great for years.  Occasionally I need to
 attach
  something (in this case a PDF) that is generated by another action.  So
 the
  main action needs to have a property that returns a list of things to be
  attached, which in this case is a URL to the Action that generates the
  dynamic PDF.
 
  I'm sure there's a way to refactor all this into some unrecognizable
 form,
  but this is tried and true, supports JSP and Tiles including properly
  formatted, pretty HTML and plain text MIME emails, and really I can't see
  any reason that this should be precluded from working with any system
 that
  supports JSP Tag Libraries.
 
  Can you see a better way to get the generated attachment into the email?
   (*Chris*)
 
  On Wed, Jan 7, 2009 at 9:23 AM, Dave Newton newton.d...@yahoo.com
 wrote:
 
  Chris Pratt wrote:
 
  Strange?  I would have thought this was a fairly commonly needed
 feature
 
 
  I've never needed to generate a URL from an action name within another
  action across a half-dozen S2 apps--it can't be *that* common... I think
 the
  most hackish thing I've done like that is to use an action name as a
 dynamic
  result parameter for a redirectAction result type.
 
  IMO actions should never generate a URL since they're supposed to be
  decoupled from the underlying action access mechanism. What's your use
 case
  that this solves?
 
  Dave
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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






-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: Getting an URL for an Action

2009-01-07 Thread Musachy Barroso
I totally misunderstood your last statement :)

musachy

On Wed, Jan 7, 2009 at 1:14 PM, Musachy Barroso musa...@gmail.com wrote:
 It is not a sin, we are suggesting alternatives, based on the fact
 that there is not built in way of doing what you are asking.

 musahcy

 On Wed, Jan 7, 2009 at 1:05 PM, Chris Pratt thechrispr...@gmail.com wrote:
 In this case it has to do with the fact that we're using Tiles to ensure
 that we get a consistent look for all our emails.  Basically I've created a
 Tiles Layout that constructs the emails using tiles to include the
 text/plain and text/html versions of the content and using action properties
 to control to, from, cc, bcc, subject and the attachments.  I guess I'm
 confused as to why it's a sin to ask the system for information it obviously
 has to have?
  (*Chris*)

 On Wed, Jan 7, 2009 at 9:58 AM, Musachy Barroso musa...@gmail.com wrote:

 If the MIME Emails are generated by tags, why don't you build the URL
 in the jsps?

 musachy

 On Wed, Jan 7, 2009 at 12:45 PM, Chris Pratt thechrispr...@gmail.com
 wrote:
  Basically, I have some tried and true tag libraries for generating
 pretty,
  MIME Emails that work great with Struts.  They support all manner of
  attachments and have worked great for years.  Occasionally I need to
 attach
  something (in this case a PDF) that is generated by another action.  So
 the
  main action needs to have a property that returns a list of things to be
  attached, which in this case is a URL to the Action that generates the
  dynamic PDF.
 
  I'm sure there's a way to refactor all this into some unrecognizable
 form,
  but this is tried and true, supports JSP and Tiles including properly
  formatted, pretty HTML and plain text MIME emails, and really I can't see
  any reason that this should be precluded from working with any system
 that
  supports JSP Tag Libraries.
 
  Can you see a better way to get the generated attachment into the email?
   (*Chris*)
 
  On Wed, Jan 7, 2009 at 9:23 AM, Dave Newton newton.d...@yahoo.com
 wrote:
 
  Chris Pratt wrote:
 
  Strange?  I would have thought this was a fairly commonly needed
 feature
 
 
  I've never needed to generate a URL from an action name within another
  action across a half-dozen S2 apps--it can't be *that* common... I think
 the
  most hackish thing I've done like that is to use an action name as a
 dynamic
  result parameter for a redirectAction result type.
 
  IMO actions should never generate a URL since they're supposed to be
  decoupled from the underlying action access mechanism. What's your use
 case
  that this solves?
 
  Dave
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



 --
 Hey you! Would you help me to carry the stone? Pink Floyd

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






 --
 Hey you! Would you help me to carry the stone? Pink Floyd




-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: Doc for s:url tag has wrong includeParams default

2009-01-07 Thread Wolfgang Knauf

Hi,



I updated the page. thanks for reporting.


http://struts.apache.org/2.0.14/docs/url.html
shows still the wrong info As of Struts 2.0.11.3/2.0.12/2.1.3 the 
includeParams constant defaults to 'none'. According to you, this was 
only changed in 2.1.x?


Best regards

Wolfgang


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



Re: Doc for s:url tag has wrong includeParams default

2009-01-07 Thread Musachy Barroso
yes, unfortunately that cannot be changed for 2.0.14 was released already.

musachy

On Wed, Jan 7, 2009 at 4:27 PM, Wolfgang Knauf his-metal...@freenet.de wrote:
 Hi,


 I updated the page. thanks for reporting.

 http://struts.apache.org/2.0.14/docs/url.html
 shows still the wrong info As of Struts 2.0.11.3/2.0.12/2.1.3 the
 includeParams constant defaults to 'none'. According to you, this was only
 changed in 2.1.x?

 Best regards

 Wolfgang


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





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Spring scope prototype and Struts Action

2009-01-07 Thread Emanuele Ghevre

Hi folks!

Following the Struts 2 + Spring 2 + JPA + AJAX Tutorial 
(http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html)


I'm declaring my Spring bean HelloWorldAction with scope prototype and 
then the action in struts.xml using the bean reference.


As far as the scope is prototype I'm expecting Spring to create a new 
HelloWorldAction object every time an object of that type is requested.
But during my Tomcat boot I can see Spring creating an HelloWorldAction 
object. Is it normal? I thought this behaviour was only for singleton beans.


Thanks,

Emanuele

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



Re: Spring scope prototype and Struts Action

2009-01-07 Thread Dave Newton

Emanuele Ghevre wrote:
As far as the scope is prototype I'm expecting Spring to create a new 
HelloWorldAction object every time an object of that type is requested.
But during my Tomcat boot I can see Spring creating an HelloWorldAction 
object. Is it normal? I thought this behaviour was only for singleton 
beans.


IIRC the startup process will create an action instance as part of the 
XML validation process. (For example, to make sure that an instance of 
the action in question can actually be instantiated.)


Dave


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



Re: [S2] best practice for reading POST body in an action

2009-01-07 Thread Roger Varley
On Wednesday 07 January 2009 17:58:48 John Cartwright wrote:
 Hello All,

 Is there a best practice for using the body of a POST request w/in an
 action?  The request is not key/value pairs but a blob of XML.  Before I
 dropped back to using a traditional HTTPServletRequest approach, I'd see
 if there was a better way in S2.

Forgive me if I'm being dense, but won't you still have a single key/value 
pair where key will be something and the value is your XML blob? 

Regards

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



Re: Conditional Annotation based Validation

2009-01-07 Thread Dirk Forchel

Finally I followed your advice and use Java-based validation now. I did not
get it work with the expression validator via annotations. If somebody knows
how to do the following Java-based validation with annotations just let me
know:

public void validate() 
{   
   if (privatePerson) 
   {
  if (GenericValidator.isBlankOrNull(name))
 addFieldError(name, name required);
  if (GenericValidator.isBlankOrNull(number1))
 addFieldError(number1, number1 required);
  else if (!(GenericValidator.isInt(number1) ||
GenericValidator.isInt(number2)))
 addFieldError(number1, The number can contain only digits.); 
  else if (!(GenericValidator.minLength(number1, 6) 
GenericValidator.maxLength(number1, 6)))
 addFieldError(number1, The first part of the number must be 6
digits long.);
  else if (!(GenericValidator.minLength(number2, 4) 
GenericValidator.maxLength(number2, 4)))
 addFieldError(number2, The second part of the number must be 4
digits long.); 
   }
   else
   {
  if (GenericValidator.isBlankOrNull(number1))  

 addFieldError(number1, number required);
  else if (!GenericValidator.isInt(number1))
 addFieldError(number1, The number can contain only digits.);
  else if (!(GenericValidator.minLength(number1, 8) 
GenericValidator.maxLength(number1, 8)))
 addFieldError(number1, The number must be 8 digits long.);
   }
}




newton.dave wrote:
 
 AFAIK the expression validator is available via annotations. You can 
 also use a custom validator but I find it a little clumsy with
 annotations.
 
 Personally, as soon as validation gets even remotely complicated I fall 
 back to using Java-based validation--I just think it's easier to 
 maintain and much more clear.
 
 I'll sometimes use a combination of both Java-based and either XML or 
 annotations if it makes sense to.
 
 On a side note, IIRC the trim attribute/parameter only applies the 
 trim during validation--not on the value set on the action property.
 
 Dave
 
 Dirk Forchel wrote:
 I have two radio buttons for a form property named privatePerson with
 two
 possible values ('true' and 'false') which toogles the view of my input
 form
 with three different input fields (number1, number2, name).
 If the user choose private the number1, number2 and name input fields
 are
 shown, if the user choose non-private only the number1 input field is
 shown.
 For the first choise I would use annotation based validation like
 
 @Validations(
requiredStrings = {...@requiredstringvalidator(type =
 ValidatorType.SIMPLE,
 fieldName = name, message = You must enter a name.)},
stringLengthFields = {...@stringlengthfieldvalidator(type =
 ValidatorType.SIMPLE, trim = true, minLength=6, maxLength = 6,
 fieldName
 = number1, message = The first part of the number must be 6 digits
 long.), @StringLengthFieldValidator(type = ValidatorType.SIMPLE, trim =
 true, minLength=4, maxLength = 4, fieldName = number2, message =
 The
 second part of the number must be 4 digits long.),
  }
 )
 public String execute() throws Exception {
 ...
 }
 
 If the user selects non-private only the following validator should be
 used.
 
 @Validations(
 stringLengthFields = {...@stringlengthfieldvalidator(type =
 ValidatorType.SIMPLE, trim = true, minLength=8, maxLength = 8,
 fieldName
 = number1, message = The first part of the number must be 8 digits
 long.),
 }
 )
 public String execute() throws Exception {
 ...
 }
 
 
 How can I accomplish this conditional annotation based validation?
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Conditional-Annotation-based-Validation-tp21328921p21346353.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



json action redirection in struts2

2009-01-07 Thread ravindra
Hi guys,

 

  I have two action configured in struts.xml like below.My interceptor stack
noValidationLoginStack will check for session is timed out or not.

If the session is timeout returns login so the page goes to login.jsp.It
is working fine in first package but from json

Packages and action classes it is not getting redirected.Can any one solve
the problem?

 

package name=some extends =struts-default

global-results

result name=login type=chainlogin.jsp/result

  /global-results

action name=accountActivity class=com.action.MyAction

interceptor-ref name=noValidationLoginStack  /

result name=successaccountActivity.jsp/result

result name=inputaccountActivity.jsp/result

result name=accounts type=chainselectAccount/result

/action

/package

 

 

package name=json extends =json-default

global-results

result name=login type=chainlogin.jsp/result

  /global-results

action name=accountactivitydt class=com.json.MyActionDt

  interceptor-ref name=noValidationLoginStack /

  result name=success type=jsonparam
name=ignoreHierarchyfalse/param/result

  result name=input type=json/

/action

/package

 

Thank you,