RE: Replacement values

2002-12-16 Thread Jorge Martins
How about:


  


Wouldn't that do the trick?

 

   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group | http://www.esw.inesc-id.pt/~jorge



-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]] 
Sent: segunda-feira, 16 de Dezembro de 2002 14:19
To: Struts Users Mailing List
Subject: RE: Replacement values


I believe that replacement values are interpreted as Strings.  Also, quoting
Craig from an earlier post:

...the  tag does not create a scripting variable.  It only
stores the current element you are iterating over in the attribute defined
by "name" 

Given that, a quick solution to what you are attempting isn't obvious.

Sri

-Original Message-
From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 16, 2002 5:07 AM
To: Struts Users Mailing List
Subject: Replacement values


Hi,


  I am trying to iterate over values in my form bean.


  


  The above prints the string "item" for the replacement value.

 Shouldn't it print the value iterated over the String[] which is the type
of the property in my form bean ?

 Even bean:write throws " bean not found in scope null " error.

 "myForm" is in the session scope according the config file.

Thanks,
Mohan

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


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



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




RE: Validator in struts 1.1

2002-12-02 Thread Jorge Martins
This happened to me too...
Defining a proxy within the Tomcat JVM using the CATALINA_OPTS
environment variable solved my problem...

CATALINA_OPTS=-DproxySet=true -DproxyHost=
-DproxyPort=

jorge



-Original Message-
From: Frost, Gary [IT] [mailto:[EMAIL PROTECTED]] 
Sent: segunda-feira, 2 de Dezembro de 2002 7:54
To: [EMAIL PROTECTED]
Subject: Validator in struts 1.1


Hi, I'm trying to get the validator to work, and I must be doing
something wrong, coz when I look at the debug output of the webapp I see
the following message

2002-12-02 18:31:05,744  INFO [main]
org.apache.struts.validator.ValidatorPlugIn[] - Loading validation rules
file from '/WEB-INF/config/validator-rules.xml'
2002-12-02 18:31:05,772 DEBUG [main]
org.apache.commons.digester.Digester.sax[] -
setDocumentLocator(org.apache.crimson.parser.Parser2$DocLocator@354749)
2002-12-02 18:31:05,773 DEBUG [main]
org.apache.commons.digester.Digester.sax[] - startDocument() 2002-12-02
18:31:05,789 DEBUG [main] org.apache.commons.digester.Digester.sax[] -
resolveEntity('-//Apache Software Foundation//DTD Commons Validator
Rules Configuration 1.0//EN',
'http://jakarta.apache.org/commons/dtds/validator_1_0.dtd')
2002-12-02 18:31:06,149 ERROR [main]
org.apache.commons.digester.Digester[]
- Parse Fatal Error at line 4 column -1: External entity not found:
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";.
java.net.UnknownHostException: jakarta.apache.org
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3035)
at
org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.java:2
723)
at
org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1154)
at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:488)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at
org.apache.commons.digester.Digester.parse(Digester.java:1561)
at
org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Va
lida
torResourcesInitializer.java:256)
at
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugI
n.ja
va:224)
at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:16
7)


I.e. from what I see here its trying to go externally to resolve the
dtd...

I was using 1.1Beta2, and though maybe that it was a bug that has been
corrected, so I grabbed the latest nightly build (20021201), I copied
all the jar files into my WEB_INF/lib directory, and they certainly seem
to be loading ok, I checked and confirmed that the validator_1_0.dtd is
in the commons-validator.jar (it does).

I looked in the Catalina.out from Tomcat 4, and saw quite a few
ContextConfig[/webatlas]: Scanning library JAR files
ContextConfig[/webatlas]:
tldConfigJar(/WEB-INF/lib/standard.jar): Processing entry
'META-INF/sql-rt.tld'
XmlMapper: Set locator :
org.apache.xerces.readers.DefaultEntityHandler@4cc588
Resolve: -//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd
  Using alternate DTD
