File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Chris Searle
Struts 1.2

I need to try to get file upload to work for an existing struts app.

I was reading through the following:

http://wiki.apache.org/struts/StrutsFileUpload

where it mentions the following for Dyna action forms:

form-bean name=myForm type=org.apache.struts.action.DynaActionForm
  form-property name=myFile
 type=org.apache.struts.upload.FormFile/
/form-bean

So - based on this - I ended up with the following for a DynaValidatorForm:

form-bean name=uploadFile
type=org.apache.struts.validator.DynaValidatorForm
  form-property name=title type=java.lang.String/
  form-property name=revdate type=java.lang.String/
  form-property name=revinfo type=java.lang.String/
  form-property name=documentfile
type=org.apache.struts.upload.FormFile/
/form-bean


However - when the form POSTs to this action - I get the following in
the log:

2006-11-28 09:35:52,986 ERROR [org.apache.struts.util.RequestUtils]
Error creating form bean of class
org.apache.struts.validator.DynaValidatorForm
java.lang.NullPointerException: The type for property documentfile is
invalid
at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:415)
at
org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionFormClass.java:184)
at
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:294)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:193)
at
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:321)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

Does the DynaValidatorForm support FormFile? Is there some jar
dependency I need in place - maybe something from commons? I have the
following at present:

commons-beanutils.jar
commons-collections.jar
commons-dbcp.jar
commons-digester.jar
commons-fileupload.jar
commons-lang.jar
commons-logging.jar
commons-pool.jar
commons-resources.jar
commons-validator.jar

Have I missed some other obvious item? Made some really simple mistake?

For info - the form for submission looks like (formatting removed):

form method=post action=/admin/saveFile.do
enctype=multipart/form-data
  input type=text size=30 name=title id=title value=/
  input type=text size=30 name=revdate id=revdate value=/
  input type=text size=30 name=revinfo id=revinfo value=/
  input type=file size=30 name=manual id=manual value=/
  input type=submit size=30 name=submit id=submit value=Save/
/form

(note - this is generated using the velocity-tools for struts rather
than the standard jsp libraries).

-- 
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Mano Chinthaka Dasanayaka
Hi, 
As per my knowledge Your Libraries are Ok...any way ,
Have you set the
html:form action=/youraction method=post
enctype=multipart/form-data

??

Regards,
Mano

-Original Message-
From: Chris Searle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 2:15 PM
To: user@struts.apache.org
Subject: File upload using DynaActionForm/SynaValidatorForm

Struts 1.2

I need to try to get file upload to work for an existing struts app.

I was reading through the following:

http://wiki.apache.org/struts/StrutsFileUpload

where it mentions the following for Dyna action forms:

form-bean name=myForm type=org.apache.struts.action.DynaActionForm
  form-property name=myFile
 type=org.apache.struts.upload.FormFile/
/form-bean

So - based on this - I ended up with the following for a DynaValidatorForm:

form-bean name=uploadFile
type=org.apache.struts.validator.DynaValidatorForm
  form-property name=title type=java.lang.String/
  form-property name=revdate type=java.lang.String/
  form-property name=revinfo type=java.lang.String/
  form-property name=documentfile
type=org.apache.struts.upload.FormFile/
/form-bean


However - when the form POSTs to this action - I get the following in
the log:

2006-11-28 09:35:52,986 ERROR [org.apache.struts.util.RequestUtils]
Error creating form bean of class
org.apache.struts.validator.DynaValidatorForm
java.lang.NullPointerException: The type for property documentfile is
invalid
at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:415)
at
org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionFormClass
.java:184)
at
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java
:212)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:294)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:193)
at
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor
.java:321)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

Does the DynaValidatorForm support FormFile? Is there some jar
dependency I need in place - maybe something from commons? I have the
following at present:

commons-beanutils.jar
commons-collections.jar
commons-dbcp.jar
commons-digester.jar
commons-fileupload.jar
commons-lang.jar
commons-logging.jar
commons-pool.jar
commons-resources.jar
commons-validator.jar

Have I missed some other obvious item? Made some really simple mistake?

For info - the form for submission looks like (formatting removed):

form method=post action=/admin/saveFile.do
enctype=multipart/form-data
  input type=text size=30 name=title id=title value=/
  input type=text size=30 name=revdate id=revdate value=/
  input type=text size=30 name=revinfo id=revinfo value=/
  input type=file size=30 name=manual id=manual value=/
  input type=submit size=30 name=submit id=submit value=Save/
/form

(note - this is generated using the velocity-tools for struts rather
than the standard jsp libraries).

-- 
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Mano Chinthaka Dasanayaka
Try Using
form-bean name=uploadFile
type=org.apache.struts.validator.DynaValidatorActionForm
  form-property name=title type=java.lang.String/
  form-property name=revdate type=java.lang.String/
  form-property name=revinfo type=java.lang.String/
  form-property name=documentfile
type=org.apache.struts.upload.FormFile/
/form-bean

org.apache.struts.validator.DynaValidatorActionForm

Regards,
Mano
-Original Message-
From: Mano Chinthaka Dasanayaka [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 2:32 PM
To: 'Struts Users Mailing List'
Subject: RE: File upload using DynaActionForm/SynaValidatorForm

Hi, 
As per my knowledge Your Libraries are Ok...any way ,
Have you set the
html:form action=/youraction method=post
enctype=multipart/form-data

??

Regards,
Mano

-Original Message-
From: Chris Searle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 2:15 PM
To: user@struts.apache.org
Subject: File upload using DynaActionForm/SynaValidatorForm

Struts 1.2

I need to try to get file upload to work for an existing struts app.

I was reading through the following:

http://wiki.apache.org/struts/StrutsFileUpload

where it mentions the following for Dyna action forms:

form-bean name=myForm type=org.apache.struts.action.DynaActionForm
  form-property name=myFile
 type=org.apache.struts.upload.FormFile/
/form-bean

So - based on this - I ended up with the following for a DynaValidatorForm:

form-bean name=uploadFile
type=org.apache.struts.validator.DynaValidatorForm
  form-property name=title type=java.lang.String/
  form-property name=revdate type=java.lang.String/
  form-property name=revinfo type=java.lang.String/
  form-property name=documentfile
type=org.apache.struts.upload.FormFile/
/form-bean


However - when the form POSTs to this action - I get the following in
the log:

2006-11-28 09:35:52,986 ERROR [org.apache.struts.util.RequestUtils]
Error creating form bean of class
org.apache.struts.validator.DynaValidatorForm
java.lang.NullPointerException: The type for property documentfile is
invalid
at
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:415)
at
org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionFormClass
.java:184)
at
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java
:212)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:294)
at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:193)
at
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor
.java:321)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

Does the DynaValidatorForm support FormFile? Is there some jar
dependency I need in place - maybe something from commons? I have the
following at present:

commons-beanutils.jar
commons-collections.jar
commons-dbcp.jar
commons-digester.jar
commons-fileupload.jar
commons-lang.jar
commons-logging.jar
commons-pool.jar
commons-resources.jar
commons-validator.jar

Have I missed some other obvious item? Made some really simple mistake?

For info - the form for submission looks like (formatting removed):

form method=post action=/admin/saveFile.do
enctype=multipart/form-data
  input type=text size=30 name=title id=title value=/
  input type=text size=30 name=revdate id=revdate value=/
  input type=text size=30 name=revinfo id=revinfo value=/
  input type=file size=30 name=manual id=manual value=/
  input type=submit size=30 name=submit id=submit value=Save/
/form

(note - this is generated using the velocity-tools for struts rather
than the standard jsp libraries).

-- 
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File upload using DynaActionForm/DynaValidatorForm

2006-11-28 Thread Chris Searle
Mano Chinthaka Dasanayaka wrote:
 Hi, 
 As per my knowledge Your Libraries are Ok...any way ,
 Have you set the
 html:form action=/youraction method=post
   enctype=multipart/form-data


I generate the form using velocity-tools support for struts rather than
JSP. The created form once displayed to the user has this html:

form method=post action=/admin/saveFile.do
  enctype=multipart/form-data
  input type=text size=30 name=title id=title value=/
  input type=text size=30 name=revdate id=revdate value=/
  input type=text size=30 name=revinfo id=revinfo value=/
  input type=file size=30 name=manual id=manual value=/
  input type=submit size=30 name=submit id=submit value=Save/
/form

So - the action is correct, the method is post and the enctype is
multipart/form-data

If I understand the error log correctly - it is falling over when trying
to create an instance of the DynaValidatorForm to use for processing the
request - which makes me suspect that the error is either in the struts
form config xml or a missing dependency or similar.

-- 
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Chris Searle
Mano Chinthaka Dasanayaka wrote:
 Try Using
 form-bean name=uploadFile
 type=org.apache.struts.validator.DynaValidatorActionForm
   form-property name=title type=java.lang.String/
   form-property name=revdate type=java.lang.String/
   form-property name=revinfo type=java.lang.String/
   form-property name=documentfile
 type=org.apache.struts.upload.FormFile/
 /form-bean
 
 org.apache.struts.validator.DynaValidatorActionForm

Ah - now that was it. I will now have to go do some reading on what the
difference is between DynaValidatorForm and DynaValidatorActionForm -
since the app uses mostly DynaValidatorForm elsewhere. But - it did
solve this issue. Many thanks.

-- 
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Nuwan Chandrasoma

Hi,

With this DynaValidatorActionForm, you can have individual action mappings 
validation  in the validation.xml file


Regards,

