DO NOT REPLY [Bug 8240] New: - Data-Source configuration in examples is outdated

2002-04-18 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8240.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8240

Data-Source configuration in examples is outdated

   Summary: Data-Source configuration in examples is outdated
   Product: Struts
   Version: 1.1 Beta 1
  Platform: PC
OS/Version: Windows NT/2K
Status: NEW
  Severity: Minor
  Priority: Other
 Component: Example
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Hi *,

I just tried to migrate my little toy-application from 1.0.2 to 1.1-b1.
It failed at first, because I used the data-source configuration from the 
struts-blank.war web-app, which is still in old style, i.e.
data-source autoCommit=false, etc. etc.
It should be 
data-source
set-property property=autoCommit value=false/ etc., etc.
as included in the struts-example.war.

Keep up the good work; I really enjoy using your software!

Andreas

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




multipart/form-data (bug?) or intended behavior?

2002-04-18 Thread rob

It's been this way since struts 1.0 (and likely prior to) but http 
requests carrying multipart/form-data posts result in an exception being 
thrown if forwarded through more than one action.

(e.g request flow)

1 - submit multipart/form-data request (with at least one file input)
 request is forwarded to ActionOne.
2 - ActionOne handles multipart data, writes a file to disk does
 something with other parameters etc.  then forwards to ActionTwo.
3 - Exception is thrown.

This occurs in the following versions I've tested 1.0.x, 1.1-b1.  Copies
of the exceptions follow this post.

Workaround, never forward to a second action, always forward to a .jsp
which must be the end point for the request after the first action.
(This kind of sucks).

If this is a bug then consider it submitted, if it's designed this way
then how about changing it?  (pretty please?)

Thanks

Rob


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




html:errors - behavior

2002-04-18 Thread rob

I've done some limited testing but haven't confirmed this entirely. I
also can't find any documentation that says this behavior is intended.

If you save errors in one action, then forward to another action prior
to forwarding to a destination .jsp page the html:errors / tag has
nothing to display.  The errors seem to be lost after the first forward.

(e.g. workflow)

1 - Http request to ActionOne
2 - ActionOne:
* creates ActionErrors instance
* adds new ActionError to ActionErrors instance using
  the ActionErrors.GLOBAL_ERRORS param.
* saveErrors(request, errors) is called.
* request is forwarded to ActionTwo

3 - ActionTwo is a blank action that does nothing except print a line
 to stderr.  Then forwards the request to a .jsp with a
 html:errors / tag.

4 - No errors are displayed.

If instead of forwarding to the second action I forward directly to the
page with the html:errors tag on (effectively jumping over the second
action) the errors appear.

Any insight would be appreciated.

relevant struts versions 1.0.1  1.0.2

Hopefully I am not in error and wasting anyones time with this.


Thanks

Rob


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




RE: multipart/form-data (bug?) or intended behavior?

2002-04-18 Thread Matt Raible

Rob, this is how it works pre-1.1.  1.1b1 has a bug in it and is not
even usable (for me).

In  1.1 you have to add redirect=true to your action forward to
forward to another action.  This is only when using the multi-part
request.  Search the archives for more information.

Matt

 -Original Message-
 From: Jens Viebig [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, April 18, 2002 7:09 AM
 To: Struts Developers List; [EMAIL PROTECTED]
 Subject: Re: multipart/form-data (bug?) or intended behavior?
 
 
 I posted a Patch to this Mailing List a few days ago, but 
 nobody seems to be interested in it. I got an Error in 1.1b 
 even when i just forwarded a Multipart-Request to a 
 JSP-Page.It's a bug in the RequestProcessor
 doForward() Method. There the MultipartRequestWrapper must be 
 unwrapped to a normal HttpServletRequest-Object. See the patch
 
 - Original Message -
 From: rob [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, April 18, 2002 2:47 PM
 Subject: multipart/form-data (bug?) or intended behavior?
 
 
  It's been this way since struts 1.0 (and likely prior to) but http 
  requests carrying multipart/form-data posts result in an exception 
  being thrown if forwarded through more than one action.
 
  (e.g request flow)
 
  1 - submit multipart/form-data request (with at least one 
 file input)
   request is forwarded to ActionOne.
  2 - ActionOne handles multipart data, writes a file to disk does
   something with other parameters etc.  then forwards to 
 ActionTwo. 
  3 - Exception is thrown.
 
  This occurs in the following versions I've tested 1.0.x, 1.1-b1.  
  Copies of the exceptions follow this post.
 
  Workaround, never forward to a second action, always 
 forward to a .jsp 
  which must be the end point for the request after the first action. 
  (This kind of sucks).
 
  If this is a bug then consider it submitted, if it's 
 designed this way 
  then how about changing it?  (pretty please?)
 
  Thanks
 
  Rob
 
 
  --
  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: html:errors - behavior (the exceptions I forgot to attach)

2002-04-18 Thread rob

rob wrote:
 I've done some limited testing but haven't confirmed this entirely. I
 also can't find any documentation that says this behavior is intended.
 
 If you save errors in one action, then forward to another action prior
 to forwarding to a destination .jsp page the html:errors / tag has
 nothing to display.  The errors seem to be lost after the first forward.
 
 (e.g. workflow)
 
 1 - Http request to ActionOne
 2 - ActionOne:
 * creates ActionErrors instance
 * adds new ActionError to ActionErrors instance using
   the ActionErrors.GLOBAL_ERRORS param.
 * saveErrors(request, errors) is called.
 * request is forwarded to ActionTwo
 
 3 - ActionTwo is a blank action that does nothing except print a line
 to stderr.  Then forwards the request to a .jsp with a
 html:errors / tag.
 
 4 - No errors are displayed.
 
 If instead of forwarding to the second action I forward directly to the
 page with the html:errors tag on (effectively jumping over the second
 action) the errors appear.
 
 Any insight would be appreciated.
 
 relevant struts versions 1.0.1  1.0.2
 
 Hopefully I am not in error and wasting anyones time with this.
 
 
 Thanks
 
 Rob
 
 

## struts 1.1-b1 ##

2002-04-18 21:21:37 ApplicationDispatcher[/ims] Servlet.service() for 
servlet action threw exception
javax.servlet.ServletException: Multipart data doesn't start with boundary
 at 
org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMultipartRequestHand
ler.java:103)
 at 
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:908)
 at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:795)
 at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:244)
 at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
 at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
 at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
 at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
 at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:972)
 at 