/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd
Notation: WEB-JSPTAGLIB.1_2 -//Sun Microsystems,
Inc.//DTD JSP Tag Library 1.2//EN null
ContextConfig[/webatlas]:
tldConfigJar(/WEB-INF/lib/standard.jar): Processing entry
'META-INF/c.tld'

And the same for struts.jar (i.e. 
ContextConfig[/webatlas]:
tldConfigJar(/WEB-INF/lib/struts.jar): Processing entry
'META-INF/tlds/struts-nested.tld'
XmlMapper: Set locator :
org.apache.xerces.readers.DefaultEntityHandler@3adc56
Resolve: -//Sun Microsystems, Inc.//DTD JSP Tag Library
1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
  Using alternate DTD
/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd)

But nothing for validator.jar in that section (even though near the top
of the output was a line
WebappLoader[/webatlas]: Deploy JAR
/WEB-INF/lib/commons-validator.jar to
/home/gf06866/projects/webATLAS/dist/war/WEB-INF/lib/commons-validator.j
ar

So it seems that it is picking up the jar ok...!!

I confirmed that my struts.xml was loading the validator in the plugin
correctly, it reads




And the two validator files are reference the correct DOC_TYPE, they
(both) read
http://jakarta.apache.org/commons/dtds/validator_1_0.dtd";>

The net result is that obviously the validator isn't configuring
properly, and so when I go to my login page (which I have set up a very
simple 'required' test for the user name, I get the error message


[Exception in:/WEB-INF/jsps/tiles/logon/logon.jsp] null
java.lang.NullPointerException
at
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(Javascri
ptVa
lida

RE: ActionForm manipulation within an Action

2002-11-15 Thread Jorge Martins
Well, I had tried it before just like you are saying...

Two actions use the same ActionForm (a DynaValidatorForm defined with
request scope).
The first Action sets a property in the ActionForm and forwards to
another Action (using a local  -- with
no redirect=true this should be forwarding, right?!). The problem is the
second Action received the ActionForm without the property set...

Due to time constraints I had to resort to an ugly bypass to the
ActionForms by setting an attribute directly in the request (in the
first Action) and verifying the existence of the attribute (in the
second Action).

Any thoughts on why this wasn't working?

Thanks,
  jorge

 

   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group |
http://www.esw.inesc-id.pt/~jorge


The form bean can be in the request scope as long as you're forwarding
to 
the next resource and NOT redirecting.

David






>From: "Sri Sankaran" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: ActionForm manipulation within an Action
>Date: Fri, 15 Nov 2002 12:47:51 -0500
>
>...and the form bean is of session scope.
>
>Sri
>
>-Original Message-
>From: David Graham [mailto:dgraham1980@;hotmail.com]
>Sent: Friday, November 15, 2002 12:35 PM
>To: [EMAIL PROTECTED]
>Subject: Re: ActionForm manipulation within an Action
>
>
>Of course, this happens all the time in add/edit forms.  Any change to
>the form in the first action will be seen by the action it forwards to 
>as long as both actions are setup to use the same form bean in 
>struts-config.xml.
>
>David
>
>
>
>
>
>
> >From: "Jorge Martins" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> ><[EMAIL PROTECTED]>
> >To: "'Struts Mailinglist'" <[EMAIL PROTECTED]>
> >Subject: ActionForm manipulation within an Action
> >Date: Fri, 15 Nov 2002 17:20:57 -
> >
> >Hi,
> >
> >Is there a way to set an attribute in an ActionForm received by an
> >Action and having that change propagated when I 'findForward()' to 
> >another Action?
> >
> >Thanks
> >   Jorge
> >
> >
>
>___
_
> >inesc-id   Jorge Martins  |
[EMAIL PROTECTED]
> >lisboaSoftware Engineering Group |
> >http://www.esw.inesc-id.pt/~jorge
> >
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:struts-user-unsubscribe@;jakarta.apache.org>
> >For additional commands, e-mail: 
> ><mailto:struts-user-help@;jakarta.apache.org>
>
>
>_
>MSN 8 with e-mail virus protection service: 2 months FREE*
>http://join.msn.com/?page=features/virus
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@;jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@;jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@;jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@;jakarta.apache.org>


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




ActionForm manipulation within an Action

2002-11-15 Thread Jorge Martins
Hi,
 
Is there a way to set an attribute in an ActionForm received by an
Action and having that change propagated when I 'findForward()' to
another Action?
 
Thanks
  Jorge

 

   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group |
http://www.esw.inesc-id.pt/~jorge




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: Struts 1.1 and StrutsTestCase

2002-11-15 Thread Jorge Martins
Thanks for the prompt info!...

Unfortunately I don't have a lot of time to sift through the
ActionServlet's code :P
As far as I've gone through StrutsTestCase doesn't seem to bother
appending the module prefix to the expected path, but I might be wrong,
not having an in dept knowledge of Struts internals...

As anyone else experienced these problems? Are there any known
solutions? Any workarounds? I'm kind of in a hurry... If I can't get
StrutsTestCase to work with Struts modules I'll be forced to revert to a
single default module.

TIA,
Jorge


 
________
   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group |
http://www.esw.inesc-id.pt/~jorge



-Original Message-
From: [EMAIL PROTECTED] [mailto:Kevin.Bedell@;sunlife.com] 
Sent: sexta-feira, 15 de Novembro de 2002 14:07
To: Struts Users Mailing List
Subject: RE: Struts 1.1 and StrutsTestCase





While I am do not know the  exact problem, I have seen similar problems
recently.

They generally have been related to recent changes in the core Struts
ActionServlet for detection and tracking of "modules".

It may be that recent changes in how Struts detects and tracks modules
have not been reflected in the most recent StrutsTestCase.

To resolve this I would recommend reviewing the current source for
servletunit.struts.Common.verifyForwardPath.java  and compare it's
evaluation of the forward path to how the ActionServlet currently tracks
it.

Sorry to not have more -

Kevin

http://www.strutskickstart.com






"Jorge Martins" <[EMAIL PROTECTED]> on 11/15/2002 07:46:12 AM

Please respond to "Struts Users Mailing List"
   <[EMAIL PROTECTED]>

To:"'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc: (bcc: Kevin Bedell/Systems/USHO/SunLife)
Subject:RE: Struts 1.1 and StrutsTestCase


Just tested with the nightly build of struts (20021114) and the CVS HEAD
version of StrutsTestCase...

Got the behaviour I had experienced with Struts 1.1-b2 (but the dynamic
validators are now working!)

In the test method at some point I make a call to
'verifyForward("Sucesso")' which is mapped as follows:


  


This mapping is defined within a sub-application named 'docente', so it
seems Struts is handling well the request, but StrutsTestCase isn't
dealing with the sub-application prefix...

An excerpt from the test's result is below:

Testcase: testSuccessfulCriarSitio took 2,907 sec
 FAILED
was expecting '/index.do' but received '/docente/index.do'
junit.framework.AssertionFailedError: was expecting '/index.do' but
received '/docente/index.do'  at
servletunit.struts.Common.verifyForwardPath(Common.java:171)
 at
servletunit.struts.MockStrutsTestCase.verifyForward(MockStrutsTestCase.j
ava:465)
...

If anyone can shed some light over this issue...

Thanks,
 Jorge



   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group |
http://www.esw.inesc-id.pt/~jorge



-Original Message-
From: Eddie Bush [mailto:ekbush@;swbell.net]
Sent: sexta-feira, 15 de Novembro de 2002 1:38
To: Struts Users Mailing List
Subject: Re: Struts 1.1 and StrutsTestCase


Jorge Martins wrote:

>Hi,
>I'm using a nightly build of struts (20021101) and can't get the 
>StrutsTestCase unit testing framework to work for sub-applications...
>
I think this has been fixed in more recent nightly builds - try a more
recent one, please.

>I've tried using struts 1.1-b2 and the the tests work partially 
>(forwards verification doesn't deal with forwards defined within an 
>action in a sub-application), but the Struts Dynamic Validator doesn't 
>seem to work properly...
>
>Does anyone have these problems? Is there any way of using Dynamic 
>Validators in struts 1.1-b2?
>
It's conceivable that the problems you are experiencing are causing this

other aberrant behavior.  Try a more recent nightly and report back,
please.

>Thanks in advance,
>Jorge
>

--
Eddie Bush



--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@;jakarta.apache.org>








---
This e-mail message (including attachments, if any) is intended for the
use of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt
from disclosure.  If you are not the intended recipient, you are
notified that any dissemination, distribution or copying of this
communication is strictly prohibited.  If you

RE: Struts 1.1 and StrutsTestCase

2002-11-15 Thread Jorge Martins
Just tested with the nightly build of struts (20021114) and the CVS HEAD
version of StrutsTestCase...

Got the behaviour I had experienced with Struts 1.1-b2 (but the dynamic
validators are now working!)

In the test method at some point I make a call to
'verifyForward("Sucesso")' which is mapped as follows:


  


This mapping is defined within a sub-application named 'docente', so it
seems Struts is handling well the request, but StrutsTestCase isn't
dealing with the sub-application prefix...

An excerpt from the test's result is below:

Testcase: testSuccessfulCriarSitio took 2,907 sec
FAILED
was expecting '/index.do' but received '/docente/index.do'
junit.framework.AssertionFailedError: was expecting '/index.do' but
received '/docente/index.do'
at servletunit.struts.Common.verifyForwardPath(Common.java:171)
at
servletunit.struts.MockStrutsTestCase.verifyForward(MockStrutsTestCase.j
ava:465)
...

If anyone can shed some light over this issue...

Thanks,
Jorge

 
________
   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group |
http://www.esw.inesc-id.pt/~jorge



-Original Message-
From: Eddie Bush [mailto:ekbush@;swbell.net] 
Sent: sexta-feira, 15 de Novembro de 2002 1:38
To: Struts Users Mailing List
Subject: Re: Struts 1.1 and StrutsTestCase


Jorge Martins wrote:

>Hi,
>I'm using a nightly build of struts (20021101) and can't get the 
>StrutsTestCase unit testing framework to work for sub-applications...
>
I think this has been fixed in more recent nightly builds - try a more 
recent one, please.

>I've tried using struts 1.1-b2 and the the tests work partially 
>(forwards verification doesn't deal with forwards defined within an 
>action in a sub-application), but the Struts Dynamic Validator doesn't 
>seem to work properly...
>
>Does anyone have these problems? Is there any way of using Dynamic 
>Validators in struts 1.1-b2?
>
It's conceivable that the problems you are experiencing are causing this

other aberrant behavior.  Try a more recent nightly and report back, 
please.

>Thanks in advance,
>Jorge
>

-- 
Eddie Bush



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Struts 1.1 and StrutsTestCase

2002-11-14 Thread Jorge Martins
Hi,
I'm using a nightly build of struts (20021101) and can't get the
StrutsTestCase unit testing framework to work for sub-applications...

I've tried using struts 1.1-b2 and the the tests work partially
(forwards verification doesn't deal with forwards defined within an
action in a sub-application), but the Struts Dynamic Validator doesn't
seem to work properly...

Does anyone have these problems? Is there any way of using Dynamic
Validators in struts 1.1-b2?

Thanks in advance,
Jorge


 
____
   inesc-id   Jorge Martins  | [EMAIL PROTECTED]
lisboaSoftware Engineering Group |
http://www.esw.inesc-id.pt/~jorge




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>