Nuwan
- Original Message - 
From: Chris Searle [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, November 28, 2006 9:16 AM
Subject: Re: File upload using DynaActionForm/SynaValidatorForm



Mano Chinthaka Dasanayaka wrote:

Try Using
form-bean name=uploadFile
type=org.apache.struts.validator.DynaValidatorActionForm
  form-property name=title type=java.lang.String/
  form-property name=revdate type=java.lang.String/
  form-property name=revinfo type=java.lang.String/
  form-property name=documentfile
type=org.apache.struts.upload.FormFile/
/form-bean

org.apache.struts.validator.DynaValidatorActionForm


Ah - now that was it. I will now have to go do some reading on what the
difference is between DynaValidatorForm and DynaValidatorActionForm -
since the app uses mostly DynaValidatorForm elsewhere. But - it did
solve this issue. Many thanks.

--
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Mano Chinthaka Dasanayaka
Hi, 

Any way ...this will not work through SSL

I used this to an APP and worked fine in HTTP 

But failed when HTTPS...

Can you please have a look into this too...Thanks.

Regards,

Mano

 

-Original Message-
From: Chris Searle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 2:47 PM
To: Struts Users Mailing List
Subject: Re: File upload using DynaActionForm/SynaValidatorForm

 

Mano Chinthaka Dasanayaka wrote:

 Try Using

 form-bean name=uploadFile

 type=org.apache.struts.validator.DynaValidatorActionForm

   form-property name=title type=java.lang.String/

   form-property name=revdate type=java.lang.String/

   form-property name=revinfo type=java.lang.String/

   form-property name=documentfile

 type=org.apache.struts.upload.FormFile/

 /form-bean

 

 org.apache.struts.validator.DynaValidatorActionForm

 

Ah - now that was it. I will now have to go do some reading on what the

difference is between DynaValidatorForm and DynaValidatorActionForm -

since the app uses mostly DynaValidatorForm elsewhere. But - it did

solve this issue. Many thanks.

 

-- 

Chris Searle

[EMAIL PROTECTED]

 

-

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]

 

 



Tiles standalone (without struts)

2006-11-28 Thread hicham abassi

Hello,

I want to integrate Tiles to my project without Struts. I have my own front
controller implementation.
Actually, the tiles packaged with struts 1.3.5 cannot be used in standalone
mode, the TilesServlet doesn't exist.
But, i read on this mailing list, that a new subproject is on the way :
Tiles 2.0.
What's the status of this project, the date's release for a stable version ?
I'm not interesting by Sitemesh ;)

Thanks.

--
Hicham ABASSI


Re: Tiles standalone (without struts)

2006-11-28 Thread Antonio Petrelli

hicham abassi ha scritto:

But, i read on this mailing list, that a new subproject is on the way :
Tiles 2.0.
What's the status of this project, the date's release for a stable 
version ?


Currently Tiles 2 is in the sandbox:
http://struts.apache.org/struts-sandbox/tiles/index.html
We're on the process of deciding on graduation of Tiles 2:
http://cwiki.apache.org/confluence/display/S2WIKI/Tiles2+Graduation+Proposal
There is no date for a stable version... well actually there is no date 
even for an alpha :-)


Ciao
Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tiles standalone (without struts)

2006-11-28 Thread David H. DeWolf



Antonio Petrelli wrote:

hicham abassi ha scritto:

But, i read on this mailing list, that a new subproject is on the way :
Tiles 2.0.
What's the status of this project, the date's release for a stable 
version ?


Currently Tiles 2 is in the sandbox:
http://struts.apache.org/struts-sandbox/tiles/index.html
We're on the process of deciding on graduation of Tiles 2:
http://cwiki.apache.org/confluence/display/S2WIKI/Tiles2+Graduation+Proposal 

There is no date for a stable version... well actually there is no date 
even for an alpha :-)


That said, it is starting to stabalize and I'm using this latest 
version in a product that will go to production in January. . .If you're 
interested in being one of the first adopters, by all means, try it out!!!


I've *just* published a new snapshot:

version: 2.0-r480013-SNAPSHOT
repo: http://people.apache.org/repo/m2-snapshot-repository


David



Ciao
Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread David H. DeWolf

Sorry guys, I've been traveling with the family for thanksgiving. . .

I'm going to have to do some digging around to see if I can replicate 
your problem. I don't currently have an app using 2.0.1 (using the trunk 
revision until 2.0.2 is released - this week I hope)


If you can add a ticket to jira and post a small, simple, webapp that 
details the problem, that would help immensely.


I'll get you some info asap

David

Sébastien LABEY wrote:

Hi Kim,

No, sorry, no resolution to this :-(
I'm waiting for an answer. I hope David will have a solution soon...
If ever you find something to help, could you post it?
Thanks.

Sebastien

On 11/27/06, Kim [EMAIL PROTECTED] wrote:



 On 11/22/06, Sébastien LABEY sebastien.labey at gmail.com wrote:
 
  If I don't register the Tiles listener in the web.xml, Tomcat starts,
my
  webapp works, but when I ask for a page build with tiles, I have a
  ClassDefNotFoundException on the TilesContext class...
 
  Maybe this can help you to help me
 
  Sebastien


Any resolution to this?  I am seeing the same problem and the fixes
suggested
here have made no difference.

Thanks,
Kim







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Parameters not being set on Action in Struts 2

2006-11-28 Thread Ted Husted

I inspected it myself in a debugger the other day, and the property
was in the map.

If you like, send me a WAR of the test application, so we can work out
what's wrong. (The list doesn't accept attachments.)

-Ted.

On 11/28/06, Tarek Nabil [EMAIL PROTECTED] wrote:

It exhibits the same behavior even after converting the param
field/parameter to a String.

Is there a way to provide a JUnit test for that?

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Monday, November 27, 2006 6:52 PM
To: Struts Users Mailing List
Subject: Re: Parameters not being set on Action in Struts 2

Try it again using a String property, to be sure it is not a problem
with the type conversion.

On 11/27/06, Tarek Nabil [EMAIL PROTECTED] wrote:
 To clear my doubts, I re-built this application using WW 2.2.4. I
 expected that it will work perfectly and that would prove it's some
sort
 of a bug. To my surprise, it exhibited the exact same behavior!

 Now, since it's quite remote that such a drastic bug exists in WW
2.2.4,
 I'm starting to think that maybe the behavior I expect is not the
 correct one.

 Now, could someone please clarify whether the following is true?
 1- When parameters are available in the query string, those
parameters
 are made available to the action through 
 ActionContext.getContext().getParameters(). Is this true?
 2- If a property on the action has the same name as one of those
 parameters then the framework will attempt to set the property with
the
 parameter's name.

 This is not what is currently happening. Since WW 2.2.4 is supposed to
 be production quality then I'm guessing that there must be something
 wrong with the configuration. It can not be that some configuration
I've
 provided is wrong, simply because I have not provided any. It could
be,
 though, that some configuration is missing.

 The changes I've made to the application to get it to work with WW
2.2.4
 is minimal, so I won't go ahead and copy all the files here.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [S2] configuring Tiles with Struts 2

2006-11-28 Thread Dave Newton
FWIW I'm running 2.0.1 with Tiles without difficulty.

I don't have the machine in front of me; I'm not sure which Tiles it's
using, though; I can post tomorrow.

Dave

From: David H. DeWolf [mailto:[EMAIL PROTECTED] On Behalf Of David H.
 I'm going to have to do some digging around to see if I can replicate
 your problem. I don't currently have an app using 2.0.1 (using the
 trunk revision until 2.0.2 is released - this week I hope)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Chris Searle
Mano Chinthaka Dasanayaka wrote:
 Hi, 
 
 Any way ...this will not work through SSL
 
 I used this to an APP and worked fine in HTTP 
 
 But failed when HTTPS...
 
 Can you please have a look into this too...Thanks.

Worked fine for me. We have apache2 sitting serving via SSL and talking
AJP13 to jboss on localhost (well - the tomcat instance inside jboss) -
and it uploads the file just fine.

-- 
Chris Searle
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 / AJax : Ajax with Freemarker examples

2006-11-28 Thread Musachy Barroso
What version are you using? It doesn't seem to be much documentation 
about struts + ajax, but feel free to ask. There is a video and an slide 
presentation here: 
http://cwiki.apache.org/S2WIKI/articles-and-press.html, but I think the 
video link is broken.


musachy

hanasaki wrote:

Anyone have some docs and a good advanced hello world for struts doing
ajax, preferably with freemarker for the web templating.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File upload using DynaActionForm/SynaValidatorForm

2006-11-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mano,

Mano Chinthaka Dasanayaka wrote:
 Try Using
 form-bean name=uploadFile
 type=org.apache.struts.validator.DynaValidatorActionForm
   form-property name=title type=java.lang.String/
   form-property name=revdate type=java.lang.String/
   form-property name=revinfo type=java.lang.String/
   form-property name=documentfile
 type=org.apache.struts.upload.FormFile/
 /form-bean
 
 org.apache.struts.validator.DynaValidatorActionForm

Are you sure this is the problem? DynaValidatorForm is a valid form-bean
type, and it's the one I use, in fact. The error message indicates that
the type name for documentFile is unusable:

 Error creating form bean of class
 org.apache.struts.validator.DynaValidatorForm
 java.lang.NullPointerException: The type for property documentfile is
 invalid

Is this because DynaValidatorForm does not support
org.apache.struts.upload.FormFile properties? The documentation for this
form suggests that the only difference is that DynaValidatorActionForm
uses a separate XML file to define field validation rules. I'm not sure
how that's different than using commons-validator, though...

I think the problem is more likely that
org.apache.struts.upload.FormFile is not a class -- it's an interface.
Struts can't create a new object because Java can't create a new
instance of an interface.

The HOWTO Chris mentions instructs you to add this to your controller
configuration:

 multipartClass - The fully qualified Java class name of the multipart
 request handler class to be used with this module. Defaults is
 org.apache.struts.upload.CommonsMultipartRequestHandler.

Have you configured your controller element in this way? It appears
that there is a default, but that could be part of the problem.

I'm interested in the fact that a switch to DynaValidatorActionForm
fixed your problem; are you sure that you didn't change anything else?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbFSD9CaO5/Lv0PARAmAIAJ4knbM0fRFLB5EgndwBO6+xMBAL6wCgwrlC
CEKS/pLVh2jjW5I6AerLCNA=
=uJGh
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Scriptlet and Javascript

2006-11-28 Thread LIM Adam
Hi y'all

Here is my problem:
I have a javascript:history.back() link button. When I click on it, I
want to remove an entry in my object with scriptlet.
The problem is that the scriptlet is executed when my page is loaded and
not when I click on my button.
How could I manage it?

Thanks.

-
Ce message et les eventuelles pieces jointes sont confidentiels ou appartenant 
au Groupe HELICE et etablis a l'intention exclusive de ses destinataires.
Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) 
non-autorisee de ce message, ou des informations qu'il contient, est interdite.
Tout message electronique est susceptible d'alteration. Le Groupe HELICE 
decline toute responsabilite au titre de ce message s'il a ete modifie ou 
falsifie.

This e-mail and any attachments contain confidential information belonging to 
Groupe HELICE and are intended solely for the addressees.
Any unauthorised disclosure, use, dissemination or copying (either whole or 
partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration. Neither Groupe HELICE shall be liable 
for the message if altered or falsified.
-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] Scriptlet and Javascript