org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:408)
 at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:269)
 at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
 at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.jav
a:247)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
 at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
 at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
 at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
 at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
 at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
 at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
 at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at 

html:errors - behavior (the exceptions I forgot to attach) - gah

2002-04-18 Thread rob

Notice!

The exceptions that are posted under the html:errors - behavior thread 
were meant to be posted under the multipart/form-data (bug?) or intended 
behavior thread?

My apologies.

Rob


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




RE: Multi-Lingual support

2002-04-18 Thread Yibing Li

Actually without solving this problem, I am thinking the next question:

Usually in the first page, the application can provide a drop-down
list for many different language selection, once it is selected, all the pages
will be shown in that language. How will this feature be included using
struts?

Thanks,

Yibing

-Original Message-
From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
Sent: 2002Äê4ÔÂ18ÈÕ 10:32
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Multi-Lingual support


Sorry my fault, also in ie you can define the locale in your settings
extras-options-languages

-Original Message-
From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 4:29 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Multi-Lingual support


Normally this should work, and your default locale is 
defined by your browser version, e.g german ie germany locale
french ie french locale.

Olli

-Original Message-
From: Yibing Li [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 4:26 PM
To: [EMAIL PROTECTED]; Struts Users Mailing List
Subject: RE: Multi-Lingual support


The resource files all have the same list of the keys but different contents. Right? 
e.g.

  title
  bean:message key=index.title/
/title

In my resource file, there is a line of:

index.title=Testing Struts

In my chinese resource file, there is a line of:
index.title=证实 struts

So is this correct?

Thanks,

Yibing

-Original Message-
From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 10:08 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Multi-Lingual support


Have you implemented the localization on your pages correctly ??
e.g.
bean:message key=blabla/

Are the keys correct to your applicationRessources.properties file ?

Oliver

-Original Message-
From: Yibing Li [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 4:02 PM
To: [EMAIL PROTECTED]
Subject: Multi-Lingual support


Folks,

I thought one major advantage of using struts is its support form
multi-linguage.
We have built an application using Model 2. Since we need to extend the
application to
support 7 different languages, I would like to rewrite the application using
struts.
With my limited knowledge on struts, I was not able to do a proof of
concept. Here is
what I did:

   1. have ApplicationResources.properties as English property file.
   2. prepare a resource file for each language, in the case of Chinese, it
is
  ApplicationResources_zh_CN.properties in the same directory, with the
content
  translated to Chinese
   3. Set init parameter of locale to true for ActionServlet
   4. Start the server
   5. Reset the locale of a computer
   6. Browse the application

However, what I see is still in English.


   Do I miss anything? Please help.

   If you could point to some sample application to demo its multi-lingual
support,
it would be very helpful.



Thanks,



-
Yibing Li, Ph.D.
Technical Architect
Development and Integration
GlobalNetXChange LLC
703-673-2159 (o)
571-436-5592 (c)


--
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]


--
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: Multi-Lingual support

2002-04-18 Thread Greg.Reddin

We did this a long time ago, so I don't remember exactly how it was
done.  But I think we had some code in the action class that would reset
the session locale based on what the user selected.

Greg

 -Original Message-
 From: Yibing Li [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 18, 2002 9:42 AM
 To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
 Subject: RE: Multi-Lingual support
 
 
 Actually without solving this problem, I am thinking the next 
 question:
 
 Usually in the first page, the application can provide a drop-down
 list for many different language selection, once it is 
 selected, all the pages
 will be shown in that language. How will this feature be 
 included using
 struts?
 
 Thanks,
 
 Yibing
 
 -Original Message-
 From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
 Sent: 2002Äê4ÔÂ18ÈÕ 10:32
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: RE: Multi-Lingual support
 
 
 Sorry my fault, also in ie you can define the locale in your settings
 extras-options-languages
 
 -Original Message-
 From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 18, 2002 4:29 PM
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: RE: Multi-Lingual support
 
 
 Normally this should work, and your default locale is 
 defined by your browser version, e.g german ie germany locale
 french ie french locale.
 
 Olli
 
 -Original Message-
 From: Yibing Li [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 18, 2002 4:26 PM
 To: [EMAIL PROTECTED]; Struts Users Mailing List
 Subject: RE: Multi-Lingual support
 
 
 The resource files all have the same list of the keys but 
 different contents. Right? e.g.
 
   title
   bean:message key=index.title/
 /title
 
 In my resource file, there is a line of:
 
 index.title=Testing Struts
 
 In my chinese resource file, there is a line of:
 index.title=证实 struts
 
 So is this correct?
 
 Thanks,
 
 Yibing
 
 -Original Message-
 From: Oliver Reflé [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 18, 2002 10:08 AM
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: RE: Multi-Lingual support
 
 
 Have you implemented the localization on your pages correctly ??
 e.g.
 bean:message key=blabla/
 
 Are the keys correct to your applicationRessources.properties file ?
 
 Oliver
 
 -Original Message-
 From: Yibing Li [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 18, 2002 4:02 PM
 To: [EMAIL PROTECTED]
 Subject: Multi-Lingual support
 
 
 Folks,
 
 I thought one major advantage of using struts is its support form
 multi-linguage.
 We have built an application using Model 2. Since we need to 
 extend the
 application to
 support 7 different languages, I would like to rewrite the 
 application using
 struts.
 With my limited knowledge on struts, I was not able to do a proof of
 concept. Here is
 what I did:
 
1. have ApplicationResources.properties as English property file.
2. prepare a resource file for each language, in the case 
 of Chinese, it
 is
   ApplicationResources_zh_CN.properties in the same 
 directory, with the
 content
   translated to Chinese
3. Set init parameter of locale to true for ActionServlet
4. Start the server
5. Reset the locale of a computer
6. Browse the application
 
 However, what I see is still in English.
 
 
Do I miss anything? Please help.
 
If you could point to some sample application to demo its 
 multi-lingual
 support,
 it would be very helpful.
 
 
 
 Thanks,
 
 
 
 -
 Yibing Li, Ph.D.
 Technical Architect
 Development and Integration
 GlobalNetXChange LLC
 703-673-2159 (o)
 571-436-5592 (c)
 
 
 --
 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]
 
 
 --
 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]
 
 



TILES : Dealing with Channel and contentType

2002-04-18 Thread Manuel Vilar

Hello all of you !

I am new user with struts  tiles !

My question is quite basic :

I want to use tiles channels mechanism to handle two clients medias. html
and vdxml
( vdxml is a french specific media language, but in this example we could
have spoke about wml  instead )

My fisrt web application called page is index.jsp  :
%@ taglib uri=/WEB-INF/tiles.tld prefix=comp %
comp:insert definition=mainLayout flush=false /

I touched the Tiles ChannelFactorySet.java (which extends FactorySet.java)
to select the good channel when
getDefinitionsFactoryKey()  is involved. In the function, if the key is not
defined (channel key) I analyse the request
header user-agent to tell the function which user-agent respective key
to use and to set.

I defined the two component definitions files :
ComponentDefinitions_html.xml
ComponentDefinitions_vdxml.xml

Each definition file contains a  mainLayout definition with the path
setted to the media oriented respective Layout.jsp :

In ComponentDefinitions_html.xml :
definition name=mainLayout path=/html/Layout.jsp
/definition
where /html/Layout.jsp contains :
HTML
...some html code here...
/HTML

In ComponentDefinitions_vdxml.xml :
definition name=mainLayout path=/vdxml/Layout.jsp
/definition

where /html/Layout.jsp contains :
?xml version=1.0 encoding=ISO-8859-1 ?%@ page
contentType=text/vdxml %
!DOCTYPE VDXML SYSTEM C:\J2EE\FlirtDev\vdxml.dtd
VDXML
... some vdxml code here ...
/VDXML

It works fine with html media. ( Internet Explorer )
But with vdxml, the media browser ( vdxml Browser ) indicates that it
received a wrong contentType (text/html ).
Of course it would have received the text/vdxml contentType defined in the
/vdxml/Layout.jsp.

I certainly missed something. Can any one help me ?

Thanks in advance,

Manuel ( A new french developper in J2EE world but an old one in C++ )

P.S.
If you read this, I appologize because of borrowing you with quite novice
question !
You certainly guess that I am not used to English, sorry about that, but I
promise I will practice more !




Manuel Vilar
Service developpement
01 45 15 03 32



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




Re: TILES : Dealing with Channel and contentType

2002-04-18 Thread Cedric Dumoulin


  Hello,

  Look like your contentType directive is not taken into account !
Playing a little bit with the directive, it appear that it is  taken into
account only if set in the first jsp page encountered. In your example, you have
put it in the layout.jsp, which I suppose is inserted from another page (like
index.jsp). So, layout.jsp is your second page encountered ;-( .
  Maybe you can try to use struts action as entry point. Your Struts actions
forward to a definition inserting appropriate layout.jsp.

  Hope this help,

 Cedric

P.S. : Such question may better be asked in struts-user list

Manuel Vilar wrote:

 Hello all of you !

 I am new user with struts  tiles !

 My question is quite basic :

 I want to use tiles channels mechanism to handle two clients medias. html
 and vdxml
 ( vdxml is a french specific media language, but in this example we could
 have spoke about wml  instead )

 My fisrt web application called page is index.jsp  :
 %@ taglib uri=/WEB-INF/tiles.tld prefix=comp %
 comp:insert definition=mainLayout flush=false /

 I touched the Tiles ChannelFactorySet.java (which extends FactorySet.java)
 to select the good channel when
 getDefinitionsFactoryKey()  is involved. In the function, if the key is not
 defined (channel key) I analyse the request
 header user-agent to tell the function which user-agent respective key
 to use and to set.

 I defined the two component definitions files :
 ComponentDefinitions_html.xml
 ComponentDefinitions_vdxml.xml

 Each definition file contains a  mainLayout definition with the path
 setted to the media oriented respective Layout.jsp :

 In ComponentDefinitions_html.xml :
 definition name=mainLayout path=/html/Layout.jsp
 /definition
 where /html/Layout.jsp contains :
 HTML
 ...some html code here...
 /HTML

 In ComponentDefinitions_vdxml.xml :
 definition name=mainLayout path=/vdxml/Layout.jsp
 /definition

 where /html/Layout.jsp contains :
 ?xml version=1.0 encoding=ISO-8859-1 ?%@ page
 contentType=text/vdxml %
 !DOCTYPE VDXML SYSTEM C:\J2EE\FlirtDev\vdxml.dtd
 VDXML
 ... some vdxml code here ...
 /VDXML

 It works fine with html media. ( Internet Explorer )
 But with vdxml, the media browser ( vdxml Browser ) indicates that it
 received a wrong contentType (text/html ).
 Of course it would have received the text/vdxml contentType defined in the
 /vdxml/Layout.jsp.

 I certainly missed something. Can any one help me ?

 Thanks in advance,

 Manuel ( A new french developper in J2EE world but an old one in C++ )

 P.S.
 If you read this, I appologize because of borrowing you with quite novice
 question !
 You certainly guess that I am not used to English, sorry about that, but I
 promise I will practice more !

 Manuel Vilar
 Service developpement
 01 45 15 03 32

 --
 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: multipart/form-data (bug?) or intended behavior?

2002-04-18 Thread Adam P. Jenkins

I believe another workaround is to set the redirect attribute on the forward 
to true.  E.g. the action config for ActionOne would have a local forward 
like this:

forward name=nextaction path=/action2.do redirect=true/

Then in ActionOne, when you return mapping.findForward(nextaction), this 
will cause the struts to send a redirect header to the browser telling it to 
make a new request for action2.  This works fine unless you really wanted 
ActionTwo to have access to the same request attributes and parameters as 
ActionOne.

Adam

On Thursday 18 April 2002 08:47 am, rob wrote:
 It's been this way since struts 1.0 (and likely prior to) but http
 requests carrying multipart/form-data posts result in an exception being
 thrown if forwarded through more than one action.

 (e.g request flow)

 1 - submit multipart/form-data request (with at least one file input)
  request is forwarded to ActionOne.
 2 - ActionOne handles multipart data, writes a file to disk does
  something with other parameters etc.  then forwards to ActionTwo.
 3 - Exception is thrown.

 This occurs in the following versions I've tested 1.0.x, 1.1-b1.  Copies
 of the exceptions follow this post.

 Workaround, never forward to a second action, always forward to a .jsp
 which must be the end point for the request after the first action.
 (This kind of sucks).

 If this is a bug then consider it submitted, if it's designed this way
 then how about changing it?  (pretty please?)

 Thanks

 Rob

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




File Upload button label

2002-04-18 Thread Juan de Castro Paredes

Hi,

 Hi, does anybody know how to change the Submit label on the Submit
button?

 I have tried with:

 html:file property=file value=Go for it/

  but does not change the label at all...

 Thanx in advance,

 Juan


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




RE: File Upload button label

2002-04-18 Thread Matt Raible

Try searching the archives for the Users list in the future, but since
it's easy:

html:submit
bean:message key=submit.label/
/html:submit

You might be thinking for the Browse label on the input type=file
but that's not possible in the current HTML spec.

 -Original Message-
 From: Juan de Castro Paredes [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, April 18, 2002 10:52 AM
 To: Struts Developers List
 Subject: File Upload button label
 
 
 Hi,
 
  Hi, does anybody know how to change the Submit label on 
 the Submit button?
 
  I have tried with:
 
  html:file property=file value=Go for it/
 
   but does not change the label at all...
 
  Thanx in advance,
 
  Juan
 
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-dev- [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: multipart/form-data (bug?) or intended behavior?

2002-04-18 Thread rob

Thats a pretty dirty workaround if your multipart request contained a
5MB file being uploaded.  Or what occurs in that case (when the browser
makes the new request)?

Rob

Adam P. Jenkins wrote:
 I believe another workaround is to set the redirect attribute on the forward 
 to true.  E.g. the action config for ActionOne would have a local forward 
 like this:
 
 forward name=nextaction path=/action2.do redirect=true/
 
 Then in ActionOne, when you return mapping.findForward(nextaction), this 
 will cause the struts to send a redirect header to the browser telling it to 
 make a new request for action2.  This works fine unless you really wanted 
 ActionTwo to have access to the same request attributes and parameters as 
 ActionOne.
 
 Adam
 
 On Thursday 18 April 2002 08:47 am, rob wrote:
 
It's been this way since struts 1.0 (and likely prior to) but http
requests carrying multipart/form-data posts result in an exception being
thrown if forwarded through more than one action.

(e.g request flow)

1 - submit multipart/form-data request (with at least one file input)
 request is forwarded to ActionOne.
2 - ActionOne handles multipart data, writes a file to disk does
 something with other parameters etc.  then forwards to ActionTwo.
3 - Exception is thrown.

This occurs in the following versions I've tested 1.0.x, 1.1-b1.  Copies
of the exceptions follow this post.

Workaround, never forward to a second action, always forward to a .jsp
which must be the end point for the request after the first action.
(This kind of sucks).

If this is a bug then consider it submitted, if it's designed this way
then how about changing it?  (pretty please?)

Thanks

Rob
 
 
 --
 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]




DO NOT REPLY [Bug 8271] New: - multiple servlet-mappings to action servlet don't work as expected

2002-04-18 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8271.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8271

multiple servlet-mappings to action servlet don't work as expected

   Summary: multiple servlet-mappings to action servlet don't work
as expected
   Product: Struts
   Version: 1.1 Beta 1
  Platform: All
OS/Version: All
Status: NEW
  Severity: Enhancement
  Priority: Other
 Component: Documentation
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


The documentation needs to make it VERY clear, probably somewhere in the 
section discussing path mapping (/do/) vs extension mapping (*.do), that the 
use of more than one servlet-mapping to the Struts Action servlet is not 
supported and will either fail outright or work unreliably.

Examples of things not allowed:

!-- can't map more than one path to Struts
in an attempt to convey additional information
or parameters to the mapped action via the URL itself --
servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/do_in_english/*/url-pattern
/servlet-mapping
servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/do_in_spanish/*/url-pattern
/servlet-mapping
servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/do_in_portuguese/*/url-pattern
/servlet-mapping


!-- can't have both path and extension mapped to Struts --
servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/do/*/url-pattern
/servlet-mapping
servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern*.do/url-pattern
/servlet-mapping

attempting to map multiple paths, or simultaneously use path AND extension 
mapping via multiple servlet-mappings in web.xml is not allowed and will not 
work consistently, even though Tomcat will happily accept it and launch the 
Action servlet. Specifically, the behavior of the html:form tag will cause it 
to either generate insidious errors (sending form data to an unintended 
mapping) or fail outright (if the unintended mapping doesn't match a defined 
action-mapping in struts-config.xml)

Concrete example:
I recently attempted to create a multi-lingual web app that used paths to 
convey language (mainly, because the original app I wrote did it that way, and 
I wanted to migrate the old apps to the Struts universe a little at a time 
without breaking URLs on other pages pointing to them).

in web.xml, I created three servlet-mappings for Struts' Action servlet:
/admin/en/*
/admin/es/*
/admin/pt/*

in struts-config.xml, the actions themselves were mapped, including:
/item/view
/item/edit

the net result was that calls to http://localhost/admin/en/item/view and 
http://localhost/admin/es/item/view were properly mapped to the Struts Action 
servlet and didn't generate errors because Struts was able to recognize and 
map /item/view to an action, but the html:form tag on the jsp output template 
used by it whose action attribute was /item/edit inevitably rendered into a 
form tag whose action attribute was /admin/pt/item/edit.

The expected behavior, of course, was that Struts would prepend the servlet-
mapping that launched it (/admin/en or /admin/es) to the action specified 
by the html:form tag. The actual apparent behavior was for the last-defined 
servlet-mapping to be used.

In addition, the documentation needs to stress that Struts does NOT support the 
simultaneous ad-hoc use of BOTH path and extension-mapping (say, while 
migrating from one to the other). In other words, users can NOT create servlet-
mappings to BOTH /do/ and *.do in an effort to migrate from one system to 
the other a little bit at a time. If the user tries, a html:form tag whose 
action=/some_action on a jsp template launched in response to a call 
to http://host/do/some_action; (as well as in struts-config.xml) might 
generate a html form tag whose action attribute is /do/some_action.do, 
which will generate a runtime error since /do/some_action.do is not defined in 
struts-config.xml.

As much as I'd dearly love to make html:form into a scapegoat and recommend 
that it be enhanced to simply implement the expected behavior detailed above, I 
don't know enough about the architecture underlying Struts to know whether this 
is merely an oversight/shortcut bug with the html:form tag, and patching the 
html:form tag would make everything work, or whether it would simply uncover 
another architectural issue elsewhere.

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




ActionServlet re-populates form upon Actoin = Action call

2002-04-18 Thread Terrence Xavier

Dear Struts Developers,

We have noticed some unexpected behavior with Struts. Basically, if
the HTTPRequest specifies attributes to modify in a struts form, they get
modified on EVERY call to the ActionServlet. An example of this is as
follows. Say that we have a JSP that sets a form attribute, and then we
submit to an Action class. From that Action, we modify the same form
attributes, and then forward to another Action. The problem we are seeing is
that the form attributes get re-set upon entry into the second Action, thus
overwriting our changed values in the form from the first Action.
The normal expected behaviour is that we can change the form
attributes in an Action, and then forward to another action and read those
changed values. However, due to how the ActionServlet processes
HTTPRequests, those values will be replaced with the values specified in the
HTTPRequest. Since the parameters in the HTTPRequest are read-only, we
cannot override this functionality.
We have done extensive testing of this bug over the past few days.
We have written a simple project to demonstrate the issue, and have tested
it with Struts 0.5, 1.0.2, and 1.1b1. Each of those versions of Struts
functions the same with regard to this issue.

Here is what is happening in more detail:

The ActionServlet processes the HTTPRequest and populates the form
bean from the parameters in the HTTPRequest. This occurs before
instantiating the Action class to perform. Thus, if we forward from Action
to Action, when the same request is passed by the servlet engine, the form
bean gets populated twice -- before and after the first Action. So form bean
values set within the Action that are also present in the HTTPRequest get
overridden with the values from the HTTPRequest.
Our simple project (attached to this e-mail) demonstrates this.
Here's the flow of that project:


  JSP=Action1  = Action2   =   etc...
   | || | |
   V VV V V
set(x)=2   (x=2)   set(x)=4   (x=2)get(x)=2


In our project, whenever we enter and leave an action, we print out
a string indicating that we are entering or leaving the action. We also have
print statements inside every getter and setter in the form bean that will
tell us whenever anything is retrieved or set in the form. This is the
output we get from our application (with extra a couple comments to help
explain what is going on):

*** startActionOne **START
formAction : setFormAction() originalValue
*** startActionOne **END
+++ One.jsp +
formAction : setFormAction() changedbyOneJSP-- Struts sets the form
bean attribute from JSP.
*** ActionOne **START
formAction : getFormAction() changedbyOneJSP
formAction : setFormAction() changedbyActionOne
*** ActionOne **END
formAction : setFormAction() changedbyOneJSP-- Unexpected behavior
occurs here
*** StartActionTwo **START
formAction : setFormAction() changedbystartActionTwo
*** StartActionTwo **END
+++ Two.jsp + getFormAction() = changedbyOneJSP


It is easy to see why this behaviour would be unexpected. After
explicitly setting the formAction attribute of the form in ActionOne, it
is re-set by Struts before ActionTwo is performed.

Given that this is how Struts functions, our questions are these:

1) We have work-arounds by using session request attributes, but we
would like to set form values in actions. How do we do this within the
Struts framework and have them retain their values?

2) Since Struts seems to process the request twice, setting the form
attributes over and over again for each action that is forwarded to, does it
make sense to change Struts so that it does not do the same work on the same
HTTPRequest object more than once?

3) Is this well-known issue?

We would appreciate any input you can offer.

Sincerely,

Daryl Beattie and Terrence Xavier

P.S. The example code is configured to work with Struts 1.1b1 right now. We
used the same project to test the other versions, but have since changed it
to use 1.1b1. We did not include the jars in our zip file, so if you want to
try it you will have to copy the Struts jars (and its dependent jars) in the
WEB-INF/lib folder.





testStruts1.1b1.zip
Description: Binary data

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


Re: Struts Validator: The Role of Page No.

2002-04-18 Thread Jing Zhou

I am trying to normalize hundreds of screen objects in 
a struts related tool, so when the validator page number
came into the picture, I feel I am not fully understand its 
implications from the perspective of business scenarios.

Basically I think the validator just validate the current
page is *enough* in most of cases for a multi-page
application. The validator could refer to the data
entered in the previous pages when validating the
current page, but it does not need to re-validate the
previous pages. If someone says the data from the
current page may invalidate the data in the previous
pages in his/her application, that could means the
order of page sequence is incorrect in the design.
To make a good design, the rule to follow is very
simple: The current page is validated according
to the data in the current page and the previous pages,
but not the following pages. Could someone
give me a contradiction here? I am probably missing
something when considering this rule.

Another problem with the page number is when
users skip over several pages by choosing
certain check boxes or selections in an application,
should the skipped pages be validated? If yes, the
validator may have to take the burden to distinguish
the situations where the data had been specified 
by users or skipped by users. Is that true?

I hope my question is more clear this time and
someone could offer your judgements and
correct me if you think I am going to make
a fundamental mistake here.

Thanks,

Jing




- Original Message - 
From: Jing Zhou [EMAIL PROTECTED]
To: Struts Developers List [EMAIL PROTECTED]
Sent: Wednesday, April 17, 2002 7:55 PM
Subject: Struts Validator: The Role of Page No.


When looking into the validator codes, the page no. of a wizard
like application is needed for validator to work. It looks to me
that the validator will validate the current page plus all pages
before the current one.

Could someone provide some design thinking as why developers
may need to validate all pages before the current page?
Or this feature is a kind of 'double checking' (or extra checking)
that could be turned on or off in configuration files?

Thanks,
Jing




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




Re: Struts Validator: The Role of Page No.

2002-04-18 Thread David Winterfeldt


--- Jing Zhou [EMAIL PROTECTED] wrote:
 I am trying to normalize hundreds of screen objects
 in 
 a struts related tool, so when the validator page
 number
 came into the picture, I feel I am not fully
 understand its 
 implications from the perspective of business
 scenarios.
 
 Basically I think the validator just validate the
 current
 page is *enough* in most of cases for a multi-page
 application. The validator could refer to the data
 entered in the previous pages when validating the
 current page, but it does not need to re-validate
 the
 previous pages. If someone says the data from the
 current page may invalidate the data in the previous
 pages in his/her application, that could means the
 order of page sequence is incorrect in the design.
 To make a good design, the rule to follow is very
 simple: The current page is validated according
 to the data in the current page and the previous
 pages,
 but not the following pages. Could someone
 give me a contradiction here? I am probably missing
 something when considering this rule.
If the way the page number works doesn't fit your
need, you don't need to use it.  In a linear
multi-page form where the Action keeps forwarding you
to the next page as each form is validated, I think
this behaviour makes sense.

You could use the ValidatorActionForm if you want to
associate your validation rules with an action.  Then
you would have an separate action for each form.

Another alternative is to use the action mapping you
are currently on by extending the ValidatorActionForm
instead of the ValidatorForm. The ValidatorActionForm
uses the action element's 'path' attribute from the
struts-config.xml which should match the form
element's name attribute in the validation.xml. Then a
separate action can be defined for each page in a
multi-page form and the validation rules can be
associated with the action and not a page number as in
the example of a multi-page form in the validator
example.

http://home.earthlink.net/~dwinterfeldt/overview.html

David

 
 Another problem with the page number is when
 users skip over several pages by choosing
 certain check boxes or selections in an application,
 should the skipped pages be validated? If yes, the
 validator may have to take the burden to distinguish
 the situations where the data had been specified 
 by users or skipped by users. Is that true?
 
 I hope my question is more clear this time and
 someone could offer your judgements and
 correct me if you think I am going to make
 a fundamental mistake here.
 
 Thanks,
 
 Jing
 
 
 
 
 - Original Message - 
 From: Jing Zhou [EMAIL PROTECTED]
 To: Struts Developers List
 [EMAIL PROTECTED]
 Sent: Wednesday, April 17, 2002 7:55 PM
 Subject: Struts Validator: The Role of Page No.
 
 
 When looking into the validator codes, the page no.
 of a wizard
 like application is needed for validator to work. It
 looks to me
 that the validator will validate the current page
 plus all pages
 before the current one.
 
 Could someone provide some design thinking as why
 developers
 may need to validate all pages before the current
 page?
 Or this feature is a kind of 'double checking' (or
 extra checking)
 that could be turned on or off in configuration
 files?
 
 Thanks,
 Jing
 
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: Struts Validator: The Role of Page No.

2002-04-18 Thread David Winterfeldt

The page attriubte for a field element is optional.

David

--- Jing Zhou [EMAIL PROTECTED] wrote:
 When looking into the validator codes, the page no.
 of a wizard
 like application is needed for validator to work. It
 looks to me
 that the validator will validate the current page
 plus all pages
 before the current one.
 
 Could someone provide some design thinking as why
 developers
 may need to validate all pages before the current
 page?
 Or this feature is a kind of 'double checking' (or
 extra checking)
 that could be turned on or off in configuration
 files?
 
 Thanks,
 Jing
 
 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: Struts Validator: The Role of Page No.

2002-04-18 Thread Jing Zhou


- Original Message -
From: David Winterfeldt [EMAIL PROTECTED]
To: Struts Developers List [EMAIL PROTECTED]
Sent: Thursday, April 18, 2002 3:33 PM
Subject: Re: Struts Validator: The Role of Page No.



 --- Jing Zhou [EMAIL PROTECTED] wrote:
  I am trying to normalize hundreds of screen objects
  in
  a struts related tool, so when the validator page
  number
  came into the picture, I feel I am not fully
  understand its
  implications from the perspective of business
  scenarios.
 
  Basically I think the validator just validate the
  current
  page is *enough* in most of cases for a multi-page
  application. The validator could refer to the data
  entered in the previous pages when validating the
  current page, but it does not need to re-validate
  the
  previous pages. If someone says the data from the
  current page may invalidate the data in the previous
  pages in his/her application, that could means the
  order of page sequence is incorrect in the design.
  To make a good design, the rule to follow is very
  simple: The current page is validated according
  to the data in the current page and the previous
  pages,
  but not the following pages. Could someone
  give me a contradiction here? I am probably missing
  something when considering this rule.
 If the way the page number works doesn't fit your
 need, you don't need to use it.  In a linear
 multi-page form where the Action keeps forwarding you
 to the next page as each form is validated, I think
 this behaviour makes sense.

It is my understanding that you could treat the multi-page forms
as ONE logical page. So validating everything on this
logical page will make sense.

The challenging constraint I have is that I have to
provide an automatic procedure for non-programming
business users to validate whatever properties they
specify on a view model. The procedure must be
completed within the phase of validation (not reaching
the Action.execute() phase yet.) In order to make things
simple for them, I could not let the business users to
specify another action to perform page validation.

A simple generic automatic procedure is in its early shape,
but I  havn't figure out how to connect it to your validator yet.
The page number bothers me. In your early reply, the
page number is optional, I am really happy with it.

Thanks lot!

Jing


 You could use the ValidatorActionForm if you want to
 associate your validation rules with an action.  Then
 you would have an separate action for each form.

 Another alternative is to use the action mapping you
 are currently on by extending the ValidatorActionForm
 instead of the ValidatorForm. The ValidatorActionForm
 uses the action element's 'path' attribute from the
 struts-config.xml which should match the form
 element's name attribute in the validation.xml. Then a
 separate action can be defined for each page in a
 multi-page form and the validation rules can be
 associated with the action and not a page number as in
 the example of a multi-page form in the validator
 example.

 http://home.earthlink.net/~dwinterfeldt/overview.html

 David

 
  Another problem with the page number is when
  users skip over several pages by choosing
  certain check boxes or selections in an application,
  should the skipped pages be validated? If yes, the
  validator may have to take the burden to distinguish
  the situations where the data had been specified
  by users or skipped by users. Is that true?
 
  I hope my question is more clear this time and
  someone could offer your judgements and
  correct me if you think I am going to make
  a fundamental mistake here.
 
  Thanks,
 
  Jing
 
 
 
 
  - Original Message -
  From: Jing Zhou [EMAIL PROTECTED]
  To: Struts Developers List
  [EMAIL PROTECTED]
  Sent: Wednesday, April 17, 2002 7:55 PM
  Subject: Struts Validator: The Role of Page No.
 
 
  When looking into the validator codes, the page no.
  of a wizard
  like application is needed for validator to work. It
  looks to me
  that the validator will validate the current page
  plus all pages
  before the current one.
 
  Could someone provide some design thinking as why
  developers
  may need to validate all pages before the current
  page?
  Or this feature is a kind of 'double checking' (or
  extra checking)
  that could be turned on or off in configuration
  files?
 
  Thanks,
  Jing
 
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 


 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/

 --
 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: multipart/form-data (bug?) or intended behavior?

2002-04-18 Thread Adam P. Jenkins

Well, in your example scenario, you said that ActionOne first saves the 
multipart data to a file, and then forwards to ActionTwo, so there's no 
problem.  When happens when a redirect forward is returned from an Action is 
as follows:

- Struts sees that the redirect property of the ActionForward is true, so 
instead of just calling the next action in the same request, it sends a 
response back to the browser.  The response contains a Redirect: header which 
contains the URL for ActionTwo.  The browser sees the Redirect header and so 
makes a request for ActionTwo, this time with no multipart/form-data.  The 
new request gets passed by struts directly to ActionTwo.  

Where the above would be a problem is if ActionOne did NOT handle the 
multipart data, but instead forwarded to ActionTwo expecting ActionTwo to 
handle the multipart data.  Since a redirect causes a new request to be made, 
any data in the current request is lost by the time ActionTwo gets called.  
But since in this case ActionOne already handled the request, there's no real 
problem.

Another example of where using a redirect forward is a problem is if your 
action saves some ActionMessages or ActionErrors in the request and then 
forwards, expecting the page being forwarded to to display the messages.  
Since ActionMessages are stored in the request object, if you returned a 
redirect forward from your action, the messages will be lost by the time the 
next page gets the request.

Adam

On Thursday 18 April 2002 01:14 pm, you wrote:
 Thats a pretty dirty workaround if your multipart request contained a
 5MB file being uploaded.  Or what occurs in that case (when the browser
 makes the new request)?

 Rob

 Adam P. Jenkins wrote:
  I believe another workaround is to set the redirect attribute on the
  forward to true.  E.g. the action config for ActionOne would have a local
  forward like this:
 
  forward name=nextaction path=/action2.do redirect=true/
 
  Then in ActionOne, when you return mapping.findForward(nextaction),
  this will cause the struts to send a redirect header to the browser
  telling it to make a new request for action2.  This works fine unless you
  really wanted ActionTwo to have access to the same request attributes and
  parameters as ActionOne.
 
  Adam
 
  On Thursday 18 April 2002 08:47 am, rob wrote:
 It's been this way since struts 1.0 (and likely prior to) but http
 requests carrying multipart/form-data posts result in an exception being
 thrown if forwarded through more than one action.
 
 (e.g request flow)
 
 1 - submit multipart/form-data request (with at least one file input)
  request is forwarded to ActionOne.
 2 - ActionOne handles multipart data, writes a file to disk does
  something with other parameters etc.  then forwards to ActionTwo.
 3 - Exception is thrown.
 
 This occurs in the following versions I've tested 1.0.x, 1.1-b1.  Copies
 of the exceptions follow this post.
 
 Workaround, never forward to a second action, always forward to a .jsp
 which must be the end point for the request after the first action.
 (This kind of sucks).
 
 If this is a bug then consider it submitted, if it's designed this way
 then how about changing it?  (pretty please?)
 
 Thanks
 
 Rob
 
  --
  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]




Jakarta Struts Book Review Project

2002-04-18 Thread Kelvin_Ho


**

Note: This e-mail is subject to the disclaimer contained at the bottom
of this message.

**
:
Hi there,

FYI.

http://www.theserverside.com/resources/strutsreview.jsp

Regards
Kelvin


:


The information transmitted in this message and attachments (if any)
is intended only for the person or entity to which it is addressed.  
The message may contain confidential and/or privileged material.  
Any review, retransmission, dissemination or other use of, or taking 
of any action in reliance upon this information, by persons or entities
other than the intended recipient is prohibited.  

If you have received this in error, please contact the sender and delete this
e-mail and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or
distribute the information contained in this e-mail and any attached files,
with the permission of CGU Insurance.

This message has been scanned for viruses and cleared by MailMarshal.


:

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




Displaying ArrayList of ArrayLists using logic:iterate

2002-04-18 Thread Srinivas Vemula


Hi,

  I would like to use logic:iterate tag to print out an ArrayList of
ArrayLists, Each ArrayList is a ROW from a ResultSet.
  My code snippet looks something like this...

  logic:iterate  id=element name=cataloginfo  indexId=index br
   logic:iterate id=alement name=element  
bean:write name=alement / 
/logic:iterate
/logic:iterate

   * ) catalogInfo is a java.util.ArrayList which has java.util.ArrayList
instances as elements

  When I try to run it it fails with this error 
 javax.servlet.ServletException: Cannot create iterator for this collection
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:463) at org.apache.jsp.Catalog$jsp._jspService(Catalog$jsp.java:712)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 

  IN a Nut Shell, I need to print a ResultSet in a Tabular format using
logic:iterate tag. Any help in this regard will be greatly appreciated.
  Thanks U all for your time and help.

Sri




bug in ConfigRuleSet?

2002-04-18 Thread Colin Sharples

Hi,

I've finally got round to testing 1.1b1 in WebSphere, and I'm having
problems getting started. I've found a problem with ConfigRuleSet, but I'm
not sure if it's a bug or if I've just got the wrong version of something.
I've been updating all of my Jakarta stuff, and I've lost the plot a bit
with what versions of everything I've got :-

Anyway, in ConfigRuleSet, it adds the rule for actions thusly:

digester.addFactoryCreate
(struts-config/action-mappings/action,
 new ActionMappingFactory());

But, in whatever version of digester that I'm using (erm... either 1.1.1 or
the nightly build), FactoryCreateRule.getFactory() only sets the digester
on the factory if it is creating a new instance of the factory. Because
ConfigRuleSet creates the instance of ActionMappingFactory, this means that
setDigester() doesn't get called on the ActionMappingFactory, so it throws
a NPE in createObject().

I would have thought this would have been seen by somebody already, so it
seems to me that I've got the wrong version of something. Anybody any
ideas? The fix is fairly simple if it is a real problem - just change the
addFactoryCreate to use the class name instead of creating an instance.

Regards

Colin M Sharples
I/T Architect
IBM Global Services New Zealand

email: [EMAIL PROTECTED]
phone: 64-4-5769853
mobile: 64-21-402085
fax: 64-4-5765616



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




Re: Displaying ArrayList of ArrayLists using logic:iterate

2002-04-18 Thread Arron Bates

This is a user mailing list kind of issue, but anyways...

What happens when you return the Object[] (myArrayList.toArray()) 
instead of the ArrayList itself?...
Because if you're using Struts 1.0/1.0.1 the ArrayList won't work, but 
the Object[] will. Struts 1.1 can run the ArrayList directly.

You're trying to nest iterate tags, have you considered the nested 
tags?... it really does make light work of this kind of thing.


Arron.


Srinivas Vemula wrote:

Hi,

  I would like to use logic:iterate tag to print out an ArrayList of
ArrayLists, Each ArrayList is a ROW from a ResultSet.
  My code snippet looks something like this...

  logic:iterate  id=element name=cataloginfo  indexId=index br
   logic:iterate id=alement name=element  
   bean:write name=alement / 
/logic:iterate
/logic:iterate

   * ) catalogInfo is a java.util.ArrayList which has java.util.ArrayList
instances as elements

  When I try to run it it fails with this error 
 javax.servlet.ServletException: Cannot create iterator for this collection
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:463) at org.apache.jsp.Catalog$jsp._jspService(Catalog$jsp.java:712)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 

  IN a Nut Shell, I need to print a ResultSet in a Tabular format using
logic:iterate tag. Any help in this regard will be greatly appreciated.
  Thanks U all for your time and help.

Sri





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