2006-11-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam,

LIM Adam wrote:
 I have a javascript:history.back() link button. When I click on it, I
 want to remove an entry in my object with scriptlet.
 The problem is that the scriptlet is executed when my page is loaded and
 not when I click on my button.
 How could I manage it?

You'll need to post your HTML code so we can better understand your
situation.

I'm not sure what you mean when you say that your scriptlet is executed
when your page is loaded. Do you mean that you have something like this:

script type=text/javascript!--
  history.back();
// --/script

... in your code? That doesn't seem right. Since you said that your
javascript code is javascript:history.back();, I'm assuming that your
HTML is like this:

input type=button onclick=javascript:history.back(); /

(Note that javascript: is unnecessary in the onclick handler... it's
always javascript.)

Anyhow, I'm also unclear about what you want to do when this button is
clicked you want to remove an object entry? Do you mean a javascript
object, or something on the server? If you mean the server, are you
using AJAX or something like that, or do you want to call an action on
the server in order to do that (which, I guess, doesn't exactly preclude
the use of AJAX)?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbFhv9CaO5/Lv0PARAnSOAJ9D6GyUC/yFc4XMcyK0QtyoHdjvtwCgwKhI
YTk/UxpaOrJjMP0Ew2e0Kik=
=M9mj
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Need help in calling a perl script

2006-11-28 Thread Vineet Chopra

Hi All,
I am using struts 1.2.9 and wanted to call a perl script.
If any one has done it, will appreciate the help.
An Example or a sample code will be great.

Also is it possible to send input parameters to the script?

--
Thank you,
Vineet Chopra


Re: [OT] Need help in calling a perl script

2006-11-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Vineet,

Vineet Chopra wrote:
 Hi All,
 I am using struts 1.2.9 and wanted to call a perl script.
 If any one has done it, will appreciate the help.
 An Example or a sample code will be great.

Do you just want to call Perl on the command line, or do you have some
kind of perl-cgi thing that you need to interact with?

 Also is it possible to send input parameters to the script?

That depends on how you want to invoke Perl. If you are using a URL to
call-back to your web server in order to invoke Perl on your behalf
(using CGI), then no, you can't send command-line parameters to Perl...
you'll have to use CGI for that.

On the other hand, if you're going to be calling Perl directly, then you
can certainly use command-line parameters.

I'm sure there are HOWTOs out there for how to do this kind of thing,
but you want to start by looking at the java.lang.Runtime class's exec()
methods. There are a bunch, depending on what information you want to
pass. Choose carefully.

The following considerations are extremely important:

1. Using Runtime.exec() allows users of your webapp to start new
   processes on your server. Are you really sure you want this to
   happen? Imagine if all of your users hit your Perl-invoking
   action at once. Would it kill your server?

2. You can't trust any information passed-in through request
   parameters. If you want to use command-line parameters,
   make sure that you taint check them so that someone
   doesn't add ; rm -rf / to the end of your command and
   end up destroying your filesystem.

3. Always remember to handle the resulting Process object (returned
   from Runtime.exec) properly. For instance, if you don't get the
   input and error streams from your spawned-process and read from them,
   they may never complete and never fail. Always read error and input
   until they are closed. If you are not providing input (via stdin,
   using an OutputStream from Java) to your process, then consider
   closing the OutputStream so that your process won't (accidentally)
   wait around for data on stdin.

4. Unless you really know what you are doing, always call
   Process.waitFor() to make sure that the process has terminated.
   You don't want a ton of processes starting and never finishing,
   without you knowing about it. At least if your Perl processes are
   never finishing, you'll know it because you'll get problems
   in your webapp, too.

Lastly, what are you doing with Perl? Can the same thing be done within
Java? That would be ideal, since spawning processes from a webapp is a
dangerous business. Alternatively, could you put information in a
database describing what needs to be done, and run Perl in a
batch-oriented way -- like using a cron job to periodically do these
operations? I think you'll end up with a more stable webapp that way.

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbGKf9CaO5/Lv0PARAtSnAJ9j4+uReDOhs2PvPvs1pU2ADIRsYwCdGllD
fUZOCFRzb1Siin728+Snh/Q=
=ziUJ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [S2] configuring Tiles with Struts 2

2006-11-28 Thread quinmeda1

A little more info

The following exception is thrown when trying to start the app with the
listener:  
2006-11-28 10:44:15 StandardContext[/myapp]Exception sending context
initialized event to listener instance of class
org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/tiles/TilesContainer

If I turn off the listener, the app will start up but I get an NPE in
TilesResult.getComponentDefinition, likely because the Listener didn't get
to do its thing.  

I am currently using struts2-tiles-plugin-2.0.1.jar and
tiles-core-2.0-r468346-SNAPSHOT.jar.  

Going to try hunting down TilesContainer in other JARs.  If I get stuck,
I'll try to throw together a sample app today to demonstrate the issue.  



-- 
View this message in context: 
http://www.nabble.com/-S2--configuring-Tiles-with-Struts-2-tf2665690.html#a7582882
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Scriptlet and Javascript

2006-11-28 Thread Martin Gainty
Hi adam-

I would suggest invalidating what your session is carrying with 
session.invalidate() and then re-populate ActionForm
I found this link quite helpful
http://mail-archives.apache.org/mod_mbox/struts-dev/200601.mbox/[EMAIL 
PROTECTED]

Anyone else?
M-
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: LIM Adam [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tuesday, November 28, 2006 10:26 AM
Subject: Scriptlet and Javascript


Hi y'all

Here is my problem:
I have a javascript:history.back() link button. When I click on it, I
want to remove an entry in my object with scriptlet.
The problem is that the scriptlet is executed when my page is loaded and
not when I click on my button.
How could I manage it?

Thanks.

-
Ce message et les eventuelles pieces jointes sont confidentiels ou appartenant 
au Groupe HELICE et etablis a l'intention exclusive de ses destinataires.
Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) 
non-autorisee de ce message, ou des informations qu'il contient, est interdite.
Tout message electronique est susceptible d'alteration. Le Groupe HELICE 
decline toute responsabilite au titre de ce message s'il a ete modifie ou 
falsifie.

This e-mail and any attachments contain confidential information belonging to 
Groupe HELICE and are intended solely for the addressees.
Any unauthorised disclosure, use, dissemination or copying (either whole or 
partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration. Neither Groupe HELICE shall be liable 
for the message if altered or falsified.
-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



struts-html question.... puzzling problem...

2006-11-28 Thread maya

hi,

I'm following chapter 3 of Wrox Struts book (Professional Jakarta 
Struts) to the letter.. using struts 1.3.5, Tomcat 5.5/1.4...  get 
TLD-related error on index.jsp (entire zipped-up webapp (small, 
virus-free...:) here... www.mayacove.com/java/strutsWrox.zip)


did index.jsp, and the classes, all following instructions in the book, 
the classes (LookupForm and LookupAction) compile fine..  put all 
packages (.jar's) from Jakarta Struts download where they belong 
(WEB-INF/lib..)


in index.jsp is this tag:

  html:form action=Lookup name=lookupForm type=ch03.LookupForm

I looked in struts-html.tld itself, one thing I note is that under 
form tag there are no attributes defined for either name or type, 
only for action (which can also be seen here, 
http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/tld-summary.html) 
so am a bit puzzled here



one thing I also noted is that JSP servlet for index.jsp is non-existent 
(when look in tomcat/work/  don't see either index_jsp.java or 
index_jsp.class..)  i.e., JSP for some reason is not even being read by 
container..)


I have in struts-config.xml:

  form-beans
form-bean name=lookupForm type=ch03.LookupForm /
  /form-beans

  action path=/Lookup type=ch03.LookupAction 
name=lookupForm/action


in LookupAction.java:

  LookupForm lookupForm = (LookupForm)form;
(this is confusing: so lookupForm is name of form but also an 
instantiation of the other class in the package...(??)


would much appreciate some help.. thank you..
  (posted a question on Wrox's website relevant forum about two days 
ago but have gotten no response..)


thank you very much.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread David H. DeWolf
Very odd, the 2.0.1 tag 
(http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_1/plugins/tiles/) 
has no reference to the TilesContainer, and I thought it was 
released/tagged before it was introduced.  Are you sure you're using 
struts 2.0.1 and not struts 2.0.2-SNAPSHOT?


David

quinmeda1 wrote:

A little more info

The following exception is thrown when trying to start the app with the
listener:  
2006-11-28 10:44:15 StandardContext[/myapp]Exception sending context

initialized event to listener instance of class
org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/tiles/TilesContainer

If I turn off the listener, the app will start up but I get an NPE in
TilesResult.getComponentDefinition, likely because the Listener didn't get
to do its thing.  


I am currently using struts2-tiles-plugin-2.0.1.jar and
tiles-core-2.0-r468346-SNAPSHOT.jar.  


Going to try hunting down TilesContainer in other JARs.  If I get stuck,
I'll try to throw together a sample app today to demonstrate the issue.  






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts-html question.... puzzling problem...

2006-11-28 Thread Nuwan Chandrasoma

Hi,

In long time back..., it was requried to use those attributes of the 
html:form tag.. but i you dont need them now for sure.., i think you book 
may be some bit old.


for your second question.., the one you defined in the struts-config.xml.., 
that lookuForm name will be used by the framwork to keep the instance of the 
ch03.LookupForm in the request, for instance.., and in your action class its 
just a variable name that will used inside the action class itself..


hope this would help U.

Regards,

Nuwan


- Original Message - 
From: maya [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Tuesday, November 28, 2006 5:12 PM
Subject: struts-html question puzzling problem...



hi,

I'm following chapter 3 of Wrox Struts book (Professional Jakarta 
Struts) to the letter.. using struts 1.3.5, Tomcat 5.5/1.4...  get 
TLD-related error on index.jsp (entire zipped-up webapp (small, 
virus-free...:) here... www.mayacove.com/java/strutsWrox.zip)


did index.jsp, and the classes, all following instructions in the book, 
the classes (LookupForm and LookupAction) compile fine..  put all packages 
(.jar's) from Jakarta Struts download where they belong (WEB-INF/lib..)


in index.jsp is this tag:

  html:form action=Lookup name=lookupForm type=ch03.LookupForm

I looked in struts-html.tld itself, one thing I note is that under form 
tag there are no attributes defined for either name or type, only for 
action (which can also be seen here, 
http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/tld-summary.html) 
so am a bit puzzled here



one thing I also noted is that JSP servlet for index.jsp is non-existent 
(when look in tomcat/work/  don't see either index_jsp.java or 
index_jsp.class..)  i.e., JSP for some reason is not even being read by 
container..)


I have in struts-config.xml:

  form-beans
form-bean name=lookupForm type=ch03.LookupForm /
  /form-beans

  action path=/Lookup type=ch03.LookupAction 
name=lookupForm/action


in LookupAction.java:

  LookupForm lookupForm = (LookupForm)form;
(this is confusing: so lookupForm is name of form but also an 
instantiation of the other class in the package...(??)


would much appreciate some help.. thank you..
  (posted a question on Wrox's website relevant forum about two days ago 
but have gotten no response..)


thank you very much.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: struts-html question.... puzzling problem...

2006-11-28 Thread Dave Newton
From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
 I'm following chapter 3 of Wrox Struts book (Professional Jakarta
 Struts) to the letter.. using struts 1.3.5, Tomcat 5.5/1.4...  get
 TLD-related error on index.jsp (entire zipped-up webapp (small,
 virus-free...:) here... www.mayacove.com/java/strutsWrox.zip)

Welcome to the world of Wrox.

(Sorry, Wrox.)

As mentioned, you need to look at *current* Struts documentation; that
book is like 3(?) years old and was written for Struts 1.1 (I imagine).

Struts has changed since then.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread quinmeda1

I'm definitely using 2.0.1.  Found I had some extra tiles-core* JARs lying
around in lib.  I cleared those out.  Now the listener is working, but I'm
back to getting java.lang.NoClassDefFoundError:
org/apache/tiles/TilesContext when it tries to render the result.  I'll keep
digging.  


-- 
View this message in context: 
http://www.nabble.com/-S2--configuring-Tiles-with-Struts-2-tf2665690.html#a7584075
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts-html question.... puzzling problem...

2006-11-28 Thread maya

Dave Newton wrote:

From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya

I'm following chapter 3 of Wrox Struts book (Professional Jakarta
Struts) to the letter.. using struts 1.3.5, Tomcat 5.5/1.4...  get
TLD-related error on index.jsp (entire zipped-up webapp (small,
virus-free...:) here... www.mayacove.com/java/strutsWrox.zip)


Welcome to the world of Wrox.

(Sorry, Wrox.)

As mentioned, you need to look at *current* Struts documentation; that
book is like 3(?) years old and was written for Struts 1.1 (I imagine).

Struts has changed since then.

Dave


thank you very much.. yes, the book uses 1.1..  I can't find any book 
that uses later versions, no 1.1 download on Jakarta site.. this is all 
very puzzling and confusing.. and Wrox, unlike oreilly, there's no 
e-mail contact for the authors (the few times I have written to oreilly 
authors I have always gotten a response...  oh well...)


thank you...  need to learn struts, what to do?  really can't find any 
book that covers 1.3.5..




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: struts-html question.... puzzling problem...

2006-11-28 Thread Dave Newton
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
 thank you very much.. yes, the book uses 1.1..  I can't find any book
 that uses later versions, no 1.1 download on Jakarta site.. 

http://struts.apache.org/downloads.html#PriorReleases

There are documents on the Struts Wiki discussing changes between 1.1 -
1.2, I don't know anything about 1.3. There are probably docs for that
there too:

http://wiki.apache.org/struts/StrutsUpgrade

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread David H. DeWolf

Can you find the entire stack trace?

quinmeda1 wrote:

I'm definitely using 2.0.1.  Found I had some extra tiles-core* JARs lying
around in lib.  I cleared those out.  Now the listener is working, but I'm
back to getting java.lang.NoClassDefFoundError:
org/apache/tiles/TilesContext when it tries to render the result.  I'll keep
digging.  





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread quinmeda1


David H. DeWolf wrote:
 
 Can you find the entire stack trace?
 

Sure: 


exception

javax.servlet.ServletException: Filter execution threw an exception

root cause

java.lang.NoClassDefFoundError: org/apache/tiles/TilesContext
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
java.lang.Class.getConstructor0(Class.java:2640)
java.lang.Class.newInstance0(Class.java:321)
java.lang.Class.newInstance(Class.java:303)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:136)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:148)

org.apache.struts2.impl.StrutsObjectFactory.buildResult(StrutsObjectFactory.java:73)

com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:179)

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:303)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:218)

com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)

com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:147)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:80)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:204)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:120)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:59)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:174)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.PrepareInterceptor.intercept(PrepareInterceptor.java:115)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:156)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:124)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:180)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)

org.apache.struts2.impl.StrutsActionProxy$1.call(StrutsActionProxy.java:27)

org.apache.struts2.impl.StrutsActionProxy$1.call(StrutsActionProxy.java:26)

org.apache.struts2.impl.RequestContextImpl.callInContext(RequestContextImpl.java:152)

org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:25)

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:330)


Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread Craig McClanahan

On 11/28/06, quinmeda1 [EMAIL PROTECTED] wrote:



A little more info

The following exception is thrown when trying to start the app with the
listener:
2006-11-28 10:44:15 StandardContext[/myapp]Exception sending context
initialized event to listener instance of class
org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/tiles/TilesContainer



Just as a historical note, I've been misled by NoClassDefFoundError before.
It is not necessarily talking about this class itself (TilesContainer) --
that would normally give you ClassNotFoundException instead.  It is more
likely to be a missing class that is *imported* by TilesContainer.

Craig


Re: [S2] configuring Tiles with Struts 2

2006-11-28 Thread quinmeda1


David H. DeWolf wrote:
 
 If you can add a ticket to jira and post a small, simple, webapp that 
 details the problem, that would help immensely.
 
 


Done:  https://bugzilla.spamassassin.org/struts/browse/SB-96

A small war is attached to the issue.  Use
http://localhost:8080/struts2tiles/searchByZip.do

Thanks
-- 
View this message in context: 
http://www.nabble.com/-S2--configuring-Tiles-with-Struts-2-tf2665690.html#a7585531
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts-html question.... puzzling problem...

2006-11-28 Thread maya

Dave Newton wrote:

From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
thank you very much.. yes, the book uses 1.1..  I can't find any book
that uses later versions, no 1.1 download on Jakarta site.. 


http://struts.apache.org/downloads.html#PriorReleases


did go to 1.1 link?  http://struts.apache.org/1.1/index.htm   ;)

thanks to all for your help




There are documents on the Struts Wiki discussing changes between 1.1 -
1.2, I don't know anything about 1.3. There are probably docs for that
there too:

http://wiki.apache.org/struts/StrutsUpgrade

Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: struts-html question.... puzzling problem...

2006-11-28 Thread Dave Newton
http://archive.apache.org/dist/struts/struts-1.1/

 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
 Sent: Tuesday, November 28, 2006 2:37 PM
 To: user@struts.apache.org
 Subject: Re: struts-html question puzzling problem...
 
 Dave Newton wrote:
  From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
  thank you very much.. yes, the book uses 1.1..  I can't find any
 book
  that uses later versions, no 1.1 download on Jakarta site..
 
  http://struts.apache.org/downloads.html#PriorReleases
 
 did go to 1.1 link?  http://struts.apache.org/1.1/index.htm   ;)
 
 thanks to all for your help
 
 
 
  There are documents on the Struts Wiki discussing changes between
 1.1 -
  1.2, I don't know anything about 1.3. There are probably docs for
 that
  there too:
 
  http://wiki.apache.org/struts/StrutsUpgrade
 
  Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



radio buttons within a nested form based on a db table.

2006-11-28 Thread Peter L. Berghold
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

OK... I've outsmarted myself and I'm looking for a way out of the corner
I painted myself into..

Here's the deal:  I have a radio button (group?) that I want to build
dynamically based on the contents of a database table. This radio button
set will then set a parameter within a nested form.

The solution I came up with at first was to create a Hibernate service
that builds the requisite HTML from a query putting in values and labels
as appropriate.  Fine...  this was OK as long as I didn't have to make a
second trip through the form.

But I do...

When the second trip happens the radio button forgets what the user
set it to and they have to set it again.  Nobody has to explain it to
me.. I fully understand what booby trap I stepped on.

Moving on... what methodology would folks suggest for dynamically
building the radio button group in this instance?


- --

Peter L. Berghold [EMAIL PROTECTED]
Those who fail to learn from history are condemned to repeat it.
AIM: redcowdawgYahoo IM: blue_cowdawg  ICQ: 11455958
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org

iD8DBQFFbJX+UM9/01RIhaARApMwAKDBHkhhOUcZFLUBh/+2Az5S9PHG8ACgkuoo
tm9oTwCkpi++fUIxZodSYjg=
=O1lN
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Themes and templates

2006-11-28 Thread Juan Espinosa
Hi to all, im building an struts2 based application and i dont understan the
concept of themes an templates. In the past i used struts 1, and in the view
i used jsp tags and struts tags like iterate and others.
 
Now in the application that im buildin i use tags provided by struts like
s:action s:include s:iterator,  s:form etc. the problem started when i was
using the radio button tag that renders radio buttons based on a list. The
buttons are put side by side... and i want to put one below the other
 
label radio1 label radio2 (now)
 
label radio1
label radio2 (mi needs)
 
I want to know if render of buttons tables forms and other tags are based on
this templates..and how i could change it
 
Regards
 
Juan
 
 
 
 
 


Re: Themes and templates

2006-11-28 Thread Mark Shifman

If you set
struts.ui.theme=simple in the struts.properties file
you won't fight with the templates and it will be sort of like good old 
struts 1.


However, there are other gotchas in store.  You have to get validation 
errors on the screen yourself
using s:fielderror/ since the theme cleverly puts the validation 
errors next to the invalid fields but
not with simple.  This is how I have done it but there is probably a 
better way:

s:if test=hasErrors()
   h3span style=color:red; font-weight:boldValidation 
Error/span/h3

   s:actionerror/
   s:fielderror/
/s:if
The hasErrors() comes from the value stack from you action that extended 
ActionSupport.


But this didn't really answer your question of how to make themes and 
templates work for you :(.



Juan Espinosa wrote:

Hi to all, im building an struts2 based application and i dont understan the
concept of themes an templates. In the past i used struts 1, and in the view
i used jsp tags and struts tags like iterate and others.
 
Now in the application that im buildin i use tags provided by struts like

s:action s:include s:iterator,  s:form etc. the problem started when i was
using the radio button tag that renders radio buttons based on a list. The
buttons are put side by side... and i want to put one below the other
 
label radio1 label radio2 (now)
 
label radio1

label radio2 (mi needs)
 
I want to know if render of buttons tables forms and other tags are based on

this templates..and how i could change it
 
Regards
 
Juan
 
 
 
 
 

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validator Framework problem

2006-11-28 Thread Thomas Thomas

Hi,
since I added a constraint for the length with minlength, I have the
following errror :

28-nov.-2006 21:31:33 org.apache.struts.validator.DynaValidatorForm validate
GRAVE: org.apache.struts.util.StrutsValidator
org.apache.commons.validator.ValidatorException:
org.apache.struts.util.StrutsValidator
   at org.apache.commons.validator.ValidatorAction.loadValidationClass(
ValidatorAction.java:623)
   at org.apache.commons.validator.ValidatorAction.executeValidationMethod(
ValidatorAction.java:531)
   at org.apache.commons.validator.Field.validateForRule(Field.java:766)
   at org.apache.commons.validator.Field.validate(Field.java:846)
   at org.apache.commons.validator.Form.validate(Form.java:290)
   at org.apache.commons.validator.Validator.validate(Validator.java:354)
   at org.apache.struts.validator.DynaValidatorForm.validate(
DynaValidatorForm.java:117)
   at org.apache.struts.chain.commands.servlet.ValidateActionForm.validate(
ValidateActionForm.java:53)
   at org.apache.struts.chain.commands.AbstractValidateActionForm.execute(
AbstractValidateActionForm.java:100)
   at org.apache.struts.chain.commands.ActionCommandBase.execute(
ActionCommandBase.java:48)
   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
   at org.apache.commons.chain.generic.LookupCommand.execute(
LookupCommand.java:304)
   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
   at org.apache.struts.chain.ComposableRequestProcessor.process(
ComposableRequestProcessor.java:280)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java
:1858)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:459)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
   at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)




I have the following code :
[...]
   validator name=minlength
classname=org.apache.struts.util.StrutsValidator
method=validateMinLength
 methodParams=java.lang.Object,
 org.apache.commons.validator.ValidatorAction,
 org.apache.commons.validator.Field,
 org.apache.struts.action.ActionMessages,
 org.apache.commons.validator.Validator,
 javax.servlet.http.HttpServletRequest
depends=required
msg=errors.minlength/
[...]
   form name=loginForm

   field property=login depends=required,minlength
   arg key=required.login/
   arg name=minlength key=${var:minlength}
resource=false/
   var
   var-nameminlength/var-name
   var-value2/var-value
   /var
   /field
[...]


Also can u tell me what ${var:minlength} will display ?
I need to display a message in French.

Thank u for any help !


RE: radio buttons within a nested form based on a db table.

2006-11-28 Thread Dave Newton
If you're already building the HTML yourself why can't you just build it
using the current values and set the appropriate radiobutton(s)?

From: Peter L. Berghold [mailto:[EMAIL PROTECTED]
 When the second trip happens the radio button forgets what the user
 set it to and they have to set it again.  Nobody has to explain it to
 me.. I fully understand what booby trap I stepped on.
 
 Moving on... what methodology would folks suggest for dynamically
 building the radio button group in this instance?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts, AJAX, JSP, and JavaScript question

2006-11-28 Thread Adam Gordon
I have a JSP and there's a link in the rendered page that makes an AJAX call
(to a Struts action) when clicked.  The results of that action, and the
contents of the response are set as the innerHTML on a hidden div defined
inside the afore mentioned rendered page.  The div is then un-hid.

Everything is working correctly except for one part:  When the div is
displayed, the JavaScript code in the contents returned by the AJAX call
isn't being executed and thus, the contents of the div aren't set up
correctly.

Does anyone know a way to have the JavaScript be executed?  Or force the
browser to execute it? 

I used to have an iframe and everything worked great, but there was a bad
side effect with session timeouts and so we've decided to not use them.

Any help would be appreciated.  Thanks.

-Adam



Re: Struts, AJAX, JSP, and JavaScript question

2006-11-28 Thread Musachy Barroso
In struts 2 we already do that for you(link tag and button tag in the 
ajax theme), this is the code to extract the javascript sections(from Dojo):


parse : function(s) {
   this.log(Parsing:  + s);
   var match = [];
   var tmp = [];
   var scripts = [];
   while(match){
 match = s.match(/script([^]*)([\s\S]*?)\/script/i);
 if(!match){ break; }
 if(match[1]){
   attr = match[1].match(/src=([']?)([^']*)\1/i);
   if(attr){
 // remove a dojo.js or dojo.js.uncompressed.js from remoteScripts
 // we declare all files with dojo.js as bad, regardless of folder
 var tmp2 = attr[2].search(/.*(\bdojo\b(?:\.uncompressed)?\.js)$/);
 if(tmp2  -1){
   this.log(Security note! inhibit:+attr[2]+ from  beeing 
loaded again.);

 }
   }
 }
 if(match[2]){
   // strip out all djConfig variables from script tags nodeValue
   // this is ABSOLUTLY needed as reinitialize djConfig after dojo 
is initialised
   // makes a dissaster greater than Titanic, update remove 
writeIncludes() to
   var sc = match[2].replace(/(?:var 
)?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g, 
);

   if(!sc){ continue; }

   // cut out all dojo.require (...) calls, if we have execute
   // scripts false widgets dont get there require calls
   // does suck out possible widgetpackage registration as well
   tmp = [];
   while(tmp){
 tmp = 
sc.match(/dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix))\(([']).*?\1\)\s*;?/);

 if(!tmp){ break;}
 sc = sc.replace(tmp[0], );
   }
   scripts.push(sc);
 }
 s = s.replace(/script[^]*[\s\S]*?\/script/i, );
   }

   return {
 text: s,
 scripts: scripts
   };
 }


and to execute it:

   var parsed = this.parse(data);
//eval scripts
if(parsed.scripts  parsed.scripts.length  0) {
  var scripts = ;
  for(var i = 0; i  parsed.scripts.length; i++){
scripts += parsed.scripts[i];
  }
  (new Function('_container_', scripts+'; return this;'))(this);
}

where 'data' is the html returned from the action.

have fun :)

musachy

Adam Gordon wrote:

I have a JSP and there's a link in the rendered page that makes an AJAX call
(to a Struts action) when clicked.  The results of that action, and the
contents of the response are set as the innerHTML on a hidden div defined
inside the afore mentioned rendered page.  The div is then un-hid.

Everything is working correctly except for one part:  When the div is
displayed, the JavaScript code in the contents returned by the AJAX call
isn't being executed and thus, the contents of the div aren't set up
correctly.

Does anyone know a way to have the JavaScript be executed?  Or force the
browser to execute it? 


I used to have an iframe and everything worked great, but there was a bad
side effect with session timeouts and so we've decided to not use them.

Any help would be appreciated.  Thanks.

-Adam


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Help with using formaKey attribute for display dollar values

2006-11-28 Thread robin bajaj

Hi Folks,
If I have an int value ( showing number of cents) in session scope that 
is going to get displayed on the JSP as dollar value.

I am using the following tag

bean:write name=XYZProfileDTO property=double_ABCDollarsAvailable 
formatKey=format.msf  scope=session/


where I have the following key defined in my .properties file

format.msf=$#,##0.00

But the above converts a value of 1896 cents to $18.00

How can I make it show up as $ 18.96 itself.?

Any help would be much appreciated,
regards,
robin.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Themes and templates

2006-11-28 Thread Mark Menard
On 11/28/06 4:04 PM, Juan Espinosa [EMAIL PROTECTED] wrote:

 I want to know if render of buttons tables forms and other tags are based on
 this templates..and how i could change it

Hi Juan,

The rendering of the buttons is based on the theme template. The templates
can be found in the Struts source in:

/core/src/main/resources/template

There are a few directories there. I believe S2 defaults to the xhtml theme.

I have extended the xhtml theme extensively to do variable multi-column
layouts. It took some work, and at the time I thought it was hard, but in
retrospect it wasn't that bad.

Take a look at the template that backs s:textfield first. It's text.ftl in
the xhtml directory. It's real short:

#include /${parameters.templateDir}/${parameters.theme}/controlheader.ftl
/
#include /${parameters.templateDir}/simple/text.ftl /
#include /${parameters.templateDir}/xhtml/controlfooter.ftl /


It includes a controlheader, the simple text.ftl template, then a
controlfooter.

The control header and footer is where the table wrapping happens and the
simple/text.ftl is where the actual input element is generated from.

Just go through it a piece at a time.

I have yet to use a radio button group, but I think the template to start
with is radiomap.ftl.

When going through this just remember to follow the includes.

Good luck,

Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Fwd: Help with using formaKey attribute for display dollar values]

2006-11-28 Thread robin bajaj

Sorry I forgot to mention,
I am actually dividing the 1896 cents by 100 before the jsp page
to make the value 18.96 and then display it using the formatkey as
$18.00.

I would appreciate a formatKey pattern that could convert 1896 straight 
into $18.96 (without me having to divide it by 100).


Thanks a lot,
robin.
---BeginMessage---

Hi Folks,
If I have an int value ( showing number of cents) in session scope that 
is going to get displayed on the JSP as dollar value.

I am using the following tag

bean:write name=XYZProfileDTO property=double_ABCDollarsAvailable 
formatKey=format.msf  scope=session/


where I have the following key defined in my .properties file

format.msf=$#,##0.00

But the above converts a value of 1896 cents to $18.00

How can I make it show up as $ 18.96 itself.?

Any help would be much appreciated,
regards,
robin.


---End Message---
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Themes and templates

2006-11-28 Thread Mark Menard
On 11/28/06 4:06 PM, Mark Menard [EMAIL PROTECTED] wrote:

 On 11/28/06 4:04 PM, Juan Espinosa [EMAIL PROTECTED] wrote:
 
 I want to know if render of buttons tables forms and other tags are based on
 this templates..and how i could change it
 
 Hi Juan,
 
 The rendering of the buttons is based on the theme template. The templates
 can be found in the Struts source in:
 
   /core/src/main/resources/template

Forgot to mention if you want to hack on these do the following:

1. In WEB-INF/classes/ make a template directory.

2. Copy the xhtml, and simple directories from the Struts distribution to
that directory.

3. in WEB-INF/classes/template make a directory for your own theme, such as
WEB-INF/class/template/mytheme/. You'll put any template you want to
override in this directory.

4. Optionally, although I'd highly recommend it, copy the contents of the
xhtml theme to your theme directory so you have something to hack on.

5. Hack away and see how it works.

Later,

Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Fwd: Help with using formaKey attribute for display dollar values]

2006-11-28 Thread Hubert Rabago

Did you declared the variable that holds the 1896 / 100 value as int?

On 11/28/06, robin bajaj [EMAIL PROTECTED] wrote:

Sorry I forgot to mention,
I am actually dividing the 1896 cents by 100 before the jsp page
to make the value 18.96 and then display it using the formatkey as
$18.00.

I would appreciate a formatKey pattern that could convert 1896 straight
into $18.96 (without me having to divide it by 100).

Thanks a lot,
robin.



-- Forwarded message --
From: robin bajaj [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Date: Tue, 28 Nov 2006 16:04:39 -0500
Subject: Help with using formaKey attribute for display dollar values
Hi Folks,
If I have an int value ( showing number of cents) in session scope that
is going to get displayed on the JSP as dollar value.
I am using the following tag

bean:write name=XYZProfileDTO property=double_ABCDollarsAvailable
formatKey=format.msf  scope=session/

where I have the following key defined in my .properties file

format.msf=$#,##0.00

But the above converts a value of 1896 cents to $18.00

How can I make it show up as $ 18.96 itself.?

Any help would be much appreciated,
regards,
robin.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Fwd: Help with using formaKey attribute for display dollar values]

2006-11-28 Thread robin bajaj

no that variable is a float.

Hubert Rabago wrote:

Did you declared the variable that holds the 1896 / 100 value as int?

On 11/28/06, robin bajaj [EMAIL PROTECTED] wrote:

Sorry I forgot to mention,
I am actually dividing the 1896 cents by 100 before the jsp page
to make the value 18.96 and then display it using the formatkey as
$18.00.

I would appreciate a formatKey pattern that could convert 1896 straight
into $18.96 (without me having to divide it by 100).

Thanks a lot,
robin.



-- Forwarded message --
From: robin bajaj [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Date: Tue, 28 Nov 2006 16:04:39 -0500
Subject: Help with using formaKey attribute for display dollar values
Hi Folks,
If I have an int value ( showing number of cents) in session scope that
is going to get displayed on the JSP as dollar value.
I am using the following tag

bean:write name=XYZProfileDTO property=double_ABCDollarsAvailable
formatKey=format.msf  scope=session/

where I have the following key defined in my .properties file

format.msf=$#,##0.00

But the above converts a value of 1896 cents to $18.00

How can I make it show up as $ 18.96 itself.?

Any help would be much appreciated,
regards,
robin.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Fwd: Re: [Fwd: Help with using formaKey attribute for display dollar values]]

2006-11-28 Thread robin bajaj

Actually its a double. sorry
---BeginMessage---

no that variable is a float.

Hubert Rabago wrote:

Did you declared the variable that holds the 1896 / 100 value as int?

On 11/28/06, robin bajaj [EMAIL PROTECTED] wrote:

Sorry I forgot to mention,
I am actually dividing the 1896 cents by 100 before the jsp page
to make the value 18.96 and then display it using the formatkey as
$18.00.

I would appreciate a formatKey pattern that could convert 1896 straight
into $18.96 (without me having to divide it by 100).

Thanks a lot,
robin.



-- Forwarded message --
From: robin bajaj [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Date: Tue, 28 Nov 2006 16:04:39 -0500
Subject: Help with using formaKey attribute for display dollar values
Hi Folks,
If I have an int value ( showing number of cents) in session scope that
is going to get displayed on the JSP as dollar value.
I am using the following tag

bean:write name=XYZProfileDTO property=double_ABCDollarsAvailable
formatKey=format.msf  scope=session/

where I have the following key defined in my .properties file

format.msf=$#,##0.00

But the above converts a value of 1896 cents to $18.00

How can I make it show up as $ 18.96 itself.?

Any help would be much appreciated,
regards,
robin.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---End Message---
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Struts Tiles, Lose of Performance ? :-(

2006-11-28 Thread Thomas Thomas

I just implemented Struts Tiles in my web application.
I love the concept of seperating everything that has to do with layout and
the rest.

But it seems that I will lose some performance now :

1)
The tag tiles:insert doesn't allow to include in a static way a jsp page.
tiles:insert attribute=header/

2)
Since the head tag is in the page (jsp in my case) that defines the layout
I need to put ALL the css files of the ALL the webpages.

head
meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1
link rel=stylesheet type=text/css href=layout/css/base.css/
link rel=stylesheet type=text/css href=incl/header/css/header.css/
link rel=stylesheet type=text/css href=incl/info/css/info.css/
link rel=stylesheet type=text/css
href=incl/menu_top/css/menu_top.css/
link rel=stylesheet type=text/css
href=incl/menu_left/css/menu_left.css/

link rel=stylesheet type=text/css
href=incl/center/css/content_index.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_registration.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_chat1.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_chat2.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_profile.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_search.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_home1.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_home2.css/

link rel=stylesheet type=text/css href=incl/footer/css/footer.css/

titlebean:message key=global.title//title
/head
body id=base_body

   div id=base_header
   tiles:insert attribute=header/
   /div

   div id=base_info
   tiles:insert attribute=info/
   /div

   div id=base_menu_top
   tiles:insert attribute=menu_top/
   /div

   div id=base_menu_left
   tiles:insert attribute=menu_left/
   /div

   div id=base_center
   tiles:insert attribute=center/
   /div

   div id=base_footer
   tiles:insert attribute=footer/
   /div

/body
/html


Re: Struts, AJAX, JSP, and JavaScript question

2006-11-28 Thread Frank W. Zammetti
Hi Adam,

If your doing straight AJAX yourself, i.e., directly interacting with the
XMLHttpRequest object, this won't execute script for you automatically. 
In fact, it won't do much of anything for you automatially, aside from
parsing XML if that's your return type.  Otherwise, it's just text to the
object and you'll have to execute scripts yourself.

Another poster gave you some info if your using S2, but I'm guessing by
your description your using S1.  In that case, continue reading! :)

The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this for
you... you can certainly switch over to using APT, but if you just want
some code to execute scripts, take a look here:

http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup

Down around line 313 you'll find the execScripts() function... simply yank
that out and use it on the responseText from XMLHttpRequest and you'll be
good to go.

If you are interested in looking at APT, here's a link:

http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html

And for JWP in general:

http://javawebparts.sourceforge.net

Hth,
Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Tue, November 28, 2006 3:43 pm, Adam Gordon wrote:
 I have a JSP and there's a link in the rendered page that makes an AJAX
 call
 (to a Struts action) when clicked.  The results of that action, and the
 contents of the response are set as the innerHTML on a hidden div
 defined
 inside the afore mentioned rendered page.  The div is then un-hid.

 Everything is working correctly except for one part:  When the div is
 displayed, the JavaScript code in the contents returned by the AJAX call
 isn't being executed and thus, the contents of the div aren't set up
 correctly.

 Does anyone know a way to have the JavaScript be executed?  Or force the
 browser to execute it?

 I used to have an iframe and everything worked great, but there was a
 bad
 side effect with session timeouts and so we've decided to not use them.

 Any help would be appreciated.  Thanks.

 -Adam




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts-html question.... puzzling problem...

2006-11-28 Thread maya
thank you very much..  downloaded lib and src downloads..  when 
unzipped, found that all files under docs are xmls not htmls..  :( oh 
brother  wonder also if there's an equiv. to this pg for 1.3.5... 
http://struts.apache.org/1.3.5/struts-taglib/tlddoc/index.html.


many thanks..



Dave Newton wrote:

http://archive.apache.org/dist/struts/struts-1.1/


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
Sent: Tuesday, November 28, 2006 2:37 PM
To: user@struts.apache.org
Subject: Re: struts-html question puzzling problem...

Dave Newton wrote:

From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
thank you very much.. yes, the book uses 1.1..  I can't find any

book

that uses later versions, no 1.1 download on Jakarta site..

http://struts.apache.org/downloads.html#PriorReleases

did go to 1.1 link?  http://struts.apache.org/1.1/index.htm   ;)

thanks to all for your help



There are documents on the Struts Wiki discussing changes between

1.1 -

1.2, I don't know anything about 1.3. There are probably docs for

that

there too:

http://wiki.apache.org/struts/StrutsUpgrade

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts-html question.... puzzling problem...

2006-11-28 Thread Wendy Smoak

On 11/28/06, maya [EMAIL PROTECTED] wrote:


thank you very much..  downloaded lib and src downloads..  when
unzipped, found that all files under docs are xmls not htmls..


You're probably looking at the source of the html pages, which is xml.

The documentation is inside struts-documentation.war, which you can
deploy to a servlet container, or just unzip somewhere.


wonder also if there's an equiv. to this pg for 1.3.5...
http://struts.apache.org/1.3.5/struts-taglib/tlddoc/index.html


  http://struts.apache.org/1.1/userGuide/


From the menu, under Developer Guides, choose a tag library, then

either the API Reference (above) or the Package Description.

--
Wendy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to set form beans in arraylist

2006-11-28 Thread sabriz naduvilothi

Hi Guys

I am new to Struts.Could any one send me a sample code where in i can set
the form bean values through the request and then retrieve the form beans
values in a jsp.

Thanking n advance

Sab

On 11/7/06, Thom Burnett [EMAIL PROTECTED] wrote:


What are common simple mistakes that would prevent validation from
occuring?
I've got a simple struts application that runs correctly except that
validation doesn't occur. The form info is accepted as correct when
required
information is missing.

I'm trying to figure out what's missing from my setup or understanding.

The ValidatorForm (my extension) class has appropriate get and set
functions
for all fields.
(The fields are spread over 3 jsp pages, if that matters.)
I've added the validator plugin to the struts-config, the action mapping
has
validate=true and a valid input path,  added the validation-rules and
validation.xml file, added the resource properties file with the standard
errors (taken from the struts file).

If I write my own validate method in the form bean that validation works
properly. It's my understanding that if I'm using the validation
framework,
I should not have a validate() method in the form.

Am I misunderstanding something? Any ideas what might be setup wrong or
missing.





--
Naduvilothi Sabriz
Mobile:001 443-631-0150(U.S.A)


 In the Middle of Difficulty lies opportunity


Struts 2 / AJax : Ajax with Freemarker examples

2006-11-28 Thread hanasaki
I have the luxury of using any/current versions.  Ask? I asked here...

==
Subject:
Re: Struts 2 / AJax : Ajax with Freemarker examples
From:
Musachy Barroso [EMAIL PROTECTED]
Date:
Tue, 28 Nov 2006 09:55:26 -0500
To:
Struts Users Mailing List user@struts.apache.org

What version are you using? It doesn't seem to be much documentation
about struts + ajax, but feel free to ask. There is a video and an slide
presentation here:
http://cwiki.apache.org/S2WIKI/articles-and-press.html, but I think the
video link is broken.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Parameters not being set on Action in Struts 2

2006-11-28 Thread Tarek Nabil

Thanks Ted.

I sent the WAR file and zip file containing the source of the action to
your email address directly.

I have a couple of other questions that I'll post on another thread and
I hope you'll help me with them, so that I can conclude my evaluation.

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 4:58 PM
To: Struts Users Mailing List
Subject: Re: Parameters not being set on Action in Struts 2

I inspected it myself in a debugger the other day, and the property
was in the map.

If you like, send me a WAR of the test application, so we can work out
what's wrong. (The list doesn't accept attachments.)

-Ted.

On 11/28/06, Tarek Nabil [EMAIL PROTECTED] wrote:
 It exhibits the same behavior even after converting the param
 field/parameter to a String.

 Is there a way to provide a JUnit test for that?

 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 27, 2006 6:52 PM
 To: Struts Users Mailing List
 Subject: Re: Parameters not being set on Action in Struts 2

 Try it again using a String property, to be sure it is not a problem
 with the type conversion.

 On 11/27/06, Tarek Nabil [EMAIL PROTECTED] wrote:
  To clear my doubts, I re-built this application using WW 2.2.4. I
  expected that it will work perfectly and that would prove it's some
 sort
  of a bug. To my surprise, it exhibited the exact same behavior!
 
  Now, since it's quite remote that such a drastic bug exists in WW
 2.2.4,
  I'm starting to think that maybe the behavior I expect is not the
  correct one.
 
  Now, could someone please clarify whether the following is true?
  1- When parameters are available in the query string, those
 parameters
  are made available to the action through 
  ActionContext.getContext().getParameters(). Is this true?
  2- If a property on the action has the same name as one of those
  parameters then the framework will attempt to set the property with
 the
  parameter's name.
 
  This is not what is currently happening. Since WW 2.2.4 is supposed
to
  be production quality then I'm guessing that there must be something
  wrong with the configuration. It can not be that some configuration
 I've
  provided is wrong, simply because I have not provided any. It could
 be,
  though, that some configuration is missing.
 
  The changes I've made to the application to get it to work with WW
 2.2.4
  is minimal, so I won't go ahead and copy all the files here.

DISCLAIMER
This email and any files transmitted with it are confidential and contain 
privileged or copyright 
information. If you are not the intended recipient you must not copy, 
distribute or use this email
or the information contained in it for any purpose other than to notify us of 
the receipt thereof.
If you have received this message in error, please notify the sender 
immediately, and delete this
email from your system.

Please note that e-mails are susceptible to change.The sender shall not be 
liable for the improper
or incomplete transmission of the information contained in this 
communication,nor for any delay in
its receipt or damage to your system.The sender does not guarantee that this 
material is free from
viruses or any other defects although due care has been taken to minimise the 
risk.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-28 Thread Chris Pratt

Or you can use a putList tag in your Tile Definition that lists just the css
(or js) files that you need for that page and insert them into the layout
dynamically.
 (*Chris*)

On 11/28/06, Thomas Thomas [EMAIL PROTECTED] wrote:


I just implemented Struts Tiles in my web application.
I love the concept of seperating everything that has to do with layout and
the rest.

But it seems that I will lose some performance now :

1)
The tag tiles:insert doesn't allow to include in a static way a jsp page.
tiles:insert attribute=header/

2)
Since the head tag is in the page (jsp in my case) that defines the layout
I need to put ALL the css files of the ALL the webpages.

head
meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1
link rel=stylesheet type=text/css href=layout/css/base.css/
link rel=stylesheet type=text/css href=incl/header/css/header.css/
link rel=stylesheet type=text/css href=incl/info/css/info.css/
link rel=stylesheet type=text/css
href=incl/menu_top/css/menu_top.css/
link rel=stylesheet type=text/css
href=incl/menu_left/css/menu_left.css/

link rel=stylesheet type=text/css
href=incl/center/css/content_index.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_registration.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_chat1.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_chat2.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_profile.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_search.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_home1.css/
link rel=stylesheet type=text/css
href=incl/center/css/content_home2.css/

link rel=stylesheet type=text/css href=incl/footer/css/footer.css/

titlebean:message key=global.title//title
/head
body id=base_body

div id=base_header
tiles:insert attribute=header/
/div

div id=base_info
tiles:insert attribute=info/
/div

div id=base_menu_top
tiles:insert attribute=menu_top/
/div

div id=base_menu_left
tiles:insert attribute=menu_left/
/div

div id=base_center
tiles:insert attribute=center/
/div

div id=base_footer
tiles:insert attribute=footer/
/div

/body
/html




Re: Struts, AJAX, JSP, and JavaScript question

2006-11-28 Thread Chris Pratt

Or you could just call eval(ajax.responseText).
 (*Chris*)

On 11/28/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:


Hi Adam,

If your doing straight AJAX yourself, i.e., directly interacting with the
XMLHttpRequest object, this won't execute script for you automatically.
In fact, it won't do much of anything for you automatially, aside from
parsing XML if that's your return type.  Otherwise, it's just text to the
object and you'll have to execute scripts yourself.

Another poster gave you some info if your using S2, but I'm guessing by
your description your using S1.  In that case, continue reading! :)

The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this for
you... you can certainly switch over to using APT, but if you just want
some code to execute scripts, take a look here:


http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup

Down around line 313 you'll find the execScripts() function... simply yank
that out and use it on the responseText from XMLHttpRequest and you'll be
good to go.

If you are interested in looking at APT, here's a link:


http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html

And for JWP in general:

http://javawebparts.sourceforge.net

Hth,
Frank


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
(2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, November 28, 2006 3:43 pm, Adam Gordon wrote:
 I have a JSP and there's a link in the rendered page that makes an AJAX
 call
 (to a Struts action) when clicked.  The results of that action, and the
 contents of the response are set as the innerHTML on a hidden div
 defined
 inside the afore mentioned rendered page.  The div is then un-hid.

 Everything is working correctly except for one part:  When the div is
 displayed, the JavaScript code in the contents returned by the AJAX call
 isn't being executed and thus, the contents of the div aren't set up
 correctly.

 Does anyone know a way to have the JavaScript be executed?  Or force the
 browser to execute it?

 I used to have an iframe and everything worked great, but there was a
 bad
 side effect with session timeouts and so we've decided to not use them.

 Any help would be appreciated.  Thanks.

 -Adam




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Does Struts 2 solve the action chaining problem?

2006-11-28 Thread Tarek Nabil
Hi,

One of the problems with Struts was that if you had a page that requires
some setup and this page submits to an Action, then you would not be
able to set validate to true on that action because if validation
problems occur then Struts will take you directly to the input JSP
without performing the setup and your JSP wouldn't work.

A solution to that would be to specify the input of the action as the
setup action, which means you're doing action chaining and Struts is not
good at that (it will reset your form among other things).

The solution of choice for us so far was to call validate() ourselves in
the action and if a validation problem occurs then we call the setup
method (eventually you start using your action methods as an API which
still was not good).

Another problematic scenario is the case when you're editing some
database record for example. When you go to your setup action for the
first time, you will populate drop down lists for example, and then load
the existing values from the database to your JSP fields. If the user
attempts to save and some problem occurs then in the setup action, you
will need to again populate the drop down lists, but you will NOT want
to overwrite the user's inputs with the existing data. This is very
similar to the first problem, but you would also need to pass some flag
to the setup method to tell it whether to copy the data from the
database to your ActionForm.

Does Struts 2 or even WW 2.2.4 solve that problem in an elegant way? I
remember coming across something about using Interceptors for that, but
that would mean creating an Interceptor for almost every action of that
type. I also noticed that there are some warnings in the documentation
against using action chaining in Struts 2 as well.

Thanks,
Tarek Nabil
DISCLAIMER
This email and any files transmitted with it are confidential and contain 
privileged or copyright 
information. If you are not the intended recipient you must not copy, 
distribute or use this email
or the information contained in it for any purpose other than to notify us of 
the receipt thereof.
If you have received this message in error, please notify the sender 
immediately, and delete this
email from your system.

Please note that e-mails are susceptible to change.The sender shall not be 
liable for the improper
or incomplete transmission of the information contained in this 
communication,nor for any delay in
its receipt or damage to your system.The sender does not guarantee that this 
material is free from
viruses or any other defects although due care has been taken to minimise the 
risk.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts, AJAX, JSP, and JavaScript question

2006-11-28 Thread Frank W. Zammetti
That will only work if the response is nothing but JavaScript, in which 
case your 100% correct (although many people say that eval() should be 
renamed evil() and should be avoided like the plague... I'm not *quite* 
that extreme in my avoidance of it).


As a quick proof:

html
  head
  script
var s = ;
//s +=  + html + ;
//s +=  + head + ;
//s +=  + script + ;
s += alert('test');;
//s +=  + /script + ;
//s +=  + /head + ;
//s +=  + body + ;
//s += Hello;
//s +=  + /body + ;
//s +=  + /html + ;
function testit() {
  eval(s);
}
  /script
  /head
  body
The Body
input type=button value=testit onclick=testit();
  /body
/html

Load this file in your browser and you'll find that you get an alert, as 
expected... now, uncomment the commented lines and reload and you'll see 
that it no longer pops the alert (interestingly, in IE I get a syntax 
error, because it's trying to interpret the markup as script, but in FF 
it just quietly doesn't work, not even a notice in Firebug).


So, if the idea is to execute script blocks that are part of an HTML 
response, a simple eval() won't work... but if all your returning is 
script, then I definitely echo Chris' suggestion and would go with 
eval() (regardless of who wants to slap your hand with a ruler).


Frank


Chris Pratt wrote:

Or you could just call eval(ajax.responseText).
 (*Chris*)

On 11/28/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:


Hi Adam,

If your doing straight AJAX yourself, i.e., directly interacting with the
XMLHttpRequest object, this won't execute script for you automatically.
In fact, it won't do much of anything for you automatially, aside from
parsing XML if that's your return type.  Otherwise, it's just text to the
object and you'll have to execute scripts yourself.

Another poster gave you some info if your using S2, but I'm guessing by
your description your using S1.  In that case, continue reading! :)

The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this for
you... you can certainly switch over to using APT, but if you just want
some code to execute scripts, take a look here:


http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup 



Down around line 313 you'll find the execScripts() function... simply 
yank

that out and use it on the responseText from XMLHttpRequest and you'll be
good to go.

If you are interested in looking at APT, here's a link:


http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html 



And for JWP in general:

http://javawebparts.sourceforge.net

Hth,
Frank


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
(2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Tue, November 28, 2006 3:43 pm, Adam Gordon wrote:
 I have a JSP and there's a link in the rendered page that makes an AJAX
 call
 (to a Struts action) when clicked.  The results of that action, and the
 contents of the response are set as the innerHTML on a hidden div
 defined
 inside the afore mentioned rendered page.  The div is then un-hid.

 Everything is working correctly except for one part:  When the div is
 displayed, the JavaScript code in the contents returned by the AJAX 
call

 isn't being executed and thus, the contents of the div aren't set up
 correctly.

 Does anyone know a way to have the JavaScript be executed?  Or force 
the

 browser to execute it?

 I used to have an iframe and everything worked great, but there was a
 bad
 side effect with session timeouts and so we've decided to not use them.

 Any help would be appreciated.  Thanks.

 -Adam




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Internationalized messages for pure JavaScript client side validations

2006-11-28 Thread Tarek Nabil
Hi,

I read the following in the documentation

quote
Errors are reported using the default validation message, not the
internationalized version that the server-side might be aware of. This
is a known issue. You may want to try the AJAX Client Side Validation
for messages that are fully internationalized.
/quote

Is this feature impossible to implement using the current framework? I
don't want to go to the server for simple client side validations and
the internationalized messages are a must for me.

I looked at the code and it seems that this expression is the one that
yields the message
${validator.getMessage(action)?js_string}

I'm not into freemarker but it seems to be calling something on the
validator object. Is there a way we can enhance the validation object in
some way so that it exposes the internationalized message or is this
object not aware of the user's current locale at all? Could it be
enhanced so that it is aware of it?

Thanks,
Tarek Nabil

DISCLAIMER
This email and any files transmitted with it are confidential and contain 
privileged or copyright 
information. If you are not the intended recipient you must not copy, 
distribute or use this email
or the information contained in it for any purpose other than to notify us of 
the receipt thereof.
If you have received this message in error, please notify the sender 
immediately, and delete this
email from your system.

Please note that e-mails are susceptible to change.The sender shall not be 
liable for the improper
or incomplete transmission of the information contained in this 
communication,nor for any delay in
its receipt or damage to your system.The sender does not guarantee that this 
material is free from
viruses or any other defects although due care has been taken to minimise the 
risk.
**

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How Where to specify the Request Processor class name?

2006-11-28 Thread Anil Kumar T

Hi Guys,



I have read in the documentation and on the net also about the Struts
framework. There would be only one ActionServlet per web app and one
RequestProcessor per module. Is that true? Any body pls help me with
your answers and any useful sites.



I believe we can over write the ActionServlet,  this case we would
mention the Servlet class in the web.xml. But I read that even
RequestProcessor also can be over written, but not mentioned where to
specify the implemented RequestProcessor class name.



I really need some useful info on this topic.



Kindly help me with this.



Thanks  regards,

Anil.



Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

Re: How Where to specify the Request Processor class name?

2006-11-28 Thread Nuwan Chandrasoma

read this...

http://wiki.apache.org/struts/RequestProcessor



- Original Message - 
From: Anil Kumar T [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 29, 2006 6:53 AM
Subject: How  Where to specify the Request Processor class name?



Hi Guys,



I have read in the documentation and on the net also about the Struts
framework. There would be only one ActionServlet per web app and one
RequestProcessor per module. Is that true? Any body pls help me with
your answers and any useful sites.



I believe we can over write the ActionServlet,  this case we would
mention the Servlet class in the web.xml. But I read that even
RequestProcessor also can be over written, but not mentioned where to
specify the implemented RequestProcessor class name.



I really need some useful info on this topic.



Kindly help me with this.



Thanks  regards,

Anil.



Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the 
individual or the entity to which it is addressed, and may contain 
information that is privileged, confidential or exempt from disclosure under 
applicable law. If you are not the intended recipient or it appears that 
this mail has been forwarded to you without proper authority, you are 
notified that any use or dissemination of this information in any manner is 
strictly prohibited. In such cases, please notify us immediately at 
[EMAIL PROTECTED] and delete this email from your records. 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does Struts 2 solve the action chaining problem?

2006-11-28 Thread Craig McClanahan

On 11/28/06, Tarek Nabil [EMAIL PROTECTED] wrote:


Hi,

One of the problems with Struts was that if you had a page that requires
some setup and this page submits to an Action, then you would not be
able to set validate to true on that action because if validation
problems occur then Struts will take you directly to the input JSP
without performing the setup and your JSP wouldn't work.

A solution to that would be to specify the input of the action as the
setup action, which means you're doing action chaining and Struts is not
good at that (it will reset your form among other things).

The solution of choice for us so far was to call validate() ourselves in
the action and if a validation problem occurs then we call the setup
method (eventually you start using your action methods as an API which
still was not good).

Another problematic scenario is the case when you're editing some
database record for example. When you go to your setup action for the
first time, you will populate drop down lists for example, and then load
the existing values from the database to your JSP fields. If the user
attempts to save and some problem occurs then in the setup action, you
will need to again populate the drop down lists, but you will NOT want
to overwrite the user's inputs with the existing data. This is very
similar to the first problem, but you would also need to pass some flag
to the setup method to tell it whether to copy the data from the
database to your ActionForm.

Does Struts 2 or even WW 2.2.4 solve that problem in an elegant way? I
remember coming across something about using Interceptors for that, but
that would mean creating an Interceptor for almost every action of that
type. I also noticed that there are some warnings in the documentation
against using action chaining in Struts 2 as well.



Interceptors are an O-O oriented approach to this kind of issue, but there
are ligther weight alternatives. For the particular need of a setup
action, consider the use of the Preparable interface in Struts 2.  It's
pretty similar to what the Tiles Controller interface supported in Struts
1.x ... a chance for your business logic to set up the stuff that is needed
for rendering a particular view.

If you're looking at JSF as a view technology, you'll likely be interested
in what Shale http://shale.apache.org/; has to offer, particularly in the
View Controller feature.  Not only does the View Controller functionality
support the setup scenario (via the prerender() callback method on the
ViewController interface), it also supports cleaning up *after* the view has
been rendered, via the destroy() callback.

Craig


RE: How Where to specify the Request Processor class name?

2006-11-28 Thread Anil Kumar T

Thanks Nuwan. It gave me some useful info.

Anil.

-Original Message-
From: Nuwan Chandrasoma [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 29, 2006 3:35 PM
To: Struts Users Mailing List
Subject: Re: How  Where to specify the Request Processor class name?

read this...

http://wiki.apache.org/struts/RequestProcessor



- Original Message -
From: Anil Kumar T [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 29, 2006 6:53 AM
Subject: How  Where to specify the Request Processor class name?



Hi Guys,



I have read in the documentation and on the net also about the Struts
framework. There would be only one ActionServlet per web app and one
RequestProcessor per module. Is that true? Any body pls help me with
your answers and any useful sites.



I believe we can over write the ActionServlet,  this case we would
mention the Servlet class in the web.xml. But I read that even
RequestProcessor also can be over written, but not mentioned where to
specify the implemented RequestProcessor class name.



I really need some useful info on this topic.



Kindly help me with this.



Thanks  regards,

Anil.



Information transmitted by this e-mail is proprietary to Infinite
Computer
Solutions and / or its Customers and is intended for use only by the
individual or the entity to which it is addressed, and may contain
information that is privileged, confidential or exempt from disclosure
under
applicable law. If you are not the intended recipient or it appears that

this mail has been forwarded to you without proper authority, you are
notified that any use or dissemination of this information in any manner
is
strictly prohibited. In such cases, please notify us immediately at
[EMAIL PROTECTED] and delete this email from your records.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



s2 image submit button and methods

2006-11-28 Thread Ing. Andrea Vettori

Hi,

yesterday it took me a day to understand and resolve a problem so I  
think it can be useful to share it; maybe someone can explain a  
better solution.


I have a form with more than one submit button. The submit buttons  
are images so I used the s:submit type=image method= ...  
tag on all but the default button.


The problem is that since the image button is considered by the  
browser similar to an imagemap, if the button is called btnA, the  
browser submits btnA, btnA.x and btnA.y request parameters, where  
the .x and .y are the coordinates of the click inside the image. I  
think this cannot be disabled on the browser since it is required by  
the HTML specifications.


Now this cause problems when the parameters are used by the action to  
call the appropriate method. If I have a button like


s:form action=anAction ...
s:submit type=image method=aMethod ...

in the HTML you get something like

input type=image name=method:aMethod ...

and when the request is submitted the browser sends method:aMethod,  
method:aMethod.x and method:aMethod.y parameters. This cause the  
framework to try to execute the aMethod.x() method on the action  
class which generate an Exception !!!


I've tried to filter the parameters with ParameterNameAware but the  
parameter that starts with method: are not passed to the  
acceptableParameter method. So I extended the parameters interceptor  
and overrided the acceptableParameter function and even if now I see  
the parameters on the method, even if I reject them, the framework  
use them to try to execute the method in the action.


The solution I used is to have the image submit to set a value (like  
s:submit type=image name=aName value=aValue  and use that  
value inside the execute method of the action to call the appropriate  
method.


But I'm looking for a better solution. I also think that since this  
will be a common problem, it should be addressed by the framework  
automatically rejecting method:xxx and action:xxx parameters that  
ends with a .x and .y.


Thanks

--
Ing. Andrea Vettori
Consulente per l'Information Technology