RE: Plugins to debug jsp with Eclipse

2003-09-10 Thread Bradley Handy
In regards to the plugins for Eclipse, check out www.myeclipseide.com.  Sweet sets of 
plugins, and only a $30US per year subscription to receive updates and such.
 
Brad
 

-Original Message- 
From: hari_s [mailto:[EMAIL PROTECTED] 
Sent: Tue 9/9/2003 9:05 PM 
To: 'Struts Users Mailing List' 
Cc: 
Subject: RE: Plugins to debug jsp with Eclipse



Setahuku gak ada ya, bagaimana kalo pake oracle jdeveloper itu tool yang
kumplit untuk develop aplikasi dengan teknologi java,dengan debugging
yang bagus pula...

Hai mungkin jawabannya gak memuaskan, tapi ingin Aku nyapa aja sesama
orang Indonesia di milis ini.

-Original Message-
From: Kristanto Oetomo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 5:44 AM
To: 'Struts Users Mailing List'
Subject: Plugins to debug jsp with Eclipse

Does anyone know any plugins to debug jsp in Eclipse? As of now, there
is a plugin to debug jsp after it's being converted into a servlet. I am
looking for a direct debugging tool for the jsp itself. Thanks.

Kristanto Oetomo
Software Engineer

PT Sigma Karya Sempurna (BaliCamp)
Jl. Raya Pacung No. 32A, Baturiti - Tabanan 82191
Bali - Indonesia
Tel: +62 368 21919 Fax: +62 368 21920
http://www.balicamp.com


Favorite Quote: The only stupid question is the one you never ask.
--Anonymous--




-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 1:21 AM
To: Struts Users Mailing List
Subject: Re: Tiles  html-taglib producing XHTML


--- Adam Hardy [EMAIL PROTECTED] wrote:
 Thanks David.

 Sorry, didn't see it and it had never been talked about in the
 archives.

 May I suggest though that it be added to the API docs for html:html at
 http://jakarta.apache.org/struts/userGuide/struts-html.html#html

That would be helpful.  Please open an enhancement request with the
details so it doesn't get forgotten.

David


 Thanks
 Adam


 On 09/09/2003 06:26 PM David Graham wrote:
  Add html:xhtml/ to each of your tiles.  Each page fragment must
 decide
  how it will be rendered, not the containing page.
 
  David
 
  --- Adam Hardy [EMAIL PROTECTED] wrote:
 
 I'm using the struts html taglib, well actually the html-el taglib
 but

 the problem is with both, and I am outputting XHTML, but the input
 taglib doesn't output XHTML when it's in a different Tile.
 
 I have my Tiles layout page with the doctype declaration and the
 
 html:html xhtml=true
 
 and the
 
 tiles:insert attribute=bodyContent /
 
 to include my content.
 
 Anything nested nicely inside the html:html xhtml=true tags in
 the

 layout tile is given proper XHTML syntax, but in the other tiles,
 it's

 not. i.e. instead of:
 
 input type=image name= src=edit.png title=Edit alt=Edit
 /
 
 it gives:
 
 input type=image name= src=edit.png title=Edit alt=Edit
 
 Before I go off to bugzilla, assuming I haven't overlooked something
 important, what is it a bug of? html-taglib or tiles?
 
 Thanks,
 Adam
 
 --
 struts 1.1 + tomcat 4.1.27 + java 1.4.2
 Linux 2.4.20 RH9
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  __
  Do you Yahoo!?
  Yahoo! SiteBuilder - Free, easy-to-use web site design software
  http://sitebuilder.yahoo.com
 
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 --
 struts 1.1 + tomcat 4.1.27 + java 1.4.2
 Linux 2.4.20 RH9


 -
 To 

What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Jing Zhou
As we realize so far, a browser window may send
request A to a server. The server starts thread A
to handle it. Before the thread A returns, the same
window may send request B to the server, therefore
the server creates thread B to handle it.

Assuming thread B finishes earlier than thread A, we
could have the following possibilities:

1) The server waits thread A to finish and send response A
and then send response B. (I do not believe this is the
Tomcat implementation, correct?)

2) The server sends response B back to the browser
window and the browser window displays it and ignores
response A after it.

 3) The browser displays response B and then displays
response A.

What I can see is that thread B is the trouble maker. But it
is possible when end users click more than one buttons.
In Swing, such problems are resolved by Single Thread
Model. Should we follow Single Thread Model at
servers? Are there any other practical solutions to it out
there?


Jing
Netspread Carrier
http://www.netspread.com




help....! it's possible to format date output with bean:write?

2003-09-10 Thread hari_s
it's possible to format date output with bean:write?
Any idea about that ?,it's possible ?


Re: help....! it's possible to format date output with bean:write?

2003-09-10 Thread Firat TIRYAKI
You should make a decleration in the application resources file ;
---
date.format=MM/dd/
---
and use it in jsp bean:write with the parameter formatKey like below

bean:write name=beanName property=dateProperty formatKey=date.format
filter=true /

F.


- Original Message - 
From: hari_s [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 10:49 AM
Subject: help! it's possible to format date output with bean:write?


 it's possible to format date output with bean:write?
 Any idea about that ?,it's possible ?



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



AW: Tiles problem?

2003-09-10 Thread Roland Berger
Well, the tile which is referenced with the attribute billingAddress is
found. The problem starts latter. Again the hole story  in short:

- The code is working with sturts 1.1 beta xy? Sorry I can not find out
which beta it was. Now I use 1.1 final.

- My tiles definitions are in a seprate file -- tiles-defs.xml
- I hava a master layout jsp page where usually only the body part is
changing.
- One of the body tiles is called: let's say 'tile1' referencing a jsp page:
let's say page1
- I have another tile (tile2) referencing page2 which is inserted in tile1

The structure of the pages is as follows (Comments start with ***):

page1 (tile1):

html:form action=/RegisterAddressAction.do
*** RegisterAddressAction.do works with an actionformbean ( lets call it
AFB1 which isdefined in struts-config.xml) which has a getter to get orderFB
nested:nest property=orderFB
  nested:text property=billingEqualShippingAddress /
/nested:nest
*** -- Cedric told me I can not use tiles in a nested context. -- so I
close the nested context before tiles:insert
tiles:insert  attribute=tile2/
/html:form

page2 (tile2):

*** because the information I want to display is in
AFB1--orderFB--orderBean I start to nest again in tile2

 nested:nest property=orderFB
 nested:nest property=orderBean

*** here the problem starts. the property invoiceCompany can not be
displayed because it seems that the AFB1, orderFB or orderBean are not found
in any scope. The error which is displayed here is: [ServletException
in:/WEB-INF/pages/JSPPage2.jsp] Cannot find bean in any scope'

  nested:text property=invoiceCompany size=50 maxlength=50/
  /nested:nest
  /nested:nest


Again, this code is working with beta versions of struts 1.1.

Any hints?

Thank you
Roland



-Ursprüngliche Nachricht-
Von: Yann Lebreton [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 9. September 2003 19:22
An: Struts Users Mailing List
Betreff: RE: Tiles problem?


you could pass it along with the tile.

  tiles:insert attribute=billingAddress 
tiles:put name=billing beanName=.../
  /tiles:insert

or re-access it from whichever scope it was put in.

Yann

-Original Message-
From: Roland Berger [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 8:22 AM
To: Struts
Subject: Tiles problem?


Hi all

I have JSP code which used to work with older struts versions (1.1 beta xy).
Now I use struts 1.1 stable release.

I have  two jsp pages. I want to nest JSPPage2 into JSPPage1 with
tiles:insert ( see JSPCode ). All I get is [ServletException
in:/WEB-INF/pages/JSPPage2.jsp] Cannot find bean in any scope'
With debugging I have found out that JSP Page 2 losses the parent context (I
mean the bean which is assosiated to the /RegisterAddressAction.do action in
struts-config.xml). How can I handle over the parent context to the nested
JSPPage2 tile?


Thanks for any help
Roland

JSPPage1
--
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested %
%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

nested:form action=/RegisterAddressAction.do
nested:nest property=orderFB
table width=100% border=0 cellspacing=1
  tr
td class=subtitlebean:message
key=jsp.registerAddress.title//td
td class=subtitle width=20%html:image
property=method_continueShopping
src=images/16x16/normal/Purchases-txweitereinkaufen.gif
titleKey=common.tooltip.continueShopping
align=absbottom/html:image/td
  /tr
/table
pbean:message key=jsp.registerAddress.text1//p
  span class=kleineSchriftbean:message
key=common.label.mustFields//span/p
p
  nested:checkbox property=billingEqualShippingAddress value=true
/bean:message key=jsp.registerAddress.text2/
/p
  /nested:nest

***
  tiles:insert attribute=billingAddress /
***

  table width=100% border=0 cellspacing=1
  tr
td width=30%nbsp;/td
td width=2%nbsp;/td
tdhtml:image property=method_submitAddresses
src=images/16x16/normal/Forward-2-txweiter.gif
titleKey=common.tooltip.next align=absbottom/html:image/td
  /tr
  /table
  /nested:form
 end JSPPage1


JSPPage2 (is referenced by   tiles:insert attribute=billingAddress /
)
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested %

 nested:nest property=orderFB
 nested:nest property=orderBean
  table width=100% border=0 cellspacing=1
  tr
td colspan=3 class=menubean:message
key=jsp.registerAddress.billingAddressSection.title//td
  /tr
  tr
td width=30%bean:message key=common.label.company//td
td width=2%nbsp;/td
td
  nested:text property=invoiceCompany size=50 maxlength=50/
/td
  /tr
  /table
  /nested:nest
  /nested:nest
---end JSPPage2


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

Indexed Properties problem / what version of struts is compatible ?

2003-09-10 Thread Florent LOTHON
This example from jakarta is it available with 1.02 version of struts ?
My implementation does'nt work.

javax.servlet.ServletException: Exception thrown by getter for property
numeroContratIndexed[0] of bean form2

Example from jakarta http://jakarta.apache.org/struts/faqs/indexedprops.html
:

Indexed Properties

The simplest demonstration of using indexed properties in Struts can be
shown with the following simple bean and JSP page:

package org.apache.struts.webapp.exercise;
import org.apache.struts.action.ActionForm;
public class StringBean extends ActionForm {
private String strAry[] =
{ String 0, String 1, String 2, String 3, String 4 };

public String getStringIndexed(int index) { return (strAry[index]); }
public void setStringIndexed(int index, String value)
{ strAry[index] = value; }
}
First note the two methods in the StringBean class, getStringIndexed() and
setStringIndexed(). Note that the get method takes an int and the
set method takes an int and String. The Beanutils package and Struts
recognizes this arrangement of signatures as an indexed property, in this
case with the property name stringIndexed.

!-- indexedtest.jsp --
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
jsp:useBean id=bean
class=org.apache.struts.webapp.exercise.StringBean/
bean:write name=bean property=stringIndexed[1]/
Note the property value of stringIndexed[1]. This is intended to reference
the indexed property stringIndexed, and the 1st (zero-based) entry of
whatever array or collection which the indexed property represents.

As you might be able to guess, when this page is executed, it will print
just the string String 1, which is the corresponding array entry at that
index value.

This is a simple demonstration of what indexed properties can provide.



--
Ce message est protege par les regles relatives au secret des correspondances ; il 
peut en outre contenir des informations a caractere confidentiel ou protegees par 
differentes regles et notamment le secret des affaires ; il est etabli a destination 
exclusive de son destinataire. Toute divulgation, utilisation, diffusion ou 
reproduction (totale ou partielle) de ce message, ou des informations qu'il contient, 
doit etre prealablement autorisee. 
Tout message electronique est susceptible d'alteration et son integrite ne peut etre 
assuree. Les AGF declinent toute responsabilite au titre de ce message s'il a ete 
modifie ou falsifie. 
Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et 
d'avertir l'expediteur de l'erreur de distribution et de la destruction du message.
This message is protected by the secrecy of correspondence rules ; furthermore it may 
contain privileged or confidential information that is protected by law, notably by 
the secrecy of business relations rule ; it is intended solely for the attention of   
the addressee . Any disclosure, use, dissemination or reproduction (either whole or  
partial) of this message or the information contained herein is strictly prohibited 
without prior consent.
Any electronic message  is susceptible to alteration  and  its integrity can not be 
assured.  AGF declines any  responsibility for  this message in the event of  
alteration  or falsification..
If you are not the intended  recipient, please destroy it immediately and  notify the 
sender of the wrong delivery and the mail deletion. 
--


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



Re: help....! it's possible to format date output with bean:write?

2003-09-10 Thread Ashok.D
Hi Firat,

I have one doubt regarding the same question.

I have a property dateOfBirth of String type.

What type of values I can set to this property, if I used formatKey value.

If I given some entires like 31/12/02, it throws an Exception or it
behaviour in another manner.

My requirement is I have date field, If user enters 10022003, it should
convert into 10/02/2003.

If I given wrong it should promt to user wrong format.

Thanks  Regards,
Ashok.D


- Original Message -
From: Firat TIRYAKI [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 1:30 PM
Subject: Re: help! it's possible to format date output with bean:write?


 You should make a decleration in the application resources file ;
 ---
 date.format=MM/dd/
 ---
 and use it in jsp bean:write with the parameter formatKey like below

 bean:write name=beanName property=dateProperty
formatKey=date.format
 filter=true /

 F.


 - Original Message -
 From: hari_s [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 10:49 AM
 Subject: help! it's possible to format date output with bean:write?


  it's possible to format date output with bean:write?
  Any idea about that ?,it's possible ?
 


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



Question about ActionForm

2003-09-10 Thread harm
Hi all,

I have a J2EE application using struts and JSP to build the view to my 
model.
I have a session facade bean which returns me ValueObject of my beans.
For instance I have a GroupValue object which represents data of my local 
GroupBean.

I made a ActionForm as follows (GroupForm.java):

import nl.xbase.group.value.GroupValue;
import nl.xbase.management.struts.action.BaseForm;

/**
 * @author harm
 * 
 * @struts.form
 *  name = groupForm
 */
public class GroupForm extends BaseForm {
private GroupValue groupValue = new GroupValue();
 
/**
 * @return
 */
public GroupValue getGroupValue() {
return groupValue;
}

/**
 * @param value
 */
public void setGroupValue(GroupValue value) {
groupValue = value;
}

}


I also have an Action which displays all groups. I put them in a 
Collection and return the collection to the JSP.
I use the iterator tag to iterate through those groups as follows:

logic:iterate id=groupValue name=groups property=groups
html:form action=/editgroup.do method=post
html:hidden property=groupId name=groupValue/
bean:write name=groupValue property=groupName/
/html:submit
/html:form
/logic:iterate

As you can see I call /editgroup.do in this form, which expects an 
GroupForm as input.
Therefore I need to set the property groupValue.groupId of the GroupForm.
But I don't know how to do this. The only way I can think of is to include 
a private String id in the GroupForm. But this seems to be redunnant.

Is there some other way? Or what is a good way to tackle this problem?

Many Thanks,

Harm de Laat
Informatiefabriek
The Netherlands



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



RE: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Andrew Hill
My undertsanding was that the browser will only show the response to the the
second of the requests - forgetting about the first. The server of course
hasnt forgetten about it and keeps processing (one hopes). Im not quite sure
what happens to its response stream (null?) but the browser is now only
waiting for the second requests response - which I presume is a seperate
connection?

Now if we are using tokens or some such mechanism to detect that its a
second request and thus illigitimate then we can of course return some kind
of error to the user instead of processing the request (since we know its
already been processed).

This however isnt very friendly. What we really want to do is to have the
second request return the same response as would have been returned by the
first request after it did its work. I have no practical solution for this
:-(

Hmm. Actually I have an idea. Not a good one, but maybe worth a passing
thought:
(Thinking off the top of my head here  btw (and the following will not work
in a distributed environment unless one has sticky sessions so that all
requests for a particular session are gauranteed to be processed by the same
JVM)):

0. Requests A,B,C,N come in in rapid succession and cause threads to be
started in the container to process the requests - probably but not
necessarily in the order they came in.

1. Thread B (or any other thread) is lucky enough to start running first
and. Synchronizing on some global object (probably its own Class object if
its a singleton) it checks the session for a token (under a key that was
generated earlier and submitted as a request param in a hidden field). Not
finding it, it creates it and stores it in the session, and proceeds to
marshall the data needed to render a response - whatever it is the action is
supposed to actually do.

2. Threads A,C,N also sync on the global object and check the session.
Unlike thread B, they find the token, so they all call wait() on the token
object.

3. Having doing the processing  read/updated the db (or whatever), and
obtained the necessary info, etc... Thread B is finally ready to render a
response. It doesnt know however if it is the 'lucky last' thread that the
browser is actually waiting for. What it does then is to add the necessary
information to render the response to the session (perhaps the token could
provide getters for it?), and having done so it calls notifyAll() on the
token object, and then proceeds itself to forward to the view.

4. Threads A,C,N are woken up by the notify(), and proceed to grab the
necessary info from the session to render the same response that B is now
rendering and forward to the view. (NB: we shall assume that the view (jsp
or velocity template or whatever *only* renders the view and doesnt change
any of the information is uses to render the view (with one notable
exception) - and that that info can be read by multiple threads at once!).
One of these 4 threads is the lucky one (N in this example) that will
actually have their response output on the browser. 3 of them are wasting
time rendering to nowhere - but they are all rendering identical html, and
the user will get an appropriate response page instead of an error.

5. After they have finished rendering and flushed the 4 threads all try to
remove the token from the session. (You will note that if another request
comes in at this point we are in trouble. We could of course leave the token
in the session along with all the response data just in case but then we
would run out of memory after a while... (maybe we could use some kind of
self expiring cache? hmmm))

-Original Message-
From: Jing Zhou [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 10 September 2003 15:17
To: Struts Users Mailing List
Subject: What's the best strategy to handle this kind of thread issues?


As we realize so far, a browser window may send
request A to a server. The server starts thread A
to handle it. Before the thread A returns, the same
window may send request B to the server, therefore
the server creates thread B to handle it.

Assuming thread B finishes earlier than thread A, we
could have the following possibilities:

1) The server waits thread A to finish and send response A
and then send response B. (I do not believe this is the
Tomcat implementation, correct?)

2) The server sends response B back to the browser
window and the browser window displays it and ignores
response A after it.

 3) The browser displays response B and then displays
response A.

What I can see is that thread B is the trouble maker. But it
is possible when end users click more than one buttons.
In Swing, such problems are resolved by Single Thread
Model. Should we follow Single Thread Model at
servers? Are there any other practical solutions to it out
there?


Jing
Netspread Carrier
http://www.netspread.com




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

Re: help....! it's possible to format date output with bean:write?

2003-09-10 Thread Firat TIRYAKI
I think you should think about a client side solution, Perfect to use
Javascript here.

F.

- Original Message - 
From: Ashok.D [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 11:12 AM
Subject: Re: help! it's possible to format date output with bean:write?


 Hi Firat,

 I have one doubt regarding the same question.

 I have a property dateOfBirth of String type.

 What type of values I can set to this property, if I used formatKey value.

 If I given some entires like 31/12/02, it throws an Exception or it
 behaviour in another manner.

 My requirement is I have date field, If user enters 10022003, it should
 convert into 10/02/2003.

 If I given wrong it should promt to user wrong format.

 Thanks  Regards,
 Ashok.D


 - Original Message -
 From: Firat TIRYAKI [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 1:30 PM
 Subject: Re: help! it's possible to format date output with
bean:write?


  You should make a decleration in the application resources file ;
  ---
  date.format=MM/dd/
  ---
  and use it in jsp bean:write with the parameter formatKey like below
 
  bean:write name=beanName property=dateProperty
 formatKey=date.format
  filter=true /
 
  F.
 
 
  - Original Message -
  From: hari_s [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, September 10, 2003 10:49 AM
  Subject: help! it's possible to format date output with bean:write?
 
 
   it's possible to format date output with bean:write?
   Any idea about that ?,it's possible ?
  
 
 
  -
  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: Struts-example i18n

2003-09-10 Thread Yoo-Jin Lee
Hi Mitesh,

Are you using html:html?

html:html gets translated to html lang=en or html lang=fr  etc
depending on the person's locale.

Yoo-Jin

-Original Message-
From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED]
Sent: 09 September 2003 20:41
To: [EMAIL PROTECTED]
Subject: Struts-example  i18n


I can successfully run the struts-example app provided with the STRUTS
install on Tomcat in English, however, I would like to be able to view the
i18n capabilities using the 'ja' and 'ru' .properties files.

I have added the 'ja' and 'ru' locales and removed the 'en' locale by
configuring my browser, however, the pages still continue to render in
English.  Are there any additional configurations/changes that I need to
make in order to view these pages in Japanese or Russian?

Thanks in advance.

Mitesh

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



Tr: Indexed Properties problem / what version of struts is compatible ?

2003-09-10 Thread Florent LOTHON
Oups i made a big mistake
there is no more problem
sorry :)

-Message d'origine-
De : Florent LOTHON [EMAIL PROTECTED]
À : Struts Users Mailing List [EMAIL PROTECTED]
Date : mercredi 10 septembre 2003 10:03
Objet : Indexed Properties problem / what version of struts is compatible ?


This example from jakarta is it available with 1.02 version of struts ?
My implementation does'nt work.

javax.servlet.ServletException: Exception thrown by getter for property
numeroContratIndexed[0] of bean form2

Example from jakarta
http://jakarta.apache.org/struts/faqs/indexedprops.html
:

Indexed Properties

The simplest demonstration of using indexed properties in Struts can be
shown with the following simple bean and JSP page:

package org.apache.struts.webapp.exercise;
import org.apache.struts.action.ActionForm;
public class StringBean extends ActionForm {
private String strAry[] =
{ String 0, String 1, String 2, String 3, String 4 };

public String getStringIndexed(int index) { return (strAry[index]); }
public void setStringIndexed(int index, String value)
{ strAry[index] = value; }
}
First note the two methods in the StringBean class, getStringIndexed()
and
setStringIndexed(). Note that the get method takes an int and the
set method takes an int and String. The Beanutils package and Struts
recognizes this arrangement of signatures as an indexed property, in this
case with the property name stringIndexed.

!-- indexedtest.jsp --
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
jsp:useBean id=bean
class=org.apache.struts.webapp.exercise.StringBean/
bean:write name=bean property=stringIndexed[1]/
Note the property value of stringIndexed[1]. This is intended to
reference
the indexed property stringIndexed, and the 1st (zero-based) entry of
whatever array or collection which the indexed property represents.

As you might be able to guess, when this page is executed, it will print
just the string String 1, which is the corresponding array entry at that
index value.

This is a simple demonstration of what indexed properties can provide.



--
Ce message est protege par les regles relatives au secret des
correspondances ; il peut en outre contenir des informations a caractere
confidentiel ou protegees par differentes regles et notamment le secret des
affaires ; il est etabli a destination exclusive de son destinataire. Toute
divulgation, utilisation, diffusion ou reproduction (totale ou partielle) de
ce message, ou des informations qu'il contient, doit etre prealablement
autorisee.
Tout message electronique est susceptible d'alteration et son integrite ne
peut etre assuree. Les AGF declinent toute responsabilite au titre de ce
message s'il a ete modifie ou falsifie.
Si vous n'etes pas destinataire de ce message, merci de le detruire
immediatement et d'avertir l'expediteur de l'erreur de distribution et de la
destruction du message.
This message is protected by the secrecy of correspondence rules ;
furthermore it may contain privileged or confidential information that is
protected by law, notably by the secrecy of business relations rule ; it is
intended solely for the attention of   the addressee . Any disclosure, use,
dissemination or reproduction (either whole or  partial) of this message or
the information contained herein is strictly prohibited without prior
consent.
Any electronic message  is susceptible to alteration  and  its integrity
can not be assured.  AGF declines any  responsibility for  this message in
the event of  alteration  or falsification..
If you are not the intended  recipient, please destroy it immediately and
notify the sender of the wrong delivery and the mail deletion.
--


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




--
Ce message est protege par les regles relatives au secret des correspondances ; il 
peut en outre contenir des informations a caractere confidentiel ou protegees par 
differentes regles et notamment le secret des affaires ; il est etabli a destination 
exclusive de son destinataire. Toute divulgation, utilisation, diffusion ou 
reproduction (totale ou partielle) de ce message, ou des informations qu'il contient, 
doit etre prealablement autorisee. 
Tout message electronique est susceptible d'alteration et son integrite ne peut etre 
assuree. Les AGF declinent toute responsabilite au titre de ce message s'il a ete 
modifie ou falsifie. 
Si vous n'etes pas destinataire de ce message, merci de le detruire immediatement et 
d'avertir l'expediteur de l'erreur de distribution et de la destruction du message.
This message is protected by the secrecy of correspondence rules ; furthermore it may 
contain privileged or confidential information that is protected by law, notably by 
the secrecy of business relations rule ; it is intended solely for the 

What's the best way to do calculations ?

2003-09-10 Thread Rouven Gehm
Hi,

well i just wonder, in which class i should do my calculations.
E.g. : 
 I have a JSP, where i have a form for input values, and output values.
Now i can do the math within the validate Method of the according 
ActionForm, or i do it in the execute Method of the Action where i have
access to the form too.
Or is there a third way, to do it ?

Esp. whats the best way, if i have to get values from various ActionForms
for my calculations ?

Thanx

Rouven


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



Could not find Java 1.4 encode method. Using deprecated version.

2003-09-10 Thread Puneet Agarwal
I get the following error. I searched in the mail-archives
and found that I am not the first one to encounter this problem.
But I was unable to find the solution to this.

Would be great if someone could help me on this.



18   2003-09-10 06:01:41,129
org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:162) DEBUG
[] - Could not find Java 1.4
encode method.  Using deprecated version.
java.lang.NoSuchMethodException
at java.lang.Class.getMethod0(Native Method)
at java.lang.Class.getMethod(Unknown Source)
at
org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:160)
at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.tiger.inf.struts.ActionServlet.init(ActionServlet.java:30)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1956)
at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4355)
at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2484)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:617)
at
com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at
com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
at java.lang.Thread.run(Unknown Source)

Regards,
Puneet Agarwal

Tata Consultancy Services,
C-56, Phase - II, NOIDA 201305 (India)
Phone: +91-120-2461001, 2, 7, 8, 9, 12, 13 (Ext. 1044)
FAX              : +91-120-246 1521

Struts ... Action ... Struts in Action ... Action in Struts ...
DISCLAIMER: The information contained in this message is intended only and
solely for the addressed individual or entity indicated in this message and
for the exclusive use of the said addressed individual or entity indicated
in this message (or responsible for delivery of the message to such person)
and may contain legally privileged and confidential information belonging
to Tata Consultancy Services. It must not be printed, read, copied,
disclosed, forwarded, distributed or used (in whatsoever manner) by any
person other than the addressee. Unauthorized use, disclosure or copying is
strictly prohibited and may constitute unlawful act and can possibly
attract legal action, civil and/or criminal. The contents of this message
need not necessarily reflect or endorse the views of Tata Consultancy
Services on any subject matter. Any action taken or omitted to be taken
based on this message is entirely at your risk and neither the originator
of this message nor Tata Consultancy Services takes any responsibility or
liability towards the same. Opinions, conclusions and any other information
contained in this message that do not relate to the official business of
Tata Consultancy Services shall be understood as neither given nor endorsed
by Tata Consultancy Services or any affiliate of Tata Consultancy Services.
If you have received this message in error, you should destroy this message
and may please notify the sender by e-mail. Thank you.


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



Re: Could not find Java 1.4 encode method. Using deprecated version.

2003-09-10 Thread Kwok Peng Tuck
That's very strange, what version of JDK are you using and what's the 
version of struts too ?

Puneet Agarwal wrote:

I get the following error. I searched in the mail-archives
and found that I am not the first one to encounter this problem.
But I was unable to find the solution to this.
Would be great if someone could help me on this.



18   2003-09-10 06:01:41,129
org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:162) DEBUG
[] - Could not find Java 1.4
encode method.  Using deprecated version.
java.lang.NoSuchMethodException
   at java.lang.Class.getMethod0(Native Method)
   at java.lang.Class.getMethod(Unknown Source)
   at
org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:160)
   at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
   at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
   at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
   at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
   at javax.servlet.GenericServlet.init(GenericServlet.java:258)
   at com.tiger.inf.struts.ActionServlet.init(ActionServlet.java:30)
   at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1956)
   at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4355)
   at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2484)
   at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:617)
   at
com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
   at
com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
   at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
   at java.lang.Thread.run(Unknown Source)
Regards,
Puneet Agarwal
Tata Consultancy Services,
C-56, Phase - II, NOIDA 201305 (India)
Phone: +91-120-2461001, 2, 7, 8, 9, 12, 13 (Ext. 1044)
FAX  : +91-120-246 1521
Struts ... Action ... Struts in Action ... Action in Struts ...
DISCLAIMER: The information contained in this message is intended only and
solely for the addressed individual or entity indicated in this message and
for the exclusive use of the said addressed individual or entity indicated
in this message (or responsible for delivery of the message to such person)
and may contain legally privileged and confidential information belonging
to Tata Consultancy Services. It must not be printed, read, copied,
disclosed, forwarded, distributed or used (in whatsoever manner) by any
person other than the addressee. Unauthorized use, disclosure or copying is
strictly prohibited and may constitute unlawful act and can possibly
attract legal action, civil and/or criminal. The contents of this message
need not necessarily reflect or endorse the views of Tata Consultancy
Services on any subject matter. Any action taken or omitted to be taken
based on this message is entirely at your risk and neither the originator
of this message nor Tata Consultancy Services takes any responsibility or
liability towards the same. Opinions, conclusions and any other information
contained in this message that do not relate to the official business of
Tata Consultancy Services shall be understood as neither given nor endorsed
by Tata Consultancy Services or any affiliate of Tata Consultancy Services.
If you have received this message in error, you should destroy this message
and may please notify the sender by e-mail. Thank you.
-
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: Could not find Java 1.4 encode method. Using deprecated version.

2003-09-10 Thread Puneet Agarwal

I am using JDK 1.3, but this has got nothing to do with that.
This problem was fixed in Mar 2003 itself.

Check this

http://www.mail-archive.com/[EMAIL PROTECTED]/msg14289.html

I was hoping that since I am using Struts 1.1 I should not encounter this
problem.

Regards,
Puneet Agarwal

Tata Consultancy Services,
C-56, Phase - II, NOIDA 201305 (India)
Phone: +91-120-2461001, 2, 7, 8, 9, 12, 13 (Ext. 1044)
FAX              : +91-120-246 1521

Struts ... Action ... Struts in Action ... Action in Struts ...


   

Kwok Peng  

Tuck To: Struts Users Mailing List [EMAIL 
PROTECTED]
[EMAIL PROTECTED]cc:  
 
mal.net Subject: Re: Could not find Java 1.4 
encode method.  Using deprecated 
 version.  

09/10/03   

03:50 PM   

Please 

respond to 

Struts Users  

Mailing List  

   

   





That's very strange, what version of JDK are you using and what's the
version of struts too ?


Puneet Agarwal wrote:

I get the following error. I searched in the mail-archives
and found that I am not the first one to encounter this problem.
But I was unable to find the solution to this.

Would be great if someone could help me on this.



18   2003-09-10 06:01:41,129
org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:162) DEBUG
[] - Could not find Java 1.4
encode method.  Using deprecated version.
java.lang.NoSuchMethodException
at java.lang.Class.getMethod0(Native Method)
at java.lang.Class.getMethod(Unknown Source)
at
org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:160)
at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)

at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)

at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)

at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.tiger.inf.struts.ActionServlet.init(ActionServlet.java:30)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1956)

at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4355)

at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2484)

at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:617)

at
com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at
com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)

at java.lang.Thread.run(Unknown Source)

Regards,
Puneet Agarwal

Tata Consultancy Services,
C-56, Phase - II, NOIDA 201305 (India)
Phone: +91-120-2461001, 2, 7, 8, 9, 12, 13 (Ext. 1044)
FAX  : +91-120-246 1521

Struts ... Action ... Struts in Action ... Action in Struts ...
DISCLAIMER: The information contained in this message is intended only and
solely for the addressed individual or entity indicated in this message
and
for the exclusive use of the said addressed individual or entity indicated
in this message (or responsible for delivery of the message to such
person)
and may contain legally privileged and confidential information belonging
to Tata Consultancy Services. It must not be printed, read, copied,
disclosed, forwarded, distributed or used (in whatsoever manner) by any
person other than the addressee. Unauthorized use, disclosure or copying
is
strictly prohibited and may constitute unlawful act and can possibly

RE: deployement issue

2003-09-10 Thread michel Van Asten
Hi,

OS : Windows 2000 on both servers
ServletExec : 4.2 on both servers
JDK : 1.4.1 on both servers
Struts : 1.1 rc2 on both servers
...
but the application run correctly only on test server !!!

Michel



-Message d'origine-
De : Robert Taylor [mailto:[EMAIL PROTECTED]
Envoyé : mardi 9 septembre 2003 16:22
À : Struts Users Mailing List
Objet : RE: deployement issue


Michel, what version of ServletExec are you running?
What's your environment(JDK, OS, etc...)? Is the problem occurring on
both production and test servers? What version of Struts are you using?

robert

 -Original Message-
 From: michel Van Asten [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 09, 2003 9:43 AM
 To: Struts Users Mailing List
 Subject: TR: deployement issue




 -Message d'origine-
 De : michel Van Asten [mailto:[EMAIL PROTECTED]
 Envoyé : mardi 9 septembre 2003 14:50
 À : Struts Users Mailing List
 Objet : RE: deployement issue


 Indeed the code is coming from my JSP...

 In attachement the error page

 Regards,

 Michel Van Asten

 -Message d'origine-
 De : Adam Levine [mailto:[EMAIL PROTECTED]
 Envoyé : mardi 9 septembre 2003 13:59
 À : [EMAIL PROTECTED]
 Objet : Re: deployement issue


 i lost my personal psychic friend license last year.


 Just like a doctor can't diagnose your ailments over the phone, we can't
 help you very easily without knowing what problem you're seeing.

 What errors are you getting?
 It looks like the code snippet you pasted is from the javacode generated
 from your jsp.  What does the relevant JSP snippet look like ?

 the more info you can provide, the better.


 From: michel Van Asten [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: deployement issue
 Date: Tue, 9 Sep 2003 12:52:17 +0200

 Hi,

 I got errors when I try to run my application on the production server (I
 use servletExec for development and production system)

 Error happens here :

 ...
 bean_message_tag1.setKey( index.title );
 bean_message_result1 = bean_message_tag1.doStartTag();
 
 ...

 And seems to be generated in the RetrieveMessageRessources ...

 Note
 1° that the resource file is located at the same place on both system and
 that I use the same WEB.xml and strut-config.xml files
 2° Other applications are running with servletExec on the production
 system...

 Any help is welcomed,

 Regards,

 Michel Van Asten



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

 _
 Express yourself with MSN Messenger 6.0 -- download now!
 http://www.msnmessenger-download.com/tracking/reach_general


 -
 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: problem in getproperties.

2003-09-10 Thread deepaksawdekar
Thanks for the response. 
by this code

MessageResources.getMessageResources(propertyFilePath);
rtnString = messages.getMessage(key);

Since I have added a utility class for getting the property. Will this create any 
problem in future.



-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 8:29 PM
To: Struts Users Mailing List
Subject: RE: problem in getproperties.


and before you opened my post Im sure ;-

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 9 September 2003 22:51
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: problem in getproperties.


I thought about that, Andrew  After I hit send, of course.  :-)

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 10:36 AM
To: Struts Users Mailing List
Subject: RE: problem in getproperties.


Maybe thats not the particular property file he is trying to load?

Try using

getServlet().getServletContext().getResourceAsStream( propertyFilePath );

In your actions execute method.

snip src=javadocs
This method is different from java.lang.Class.getResourceAsStream, which
uses a class loader. This method allows servlet containers to make a
resource available to a servlet from any location, without using a class
loader.
/snip

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 9 September 2003 22:23
To: Struts Users Mailing List
Subject: RE: problem in getproperties.


Why are you creating a new I/O object when the execute method gets the
resource passed as a parameter argument?

MessageResources properties = getResources( request );
properties.getProperty( key );

Mark

-Original Message-
From: deepaksawdekar [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 8:58 AM
To: Struts Users Mailing List
Subject: problem in getproperties.


I am using following code to access the property from properties file in my
action class.
Code snippet is as follows...
..
InputStream in = ClassLoader.getSystemResourceAsStream( propertyFilePath);
properties.load(in);
value = properties.getProperty(key);


When I write the main in action class it works fine
but when i copied the same code to execute method, the code does not load
the propertyfilepath file properly even though in both the case class path
and location of file is same.

Am i doing something wrong.


Deepak

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


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



getproperty for html:options tag returns null.

2003-09-10 Thread deepaksawdekar
I am using following code in  a jsp,

html:select property=location styleClass=TextBox size=1
html:options property=locationListValues /html:options
/html:select

when getLocationListValues return Null i got the error page saying 
getlocationlistvalues return null and so so... I this there any way where i can catch 
this exception, and show some customize error page, Or is there a way where i can show 
the empty dropdown box


Thanks and Regards
Deepak.

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



Re: What's the best way to do calculations ?

2003-09-10 Thread Jeff Kyser
Depends on your calculations.

I wouldn't do anything more than confirm proper data types
with validation - required fields are provided and of the
right type, etc.
If it is a trivial calculation that isn't used anywhere else,
then  you could do it in your Action's execute(),
but if it is a reusable calculation like loan payment
amount given a principal and number of months, etc.,
it sounds more like reusable business logic that should
be in a model object called by your Action's execute.
-jeff

On Wednesday, September 10, 2003, at 04:32  AM, Rouven Gehm wrote:

Hi,

well i just wonder, in which class i should do my calculations.
E.g. :
 I have a JSP, where i have a form for input values, and output values.
Now i can do the math within the validate Method of the according
ActionForm, or i do it in the execute Method of the Action where i have
access to the form too.
Or is there a third way, to do it ?
Esp. whats the best way, if i have to get values from various 
ActionForms
for my calculations ?

Thanx

Rouven

-
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: getproperty for html:options tag returns null.

2003-09-10 Thread harm
You can always check if its empty with the logic:empty tag.

Good luck,

Harm.





deepaksawdekar [EMAIL PROTECTED] 
09/10/2003 01:26 PM
Please respond to
Struts Users Mailing List [EMAIL PROTECTED]


To
Struts Users Mailing List [EMAIL PROTECTED]
cc

Subject
getproperty for html:options  tag returns null.






I am using following code in  a jsp,

html:select property=location styleClass=TextBox size=1
 html:options property=locationListValues 
/html:options
/html:select

when getLocationListValues return Null i got the error page saying 
getlocationlistvalues return null and so so... I this there any way where 
i can catch this exception, and show some customize error page, Or is 
there a way where i can show the empty dropdown box


Thanks and Regards
Deepak.

-
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: What's the best way to do calculations ?

2003-09-10 Thread harm
I think it should be best to keep as much business logic out of your 
actions. This helps you to decouple you application logic from it's 
presentation layer.
So, if you have to do some business specific calculations it would be best 
to perform them in some business logic class, like a Enterprise Java Bean.

Cheers,

Harm.




Jeff Kyser [EMAIL PROTECTED] 
09/10/2003 01:35 PM
Please respond to
Struts Users Mailing List [EMAIL PROTECTED]


To
Struts Users Mailing List [EMAIL PROTECTED]
cc

Subject
Re: What's the best way to do calculations ?






Depends on your calculations.

I wouldn't do anything more than confirm proper data types
with validation - required fields are provided and of the
right type, etc.

If it is a trivial calculation that isn't used anywhere else,
then  you could do it in your Action's execute(),

but if it is a reusable calculation like loan payment
amount given a principal and number of months, etc.,
it sounds more like reusable business logic that should
be in a model object called by your Action's execute.

-jeff

On Wednesday, September 10, 2003, at 04:32  AM, Rouven Gehm wrote:

 Hi,

 well i just wonder, in which class i should do my calculations.
 E.g. :
  I have a JSP, where i have a form for input values, and output values.
 Now i can do the math within the validate Method of the according
 ActionForm, or i do it in the execute Method of the Action where i have
 access to the form too.
 Or is there a third way, to do it ?

 Esp. whats the best way, if i have to get values from various 
 ActionForms
 for my calculations ?

 Thanx

 Rouven


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



dependant drop down list box

2003-09-10 Thread Pramod . P

Can any one please tell me the best way to populating the drop down list box?
The scenario is the second drop down box depends on the value selected on the first 
drop down box.
How can we change the items of the second drop down list. The values are there in the 
request
object. But, how can I use this value?

Thanks,
Pramod


This  electronic  mail  message  is  intended  solely  for  the  named  recipients  
and  may contain
confidential  and  proprietary  business information of eFunds Corporation and all its 
subsidiaries.
If  you  are  not a named recipient, please notify the sender immediately.  You may 
not disclose the
contents  to  any  other  person;  use  this  electronic  mail message or its contents 
for any other
purpose; or further store or copy its contents in any medium



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



Re: dependant drop down list box

2003-09-10 Thread harm
If you already have it in the request object, you might want to consider 
using javascript.
Maybe you can put the values of you second dropdown list in a html:hidden 
component.
Then use javascript to populate the second dropdownlist whenever the user 
changes the first one.





[EMAIL PROTECTED] 
09/10/2003 01:55 PM
Please respond to
Struts Users Mailing List [EMAIL PROTECTED]


To
Struts Users Mailing List [EMAIL PROTECTED]
cc

Subject
dependant drop down list box







Can any one please tell me the best way to populating the drop down list 
box?
The scenario is the second drop down box depends on the value selected on 
the first drop down box.
How can we change the items of the second drop down list. The values are 
there in the request
object. But, how can I use this value?

Thanks,
Pramod


This  electronic  mail  message  is  intended  solely  for  the  named 
recipients  and  may contain
confidential  and  proprietary  business information of eFunds Corporation 
and all its subsidiaries.
If  you  are  not a named recipient, please notify the sender immediately. 
 You may not disclose the
contents  to  any  other  person;  use  this  electronic  mail message or 
its contents for any other
purpose; or further store or copy its contents in any medium



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



Cannot find bean viewcontactlist in scope request

2003-09-10 Thread Mehran Zonouzi
I am getting this error message when my JSP page first loads up.

Cannot find bean viewcontactlist in scope request


I am using a link to call my ActionForm class( as below):

 html:link action=contact.do paramId=page paramName=viewcontactlist 
paramScope=request/html:link

My ActinForm is called ContactForm and I want to call it using a param called 'page' 
with the initial value of 'viewcontactlist'
to it.

Can anyone help me with the syntax plz?


--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



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



RE: help....! it's possible to format date output with bean:write ?

2003-09-10 Thread Slattery, Tim - BLS
 it's possible to format date output with bean:write?
 Any idea about that ?,it's possible ?

Not with bean:write ..., no. But look at JSTL's fmt:formatDate ...  tag.

--
Tim Slattery
[EMAIL PROTECTED]


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



Re: Could not find Java 1.4 encode method. Using deprecated version.

2003-09-10 Thread David Graham
--- Puneet Agarwal [EMAIL PROTECTED] wrote:
 I get the following error. I searched in the mail-archives
 and found that I am not the first one to encounter this problem.
 But I was unable to find the solution to this.
 
 Would be great if someone could help me on this.

This is not an error.  Struts tries to use the encode method only
available since Java 1.4.  If it fails, it falls back to the deprecated
version from Java 1.3.

David

 
 
 
 18   2003-09-10 06:01:41,129
 org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:162)
 DEBUG
 [] - Could not find Java 1.4
 encode method.  Using deprecated version.
 java.lang.NoSuchMethodException
 at java.lang.Class.getMethod0(Native Method)
 at java.lang.Class.getMethod(Unknown Source)
 at
 org.apache.struts.util.RequestUtils.clinit(RequestUtils.java:160)
 at

org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
 at

org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
 at

org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
 at
 org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
 at javax.servlet.GenericServlet.init(GenericServlet.java:258)
 at
 com.tiger.inf.struts.ActionServlet.init(ActionServlet.java:30)
 at

com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:1956)
 at

com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4355)
 at

com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2484)
 at

com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:617)
 at

com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
 at

com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
 at

EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
 at java.lang.Thread.run(Unknown Source)
 
 Regards,
 Puneet Agarwal
 
 Tata Consultancy Services,
 C-56, Phase - II, NOIDA 201305 (India)
 Phone: +91-120-2461001, 2, 7, 8, 9, 12, 13 (Ext. 1044)
 FAX              : +91-120-246 1521
 
 Struts ... Action ... Struts in Action ... Action in Struts ...
 DISCLAIMER: The information contained in this message is intended only
 and
 solely for the addressed individual or entity indicated in this message
 and
 for the exclusive use of the said addressed individual or entity
 indicated
 in this message (or responsible for delivery of the message to such
 person)
 and may contain legally privileged and confidential information
 belonging
 to Tata Consultancy Services. It must not be printed, read, copied,
 disclosed, forwarded, distributed or used (in whatsoever manner) by any
 person other than the addressee. Unauthorized use, disclosure or copying
 is
 strictly prohibited and may constitute unlawful act and can possibly
 attract legal action, civil and/or criminal. The contents of this
 message
 need not necessarily reflect or endorse the views of Tata Consultancy
 Services on any subject matter. Any action taken or omitted to be taken
 based on this message is entirely at your risk and neither the
 originator
 of this message nor Tata Consultancy Services takes any responsibility
 or
 liability towards the same. Opinions, conclusions and any other
 information
 contained in this message that do not relate to the official business of
 Tata Consultancy Services shall be understood as neither given nor
 endorsed
 by Tata Consultancy Services or any affiliate of Tata Consultancy
 Services.
 If you have received this message in error, you should destroy this
 message
 and may please notify the sender by e-mail. Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: What's a well defined Struts Project Structure?

2003-09-10 Thread Mainguy, Mike
I'm kinda in the middle of this whole process too and this is what I'm
leaning toward

MyProject   
  |- source(doesn't get deployed)
  |- documentation (doesn't get deployed)
  |- static (webserver stuff)
|- styles
|- javascript
|- images
  |- WEB-INF
|- pages -tiles (jsp) content pages 
|- templates -tiles (jsp) templates  
  |- classes  
|- tld
struts-config.xml
*-config.xml

I would say also that you could potentially have many subdirectories under
the pages/templates directories to reflect the complexity of your app...

i.e.

|- pages
 |- employeeScreens
 |- payrollScreens
 |- accountsPayableScreens


-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 08, 2003 12:37 PM
To: 'Struts Users Mailing List'
Subject: What's a well defined Struts Project Structure?


What a well defined struts project structure would look like?  I am always a
bit
hesitant with where to put things

Right now, I have:

MyProject   
  |- documentation
  |- images
  |- jsps
|- styles
|- javascript
  |- WEB-INF
  |- classes
  |- bin
struts-config.xml
  *.tld
  project.xml
  ...

But I always run into problems with too many files in one folder or too few
files in one folder.  I searched the apache CVS tree, and found that it's a
mess
there too.  Just compare Tomcat and Struts, you will know what I am talking
about.

Thanks!


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


This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



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



RE: deployement issue

2003-09-10 Thread Robert Taylor
Try creating a simple web application with a single page using the
html:message .../. Run the web application on both systems and see
what happens.

Also, are the contents of the classpath for both systems
exactly the same? The fact is, something must be different if the web
app runs properly in one environment and not on the other.

Let me know what happens with the test web app. I know it may be a
pain to do, but it removes extraneous complexities and helps focus
in on the exact problem.

Its easy to create a simple web app using ServletExecs admin ui.
Let me know if you need help on how to do this.

robert

 -Original Message-
 From: michel Van Asten [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 7:20 AM
 To: Struts Users Mailing List
 Subject: RE: deployement issue


 Hi,

 OS : Windows 2000 on both servers
 ServletExec : 4.2 on both servers
 JDK : 1.4.1 on both servers
 Struts : 1.1 rc2 on both servers
 ...
 but the application run correctly only on test server !!!

 Michel



 -Message d'origine-
 De : Robert Taylor [mailto:[EMAIL PROTECTED]
 Envoyé : mardi 9 septembre 2003 16:22
 À : Struts Users Mailing List
 Objet : RE: deployement issue


 Michel, what version of ServletExec are you running?
 What's your environment(JDK, OS, etc...)? Is the problem occurring on
 both production and test servers? What version of Struts are you using?

 robert

  -Original Message-
  From: michel Van Asten [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, September 09, 2003 9:43 AM
  To: Struts Users Mailing List
  Subject: TR: deployement issue
 
 
 
 
  -Message d'origine-
  De : michel Van Asten [mailto:[EMAIL PROTECTED]
  Envoyé : mardi 9 septembre 2003 14:50
  À : Struts Users Mailing List
  Objet : RE: deployement issue
 
 
  Indeed the code is coming from my JSP...
 
  In attachement the error page
 
  Regards,
 
  Michel Van Asten
 
  -Message d'origine-
  De : Adam Levine [mailto:[EMAIL PROTECTED]
  Envoyé : mardi 9 septembre 2003 13:59
  À : [EMAIL PROTECTED]
  Objet : Re: deployement issue
 
 
  i lost my personal psychic friend license last year.
 
 
  Just like a doctor can't diagnose your ailments over the phone, we can't
  help you very easily without knowing what problem you're seeing.
 
  What errors are you getting?
  It looks like the code snippet you pasted is from the javacode generated
  from your jsp.  What does the relevant JSP snippet look like ?
 
  the more info you can provide, the better.
 
 
  From: michel Van Asten [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: deployement issue
  Date: Tue, 9 Sep 2003 12:52:17 +0200
 
  Hi,
 
  I got errors when I try to run my application on the production
 server (I
  use servletExec for development and production system)
 
  Error happens here :
 
  ...
  bean_message_tag1.setKey( index.title );
  bean_message_result1 = bean_message_tag1.doStartTag();
  
  ...
 
  And seems to be generated in the RetrieveMessageRessources ...
 
  Note
  1° that the resource file is located at the same place on both
 system and
  that I use the same WEB.xml and strut-config.xml files
  2° Other applications are running with servletExec on the production
  system...
 
  Any help is welcomed,
 
  Regards,
 
  Michel Van Asten
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  _
  Express yourself with MSN Messenger 6.0 -- download now!
  http://www.msnmessenger-download.com/tracking/reach_general
 
 
  -
  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]



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



RE: What's the best strategy to handle this kind of thread issues ?

2003-09-10 Thread Mainguy, Mike
I think, however that this proposed solution (almost) entirely defeats the
purpose of having a multithreaded environment.  If you try and synchronize
all responses and disregard duplicates, you will most likely end up with a
slow and cumbersome application.  

I would say to achieve the sort of efficiencies you are describing one would
be better served to look into the app/web server code.  Doing this at a
servlet level will most likely just get one into a big mess.

It actually seems like a good idea (if it isn't already there) for a caching
proxy or appserver, but certainly not a web application.  

Just my $.02


-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2003 4:18 AM
To: Struts Users Mailing List
Subject: RE: What's the best strategy to handle this kind of thread issues?

My undertsanding was that the browser will only show the response to the the
second of the requests - forgetting about the first. The server of course
hasnt forgetten about it and keeps processing (one hopes). Im not quite sure
what happens to its response stream (null?) but the browser is now only
waiting for the second requests response - which I presume is a seperate
connection?

Now if we are using tokens or some such mechanism to detect that its a
second request and thus illigitimate then we can of course return some kind
of error to the user instead of processing the request (since we know its
already been processed).

This however isnt very friendly. What we really want to do is to have the
second request return the same response as would have been returned by the
first request after it did its work. I have no practical solution for this
:-(

Hmm. Actually I have an idea. Not a good one, but maybe worth a passing
thought:
(Thinking off the top of my head here  btw (and the following will not work
in a distributed environment unless one has sticky sessions so that all
requests for a particular session are gauranteed to be processed by the same
JVM)):

0. Requests A,B,C,N come in in rapid succession and cause threads to be
started in the container to process the requests - probably but not
necessarily in the order they came in.

1. Thread B (or any other thread) is lucky enough to start running first
and. Synchronizing on some global object (probably its own Class object if
its a singleton) it checks the session for a token (under a key that was
generated earlier and submitted as a request param in a hidden field). Not
finding it, it creates it and stores it in the session, and proceeds to
marshall the data needed to render a response - whatever it is the action is
supposed to actually do.

2. Threads A,C,N also sync on the global object and check the session.
Unlike thread B, they find the token, so they all call wait() on the token
object.

3. Having doing the processing  read/updated the db (or whatever), and
obtained the necessary info, etc... Thread B is finally ready to render a
response. It doesnt know however if it is the 'lucky last' thread that the
browser is actually waiting for. What it does then is to add the necessary
information to render the response to the session (perhaps the token could
provide getters for it?), and having done so it calls notifyAll() on the
token object, and then proceeds itself to forward to the view.

4. Threads A,C,N are woken up by the notify(), and proceed to grab the
necessary info from the session to render the same response that B is now
rendering and forward to the view. (NB: we shall assume that the view (jsp
or velocity template or whatever *only* renders the view and doesnt change
any of the information is uses to render the view (with one notable
exception) - and that that info can be read by multiple threads at once!).
One of these 4 threads is the lucky one (N in this example) that will
actually have their response output on the browser. 3 of them are wasting
time rendering to nowhere - but they are all rendering identical html, and
the user will get an appropriate response page instead of an error.

5. After they have finished rendering and flushed the 4 threads all try to
remove the token from the session. (You will note that if another request
comes in at this point we are in trouble. We could of course leave the token
in the session along with all the response data just in case but then we
would run out of memory after a while... (maybe we could use some kind of
self expiring cache? hmmm))

-Original Message-
From: Jing Zhou [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 10 September 2003 15:17
To: Struts Users Mailing List
Subject: What's the best strategy to handle this kind of thread issues?


As we realize so far, a browser window may send
request A to a server. The server starts thread A
to handle it. Before the thread A returns, the same
window may send request B to the server, therefore
the server creates thread B to handle it.

Assuming thread B finishes earlier than thread A, we
could have the 

Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Mike Kienenberger
Andrew Hill [EMAIL PROTECTED] wrote:
 My undertsanding was that the browser will only show the response to the 
the
 second of the requests - forgetting about the first. The server of course
 hasnt forgetten about it and keeps processing (one hopes). Im not quite 
sure
 what happens to its response stream (null?) but the browser is now only
 waiting for the second requests response - which I presume is a seperate
 connection?

Yes.   What happens to your first response is container-dependent, but from 
the point of view of Struts, it was generated and sent (I may be wrong, but 
I don't think Struts has a way to know it was lost).


 This however isnt very friendly. What we really want to do is to have the
 second request return the same response as would have been returned by the
 first request after it did its work. I have no practical solution for this

The best solution I've seen (WebObjects) handles it similarly to what Andrew 
suggests. 

All requests to the same session are serially-processed.

If the application is already processing a request, then another request 
won't be processed until the first one finishes.  This solves the 
synchronization issue.  You can't really solve the display issue without 
assigning unique identifiers to each request generated (see previous 
page-state cache email).   The client could be backtracking to another 
page with the same session, the same URL, and maybe the same form data.  On 
the other hand, is this a case of a difference that makes no difference is 
no difference?  At minimum, requests have to be identified with the same 
session, same URL, and same form data, though.  It will really depend on 
your backtracking strategy.

But once each request has a unique identifier and is being processed 
serially, you can compare a concurrent request to the request being 
processed, and send back the same response to both of them.


 (Thinking off the top of my head here  btw (and the following will not 
work
 in a distributed environment unless one has sticky sessions so that all
 requests for a particular session are gauranteed to be processed by the 
same
 JVM)):

Also true of the above.  WebObjects handles this by routing all requests for 
a given session to the same servlet instance.


 4. Threads A,C,N are woken up by the notify(), and proceed to grab the
 necessary info from the session to render the same response that B is now
 rendering and forward to the view. (NB: we shall assume that the view (jsp
 or velocity template or whatever *only* renders the view and doesnt change
 any of the information is uses to render the view (with one notable
 exception) - and that that info can be read by multiple threads at once!).
 One of these 4 threads is the lucky one (N in this example) that will
 actually have their response output on the browser. 3 of them are wasting
 time rendering to nowhere - but they are all rendering identical html, and
 the user will get an appropriate response page instead of an error.

Rather than render the view, just copy the response generated.  That avoids 
the above problems.


 5. After they have finished rendering and flushed the 4 threads all try to
 remove the token from the session. (You will note that if another request
 comes in at this point we are in trouble. We could of course leave the 
token
 in the session along with all the response data just in case but then we
 would run out of memory after a while... (maybe we could use some kind of
 self expiring cache? hmmm))

No, you must not cache the response at this point or page reloading/form 
resubmitting won't work.

A better solution would probably be to have the processing thread check to 
see if any other requests are waiting in the queue for the same response.  
If so, populate their response, wake them up, and clear the queuing 
condition.

-Mike


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



RE: dependant drop down list box

2003-09-10 Thread Mathew, Manoj
you can make a server call when the user changes the value  and repopulate the drop 
down.  I would use a bean to populate the bean...

manoj

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 6:55 AM
To: Struts Users Mailing List
Subject: dependant drop down list box



Can any one please tell me the best way to populating the drop down list box?
The scenario is the second drop down box depends on the value selected on the first 
drop down box.
How can we change the items of the second drop down list. The values are there in the 
request
object. But, how can I use this value?

Thanks,
Pramod


This  electronic  mail  message  is  intended  solely  for  the  named  recipients  
and  may contain
confidential  and  proprietary  business information of eFunds Corporation and all its 
subsidiaries.
If  you  are  not a named recipient, please notify the sender immediately.  You may 
not disclose the
contents  to  any  other  person;  use  this  electronic  mail message or its contents 
for any other
purpose; or further store or copy its contents in any medium



-
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: What's the best strategy to handle this kind of thread issues ?

2003-09-10 Thread Andrew Hill
It doesn't really defeat the effort - the only threads that will be sitting
there waiting are those that are processing requests that have come from
that particular form on that particular users browser where the user has
gone and double clicked submit etc... and we want things to proceed ok
without showing an error screen - and without saving the record twice in the
db (or whatever).

At any rate its unlikely to be worth the effort for most applications. I
present it more as an intellectual exercise than a serious proposal, (though
another Mike in a reply that just arrived mentions that WebObjects does
something not unlike this already so maybe its not so bad. Ill have to go
take a look at WebObjects if I ever get any free time...)

The simplest thing Ive found is to use some javascript on the client side to
minimise the potential for multiple submission of the form, and for those
cases it lets through (such as where js is disabled) the old fashioned
method of checking the token  showing an error page if its a double
submission will have to suffice. This of course is what we all do now
anyway, but a more elegant (from the user perspective) solution would be
nice.

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 10 September 2003 22:14
To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]'
Subject: RE: What's the best strategy to handle this kind of thread
issues ?


I think, however that this proposed solution (almost) entirely defeats the
purpose of having a multithreaded environment.  If you try and synchronize
all responses and disregard duplicates, you will most likely end up with a
slow and cumbersome application.

I would say to achieve the sort of efficiencies you are describing one would
be better served to look into the app/web server code.  Doing this at a
servlet level will most likely just get one into a big mess.

It actually seems like a good idea (if it isn't already there) for a caching
proxy or appserver, but certainly not a web application.

Just my $.02


-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 4:18 AM
To: Struts Users Mailing List
Subject: RE: What's the best strategy to handle this kind of thread issues?

My undertsanding was that the browser will only show the response to the the
second of the requests - forgetting about the first. The server of course
hasnt forgetten about it and keeps processing (one hopes). Im not quite sure
what happens to its response stream (null?) but the browser is now only
waiting for the second requests response - which I presume is a seperate
connection?

Now if we are using tokens or some such mechanism to detect that its a
second request and thus illigitimate then we can of course return some kind
of error to the user instead of processing the request (since we know its
already been processed).

This however isnt very friendly. What we really want to do is to have the
second request return the same response as would have been returned by the
first request after it did its work. I have no practical solution for this
:-(

Hmm. Actually I have an idea. Not a good one, but maybe worth a passing
thought:
(Thinking off the top of my head here  btw (and the following will not work
in a distributed environment unless one has sticky sessions so that all
requests for a particular session are gauranteed to be processed by the same
JVM)):

0. Requests A,B,C,N come in in rapid succession and cause threads to be
started in the container to process the requests - probably but not
necessarily in the order they came in.

1. Thread B (or any other thread) is lucky enough to start running first
and. Synchronizing on some global object (probably its own Class object if
its a singleton) it checks the session for a token (under a key that was
generated earlier and submitted as a request param in a hidden field). Not
finding it, it creates it and stores it in the session, and proceeds to
marshall the data needed to render a response - whatever it is the action is
supposed to actually do.

2. Threads A,C,N also sync on the global object and check the session.
Unlike thread B, they find the token, so they all call wait() on the token
object.

3. Having doing the processing  read/updated the db (or whatever), and
obtained the necessary info, etc... Thread B is finally ready to render a
response. It doesnt know however if it is the 'lucky last' thread that the
browser is actually waiting for. What it does then is to add the necessary
information to render the response to the session (perhaps the token could
provide getters for it?), and having done so it calls notifyAll() on the
token object, and then proceeds itself to forward to the view.

4. Threads A,C,N are woken up by the notify(), and proceed to grab the
necessary info from the session to render the same response that B is now
rendering and forward to the view. (NB: we shall assume that the view (jsp
or velocity 

Issue with struts 1.0

2003-09-10 Thread soumen mukherjee
Hi,
I have a very basic question about how struts 1.0
ActionForm  validation works.I created one ActionForm
to be used as input to my Action class process()
method.However my problem is this ActionForm gets
created and validated (as in struts_cfg.xml i have put
validate as true) at the same time.I do not want this
validation to be  done  at that point of time.I only
want this validation to be done at the time user sends
a request.
Can anyone pls help me in this situation?
Thanks and regards,
Soumen


Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com

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



Re: Cannot find bean viewcontactlist in scope request

2003-09-10 Thread Tim T. Young

paramName (in your case viewcontactlist) is the name of the bean in the
request (paramScope=request).  You need to have a paramProperty
=beanProperty also.

From the docs:

Specify both the paramName and paramProperty attributes - The specified
property getter method will be called on the JSP bean identified by the
paramName (and optional paramScope) attributes, in order to select a value
that can be converted to a String.

HTH,
Tim




|-+
| |   Mehran Zonouzi |
| |   [EMAIL PROTECTED]|
| |   b.com   |
| ||
| |   09/10/2003 08:15 |
| |   AM   |
| |   Please respond to|
| |   Struts Users|
| |   Mailing List|
| ||
|-+
  
--|
  |
  |
  |
  |
  |
  |
  |
  |
  |To: Struts Users Mailing List [EMAIL PROTECTED]   
 |
  |cc: 
  |
  |
  |
  |
  |
  |
  |
  |  Subject:  Cannot find bean viewcontactlist in scope request   
  |
  
--|



Caterpillar: Confidential Green Retain Until: 10/10/2003
Retention Category:  G90 -
General
Matters/Administration




I am getting this error message when my JSP page first loads up.

Cannot find bean viewcontactlist in scope request


I am using a link to call my ActionForm class( as below):

 html:link action=contact.do paramId=page paramName=viewcontactlist
paramScope=request/html:link

My ActinForm is called ContactForm and I want to call it using a param
called 'page' with the initial value of 'viewcontactlist'
to it.

Can anyone help me with the syntax plz?


--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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



Validate and DispatchAction

2003-09-10 Thread Natalie D Rassmann
Hi -

I am trying to get the validator framework to work with dispatchAction.
When I turn validation on, it seems as though I don't go to the action
first.  (in my action I make several options lists which need to be
displayed as part of the form).  I must be doing something wrong but I
don't know what.  How do I make it go to the my action first to build
these lists so the form can be displayed

Thanks in advance,

Natalie Rassmann

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

RE: What's the best strategy to handle this kind of thread issues ?

2003-09-10 Thread Andrew Hill
Actually Id have to disagree with you about the requests for a particular
session not needing to be multithreaded.
For example in the app I was working on recently we needed the ability for
the user to pop up (yes I know - I dont like it either) lots of editing
windows for records selected from the listview in the main window,
furthermore the main window is itself framed... Its quite common for the app
to be processing several requests at once - and given the the app this is a
front end for is rather complex (It aint no shopping cart) and uses EJBS
down in the bTier, synchronizing requests for the same session would have
been unbearably slow (the average request can take a couple of seconds to
process depending on the BL going on behind the scenes - doing it serially
is out of the question).

-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 10 September 2003 22:33
To: Struts Users Mailing List
Subject: Re: What's the best strategy to handle this kind of thread
issues ?


Mainguy, Mike [EMAIL PROTECTED] wrote:
 I think, however that this proposed solution (almost) entirely defeats the
 purpose of having a multithreaded environment.  If you try and synchronize
 all responses and disregard duplicates, you will most likely end up with a
 slow and cumbersome application.

This only requires sychronizing at the session level.  Session behavior
rarely needs to be multithreaded.

-
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: Serializing ActionForm (Urgent)

2003-09-10 Thread Andrew Hill
Hmm. I was about to finger the ActionServlet reference, and the
MultipartRequestWrapper ref, but they are both transient, so can't be
causing the problem.
My next suspect would be the FormFile (but its the actionservletwrapper its
listing in the except... ahhh... but of course its a wrapper - not the ref
itself - the ActionServlet reference is transient, but the *wrapper* object
a new instance of which is returned on each call to getServletWrapper()
doesnt implement Serializable.

Hmm. You cant do much about that. IMHO given that ActionForm claims to
implement Serializable, thats would be a bug!

silly-idea
heres a nasty hack: Perhaps you could add a transient field to your action
form:

public transient boolean _disableWrapper = false;

And override getServletWrapper thusly:

public ActionServletWrapper getServletWrapper()
{
  return _disableWrapper ? null : super.getServlet();
}

Prior to serialisation set the field to true. Serialise and then set it
back.

Oh and lose the formfiles, as for sure they will be the next problem -
unless you make their fields transient in your form.
/silly-idea

Why on earth are you using an ActionForm as a parameter to an RPC though?
ActionForms are VIEW components. Very bad karma to use them as DTOs.

better-idea
You would do better to create a normal bean class with the properties you
want and serialise that (you can use PropertyUtils.copyProperties() to
transfer the data from the ActionForm to the DTO if you dont fancy a lot of
typing...).
/better-idea



-Original Message-
From: António Santos [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 10 September 2003 22:59
To: [EMAIL PROTECTED]
Subject: Serializing ActionForm (Urgent)


Hi again! I'm sending this message again because I'm finding this issue very
urgent for me and I can't find any explanation for this in the list archive.

I have an ActionForm (ProjForm) which has several String fields and a
FormFile
field (but this happens with ActionForms with just String fields).
Now, I want to pass it as an RPC parameter through a WebService invocation.
However, I'm having problems with the serialization. Since I'm using AXIS, I
have followed the tutorial in order to register the type mapping.

call.registerTypeMapping(ProjForm.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory( ProjForm.class,
qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(ProjForm.class,
qn));

I'm getting this error during the invocation:

Error : java.io.IOException: No serializer found for class
org.apache.struts.action.ActionServletWrapper in registry
[EMAIL PROTECTED]

I tried to register the ActionServletWrapper class also but then I get:

org.xml.sax.SAXException: No deserializer for {urn:ProjectWS}wrapper

({urn:ProjectWS} is the namespace of the QName).

I suppose that ActionForm can be seen as a simple Javabean. Any clue on what
is happening?

Thanks in advance,

António Santos
FEUP - Portugal

-
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: Serializing ActionForm (Urgent)

2003-09-10 Thread Chen, Gin
I'm assuming it's a configuration issue with your AXIS implementation.
But rather then get into that... why not just create a interim bean that
will store the data then BeanUtil.copyProperties it back to the ActionForm?
-Tim

-Original Message-
From: António Santos [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 10:59 AM
To: [EMAIL PROTECTED]
Subject: Serializing ActionForm (Urgent)


Hi again! I'm sending this message again because I'm finding this issue very
urgent for me and I can't find any explanation for this in the list archive.

I have an ActionForm (ProjForm) which has several String fields and a
FormFile
field (but this happens with ActionForms with just String fields).
Now, I want to pass it as an RPC parameter through a WebService invocation.
However, I'm having problems with the serialization. Since I'm using AXIS, I
have followed the tutorial in order to register the type mapping.

call.registerTypeMapping(ProjForm.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory(
ProjForm.class, qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(ProjForm.class,
qn));

I'm getting this error during the invocation:

Error : java.io.IOException: No serializer found for class
org.apache.struts.action.ActionServletWrapper in registry
[EMAIL PROTECTED]

I tried to register the ActionServletWrapper class also but then I get:

org.xml.sax.SAXException: No deserializer for {urn:ProjectWS}wrapper

({urn:ProjectWS} is the namespace of the QName).

I suppose that ActionForm can be seen as a simple Javabean. Any clue on what
is happening?

Thanks in advance,

António Santos
FEUP - Portugal

-
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: Prevent URL requested directly from browser

2003-09-10 Thread veera maria
Yes... I know quite well the philosophy around this question
but how about the technical implemantation?
Have you any ideas about it?

Has anyone used succesfully tokens to solve this kind of problem?

I have seen technical solution to this kind of problen (and it worked),
but can not remember it's details.
So, please those who have experience give some tips.

Br M.V


From: Max Cooper [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Prevent URL requested directly from browser
Date: Tue, 9 Sep 2003 18:06:04 -0700
Keep these things in mind as you develop a solution:

1. There is absolutely no way to prevent users from making whatever 
requests
they want. Bookmarking, typing in URLs, emailing URLs, etc. are all 
possible
and there is nothing that can be done to prevent people from making these
requests.

2. You do have total control over how your web app responds to those
requests.
-Max

- Original Message -
From: veera maria [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 11:11 AM
Subject: Prevent URL requested directly from browser
 Hello,

 What is the best way to prevent user to request web application's
 actions from browser manually?

 E.g. user is using web application and taking it's current url
 to clipboard. Then user goes e.g. to Google for surfing for a while.
 After surfing (s)he pastes web applications url back to browser's
 address field.
 Best technique in Struts applicaton to prevent this?

 Vera

 _
 Tilaa nyt Hotmail postit kännykkääsi! http://www.msn.fi/mobiili/


 -
 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]
_
MSN Messenger - kaikki ystävät klikkauksen päässä! Lataa tästä ilmaiseksi. 
http://www.msn.fi/viestintapalvelut/Messenger

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


Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Jing Zhou

- Original Message - 
From: Andrew Hill [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 3:18 AM
Subject: RE: What's the best strategy to handle this kind of thread issues?


 My undertsanding was that the browser will only show the response to the
the
 second of the requests - forgetting about the first. The server of course
 hasnt forgetten about it and keeps processing (one hopes). Im not quite
sure
 what happens to its response stream (null?) but the browser is now only
 waiting for the second requests response - which I presume is a seperate
 connection?

It is very likely for the browser window to use the same connection to send
request A and B (with the keep alive setting). But I am not 100% sure for
this. Any Tomcat users or experts could provide some clue?


 Now if we are using tokens or some such mechanism to detect that its a
 second request and thus illigitimate then we can of course return some
kind
 of error to the user instead of processing the request (since we know its
 already been processed).

Assume the token is used. Thread B returns error messages. But thread A
is still valid in the processing mode. When thread A returns with response
A,
the difficulty here is the browser window could *ignore* response A.
If the browser window shows response A, it is much better.


 This however isnt very friendly. What we really want to do is to have the
 second request return the same response as would have been returned by the
 first request after it did its work. I have no practical solution for this
 :-(

I have the same expectation and am considering using the very first
filter to 1) block other threads or 2) render the pending contents from
thread A.
But we have real challenging issues here as you see my comments below.


 Hmm. Actually I have an idea. Not a good one, but maybe worth a passing
 thought:
 (Thinking off the top of my head here  btw (and the following will not
work
 in a distributed environment unless one has sticky sessions so that all
 requests for a particular session are gauranteed to be processed by the
same
 JVM)):

 0. Requests A,B,C,N come in in rapid succession and cause threads to be
 started in the container to process the requests - probably but not
 necessarily in the order they came in.

 1. Thread B (or any other thread) is lucky enough to start running first
 and. Synchronizing on some global object (probably its own Class object if
 its a singleton) it checks the session for a token (under a key that was
 generated earlier and submitted as a request param in a hidden field). Not
 finding it, it creates it and stores it in the session, and proceeds to
 marshall the data needed to render a response - whatever it is the action
is
 supposed to actually do.

 2. Threads A,C,N also sync on the global object and check the session.
 Unlike thread B, they find the token, so they all call wait() on the token
 object.

 3. Having doing the processing  read/updated the db (or whatever), and
 obtained the necessary info, etc... Thread B is finally ready to render a
 response. It doesnt know however if it is the 'lucky last' thread that the
 browser is actually waiting for. What it does then is to add the necessary
 information to render the response to the session (perhaps the token could
 provide getters for it?), and having done so it calls notifyAll() on the
 token object, and then proceeds itself to forward to the view.


This could open a bad time window for other threads to modify data models
while thread B is rendering the view.

 4. Threads A,C,N are woken up by the notify(), and proceed to grab the
 necessary info from the session to render the same response that B is now
 rendering and forward to the view. (NB: we shall assume that the view (jsp
 or velocity template or whatever *only* renders the view and doesnt change
 any of the information is uses to render the view (with one notable
 exception) - and that that info can be read by multiple threads at once!).
 One of these 4 threads is the lucky one (N in this example) that will
 actually have their response output on the browser. 3 of them are wasting
 time rendering to nowhere - but they are all rendering identical html, and
 the user will get an appropriate response page instead of an error.


We could not assume thread A,C,or N are to render the same response as B.
They could have different handling logic.

 5. After they have finished rendering and flushed the 4 threads all try to
 remove the token from the session. (You will note that if another request
 comes in at this point we are in trouble. We could of course leave the
token
 in the session along with all the response data just in case but then we
 would run out of memory after a while... (maybe we could use some kind of
 self expiring cache? hmmm))

This removing/resetting a token form the session mechanism is not
guaranteed to work. For example, when thread B is rendering its view,
a 

RE: Prevent URL requested directly from browser

2003-09-10 Thread Trieu, Danny
Transaction Token will help, but it will not do everything you want to do.
Max is right, this is the nature of Web application.  Even with Transaction
Token user, if he has a copy of the token, can still create request and hit
your app without the app knowing about.  Plus, not every resource in your
app. Will have a transaction token, even if it is a lot of effort need to be
made for every request to check and update token.

-Original Message-
From: veera maria [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2003 8:20 AM
To: [EMAIL PROTECTED]
Subject: Re: Prevent URL requested directly from browser


Yes... I know quite well the philosophy around this question
but how about the technical implemantation?

Have you any ideas about it?

Has anyone used succesfully tokens to solve this kind of problem?

I have seen technical solution to this kind of problen (and it worked),
but can not remember it's details.

So, please those who have experience give some tips.

Br M.V


From: Max Cooper [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Prevent URL requested directly from browser
Date: Tue, 9 Sep 2003 18:06:04 -0700

Keep these things in mind as you develop a solution:

1. There is absolutely no way to prevent users from making whatever 
requests
they want. Bookmarking, typing in URLs, emailing URLs, etc. are all 
possible
and there is nothing that can be done to prevent people from making these
requests.

2. You do have total control over how your web app responds to those
requests.

-Max

- Original Message -
From: veera maria [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 11:11 AM
Subject: Prevent URL requested directly from browser


  Hello,
 
  What is the best way to prevent user to request web application's
  actions from browser manually?
 
  E.g. user is using web application and taking it's current url
  to clipboard. Then user goes e.g. to Google for surfing for a while.
  After surfing (s)he pastes web applications url back to browser's
  address field.
  Best technique in Struts applicaton to prevent this?
 
  Vera
 
  _
  Tilaa nyt Hotmail postit kännykkääsi! http://www.msn.fi/mobiili/
 
 
  -
  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]


_
MSN Messenger - kaikki ystävät klikkauksen päässä! Lataa tästä ilmaiseksi. 
http://www.msn.fi/viestintapalvelut/Messenger


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


This message and any attachments are for the intended recipient(s) only and may 
contain privileged, confidential and/or proprietary information about Downey Savings 
or its customers, which Downey Savings does not intend to disclose to the public. If 
you received this message by mistake, please notify the sender by reply e-mail and 
delete the message and attachments.

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



Struts-example i18n

2003-09-10 Thread Kapadia Mitesh-C23457
I can successfully run the struts-example app provided with the STRUTS
install on Tomcat in English, however, I would like to be able to view the
i18n capabilities using the 'ja' and 'ru' .properties files.

I have added the 'ja' and 'ru' locales and removed the 'en' locale by
configuring my browser, however, the pages still continue to render in
English.  Are there any additional configurations/changes that I need to
make in order to view these pages in Japanese or Russian?

Thanks in advance.

Mitesh


bean:message not parse HTML tags?

2003-09-10 Thread Michael Remijan
Hello forum:

If I have a string defined in my resources file that looks like this:

some.key some bvalue with html characters/b

is it possible for bean:message to NOT parse the  characters so that when 
it is written to the html page you see those words in bold?

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


Recall: Struts-example i18n

2003-09-10 Thread Kapadia Mitesh-C23457
Kapadia Mitesh-C23457 would like to recall the message, Struts-example 
i18n.

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



Re: bean:message not parse HTML tags?

2003-09-10 Thread David Graham
--- Michael Remijan [EMAIL PROTECTED] wrote:
 
 Hello forum:
 
 If I have a string defined in my resources file that looks like this:
 
 some.key some bvalue with html characters/b
 
 is it possible for bean:message to NOT parse the  characters so that
 when 
 it is written to the html page you see those words in bold?

It filters certain characters for security reasons.  In general, it's a
bad idea to store markup in properties files because that's a view layer
issue.  You could try using the JSTL's fmt:message tag.

David


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


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[HELP] how passing in list sql statement parameter using scaffold

2003-09-10 Thread Lázaro Miguel Fung
Hi.

I'm using scaffold, how I can pass a numeric list in this sql statement

select * from table_name where key in (?)

key is an integer.

When I try to pass a list like this: 8,2,5,10 the select only return the
record related to the first item (8).

Any help will be highly apretiated.

TIA
LFung


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



Suggested enhancements for next version

2003-09-10 Thread David Thielen
Hi;

These are a couple of suggestions I have for the next version of struts:
  1.. Can get the session in the ActionForm constructor. This would be very useful for 
initializing with data attached to the session.
  2.. Have a pre-page method in the Action that can be set in an action like 
validate=true. This would give the Action class a chance to determine if this page 
can be displayed and do a forward if it cannot. For example in pages 2 - N of a 
multi-page series of forms.
  3.. Allow an action with no form. This would be useful where a page has a form 
that is just a submit button. No ActionForm is needed but the html:form is still 
prefered for the action it submits to.
thanks - dave

Re: What's the best strategy to handle this kind of thread issues ?

2003-09-10 Thread Jing Zhou

- Original Message - 
From: Mainguy, Mike [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 9:14 AM
Subject: RE: What's the best strategy to handle this kind of thread issues ?


 I think, however that this proposed solution (almost) entirely defeats the
 purpose of having a multithreaded environment.  If you try and synchronize
 all responses and disregard duplicates, you will most likely end up with a
 slow and cumbersome application.

Swing takes advantages of multithreaded environments. But its event
handling model does use single thread to execute queued events.
Such mechanism does not cause slow responses at all,
both in theory and in reality. How to get it done in web tiers is an open
challenging.

my $.02

Jing


 I would say to achieve the sort of efficiencies you are describing one
would
 be better served to look into the app/web server code.  Doing this at a
 servlet level will most likely just get one into a big mess.

 It actually seems like a good idea (if it isn't already there) for a
caching
 proxy or appserver, but certainly not a web application.

 Just my $.02


 -Original Message-
 From: Andrew Hill [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 4:18 AM
 To: Struts Users Mailing List
 Subject: RE: What's the best strategy to handle this kind of thread
issues?

 My undertsanding was that the browser will only show the response to the
the
 second of the requests - forgetting about the first. The server of course
 hasnt forgetten about it and keeps processing (one hopes). Im not quite
sure
 what happens to its response stream (null?) but the browser is now only
 waiting for the second requests response - which I presume is a seperate
 connection?

 Now if we are using tokens or some such mechanism to detect that its a
 second request and thus illigitimate then we can of course return some
kind
 of error to the user instead of processing the request (since we know its
 already been processed).

 This however isnt very friendly. What we really want to do is to have the
 second request return the same response as would have been returned by the
 first request after it did its work. I have no practical solution for this
 :-(

 Hmm. Actually I have an idea. Not a good one, but maybe worth a passing
 thought:
 (Thinking off the top of my head here  btw (and the following will not
work
 in a distributed environment unless one has sticky sessions so that all
 requests for a particular session are gauranteed to be processed by the
same
 JVM)):

 0. Requests A,B,C,N come in in rapid succession and cause threads to be
 started in the container to process the requests - probably but not
 necessarily in the order they came in.

 1. Thread B (or any other thread) is lucky enough to start running first
 and. Synchronizing on some global object (probably its own Class object if
 its a singleton) it checks the session for a token (under a key that was
 generated earlier and submitted as a request param in a hidden field). Not
 finding it, it creates it and stores it in the session, and proceeds to
 marshall the data needed to render a response - whatever it is the action
is
 supposed to actually do.

 2. Threads A,C,N also sync on the global object and check the session.
 Unlike thread B, they find the token, so they all call wait() on the token
 object.

 3. Having doing the processing  read/updated the db (or whatever), and
 obtained the necessary info, etc... Thread B is finally ready to render a
 response. It doesnt know however if it is the 'lucky last' thread that the
 browser is actually waiting for. What it does then is to add the necessary
 information to render the response to the session (perhaps the token could
 provide getters for it?), and having done so it calls notifyAll() on the
 token object, and then proceeds itself to forward to the view.

 4. Threads A,C,N are woken up by the notify(), and proceed to grab the
 necessary info from the session to render the same response that B is now
 rendering and forward to the view. (NB: we shall assume that the view (jsp
 or velocity template or whatever *only* renders the view and doesnt change
 any of the information is uses to render the view (with one notable
 exception) - and that that info can be read by multiple threads at once!).
 One of these 4 threads is the lucky one (N in this example) that will
 actually have their response output on the browser. 3 of them are wasting
 time rendering to nowhere - but they are all rendering identical html, and
 the user will get an appropriate response page instead of an error.

 5. After they have finished rendering and flushed the 4 threads all try to
 remove the token from the session. (You will note that if another request
 comes in at this point we are in trouble. We could of course leave the
token
 in the session along with all the response data just in case but then we
 would run out of 

html:select within logic:iterate

2003-09-10 Thread Tobias Salem

Hello,

I have a problem with auto-updating some properties with html:selects within
an iterate-tag.
The JSP is a classic view/edit cart page where you view and possibly edit
your shopping cart. The form is called CartForm and only have one instance
variable called trade (an own-written class Trade), through which all
relevant data is retrieved and/or updated.

The Trade object contains a list of products which are part of the trade.
For these the title and price should be displayed (no problem here), and the
quantity and deliveryMethod should be displayed and updateable through
html:selects. The problem is how to write the correct html:select syntax to
map to the correct methods in the CartForm (which just translates/forwards
the call). Everything except the html:selects are working fine. I have read
alot of forums/articles and tried over 20 syntax variants but still with no
luck. :(

Here is the relevant code:

/**
 * Class representing the form used to view/edit the cart,
 * subclassing the CustomerForm (extends ActionForm)
 * What differs in this CartForm is that it has Trade info
 * (the tradeProducts of the Trade are what constitutes the 'cart').
 *
 */
public class CartForm extends CustomerForm  {

private static Logger logger = Logger.getLogger( CartForm.class);

protected Trade trade;

public Trade getTrade() {
return trade;
}

public void setTrade(Trade t) {
trade = t;
List l = trade.getTradeProducts();
logger.debug(CartForm.setTrade(Trade t) called);
logger.debug(This CartForm now has  +l.size() +  nr of TradeProducts  +
l);
}

// returns the list of TradeProducts which are part of the trade/cart
public List getTradeProducts() {
return trade.getTradeProducts();
}

// Methods added from similar example at
http://jakarta.apache.org/struts/userGuide/building_controller.html
// but Are these getters and setter really needed?
// The get/set methods should IMHO be called directly on the
TradeProduct objects
public int getQty(int i) {
logger.debug(Getting qty on TradeProduct nr  +i+ .);
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
return tp.getQty();
}

public void setQty(int i, int value) {
logger.debug(Changed qty on TradeProduct nr  +i+  to value  + value);
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
tp.setQty(value);
}

public String getDeliveryMethod(int i) {
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
return tp.getDeliveryMethod();
}

public void setDeliveryMethod(int i, String value) {
logger.debug(Changed setDeliveryMethod on TradeProduct nr  +i+  to value
 + value);
TradeProduct tp = (TradeProduct) trade.getTradeProducts().get(i);
tp.setDeliveryMethod(value);
}

}

/**
 * This class models a TradeProduct.
 * A Trade respesents one purchase-event and can consist of one or many
TradeProducts.
 * A TradeProduct is a Product which belongs to a specific Trade, with
information
 * such as quantity, deliveryMethod and deliveryDate.
 *
 */
public class TradeProduct extends DatabaseObject {
  private int qty = 1;
  private String deliveryMethod = ;

public int getQty() {
return qty;
}
public void setQty(int _qty) {
qty = _qty;
}

public String getDeliveryMethod() {
return deliveryMethod;
}
public void setDeliveryMethod(String _deliveryMethod) {
deliveryMethod = _deliveryMethod;
}
...
}

viewCart.jsp

...
  logic:iterate id=tp property=tradeProducts indexId=ctr
!-- These are working fine --
html:hidden property=code name=tp value=product.productNr /
html:hidden property=price name=tp value=product.price /
  !-- What is the correct syntax for the html:selects?? --
  html:select indexed=true name=tradeProduct property=qty
onChange=this.form.submit()
html:options property=qtys/
  /html:select

  html:select indexed=true name=tp property=deliveryMethod
onchange='this.form.submit();
html:options property=deliveryMethods/
  /html:select
...
/logic:iterate
...

With this syntax no error occurs but no update of the qty or deliveryMethod
occurs. If I remove the indexed=true it says that setter methods for qty
and deliveryMethod is missing, which is a lie since a TradeProduct has
those, and tp points to a TradeProduct.
Any help is much appreciated. A complete example html:selects withing a
logic:iterate which auto-update properties in the form (or classes
referenced by the form) would be great.

Thanks in advance.

Best Regards /Tobias


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



RE: Tiles problem?

2003-09-10 Thread alan

Return Receipt
   
Your  RE: Tiles problem?   
document   
:  
   
was   Alan Brown/Object Edge   
received   
by:
   
at:   09/10/2003 09:55:49 AM   
   





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



RE: Suggested enhancements for next version

2003-09-10 Thread James Childers

 These are a couple of suggestions I have for the next version 
 of struts:
   1.. Can get the session in the ActionForm constructor. This 
 would be very useful for initializing with data attached to 
 the session.

This violates the JavaBean standard which requires that beans have a default (no-arg) 
constructor. You can get to the session -- or whatever scope object you need -- via 
the validate(ActionMapping, HttpServletRequest) method inherited from ActionForm.

   2.. Have a pre-page method in the Action that can be set in 
 an action like validate=true. This would give the Action 
 class a chance to determine if this page can be displayed and 
 do a forward if it cannot. For example in pages 2 - N of a 
 multi-page series of forms.

I agree that a general page-flow restriction mechanism would be a boon. I've had to 
develop my own, and I'm sure I'm not alone in this.

   3.. Allow an action with no form. This would be useful 
 where a page has a form that is just a submit button. No 
 ActionForm is needed but the html:form is still prefered 
 for the action it submits to.

I don't understand. If the page has no form, why would you need a submit button 
instead of just a link? You could also just use a regular HTML form tag that 
directly submits to the URL of the action in question.

In any case, action mappings aren't required to have a name attribute. From 
struts-config_1_1.dtd:

 nameName of the form bean, if any, that is associated with this
 action mapping.

-= J

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



Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Craig R. McClanahan
On Wed, 10 Sep 2003, Jing Zhou wrote:

 Date: Wed, 10 Sep 2003 02:16:49 -0500
 From: Jing Zhou [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
  Jing Zhou [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: What's the best strategy to handle this kind of thread issues?

 As we realize so far, a browser window may send
 request A to a server. The server starts thread A
 to handle it. Before the thread A returns, the same
 window may send request B to the server, therefore
 the server creates thread B to handle it.


Technically, the threads are usually there already in a pool, rather than
being created, but that is not really relevant to your question.

The only ways the same browser window can send more than one request
(in the manner you describe) are:
(a) User presses STOP and then manually triggers a second request.
(b) A page includes one or more tags like img that fire
off parallel requests for each image
(c) Window includes multiple frames (the frames themselves
are often loaded with parallel requests) just like (b)
(d) JavaScript techniques similar in (b) that are used by the client
to reassemble the output.

So the answer to your question really depends on which use case we're
talking about.  In scenario (a), thread A will continue to run the
original request, because the server has no way to know that the user
pressed STOP.  Because the client has closed the TCP connection, the
servlet will generally encounter an I/O exception when writing out the
response -- but if the response fits inside a buffer, it might not be seen
until after the servlet returns.

In scenarios (b) - (d) the requests run in parallel and the client
assembles the resulting page.


 Assuming thread B finishes earlier than thread A, we
 could have the following possibilities:

 1) The server waits thread A to finish and send response A
 and then send response B. (I do not believe this is the
 Tomcat implementation, correct?)

 2) The server sends response B back to the browser
 window and the browser window displays it and ignores
 response A after it.

  3) The browser displays response B and then displays
 response A.

 What I can see is that thread B is the trouble maker. But it
 is possible when end users click more than one buttons.

This is my scenario (a) use case, and behaves as I described above.

 In Swing, such problems are resolved by Single Thread
 Model. Should we follow Single Thread Model at
 servers? Are there any other practical solutions to it out
 there?

The key problem in dealing with scenario (a) is detecting that it has
even happened.  The most important case is when you're doing a POST that
updates the database -- for example, you don't want an order to be
submitted twice simply because the user pressed SUBMIT, hit the back
arrow, and pressed SUBMIT again.  The transaction token facility
provided by Struts can be used to detect the second submit.

Note that there is an API called SingleThreadModel in servlets, but it
has nothing to do with this kind of problem, and should be avoided anyway
(it's being deprecated in Servlet 2.4) because it doesn't really solve all
of the problems that it tries to solve.



 Jing
 Netspread Carrier
 http://www.netspread.com




Craig


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



Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Craig R. McClanahan
On Wed, 10 Sep 2003, Jing Zhou wrote:

 [snip]
 It is very likely for the browser window to use the same connection to send
 request A and B (with the keep alive setting). But I am not 100% sure for
 this. Any Tomcat users or experts could provide some clue?


This is actually more an issue of the client than the server.  Tomcat 4.x
and 5.x do, in fact, support HTTP/1.1, which includes the ability to send
more than one request serially on the same TCP connection.  However, if
you're doing scenario (a) from my previous response (user presses STOP),
then the client knows it needs to switch to a different TCP connection
because it hasn't received the first response yet.  In scenario (b)-(d) --
for example, multiple img tags -- the client will open separate TCP
connections for simultaneously pulling images (Netscape used to default to
4).

Under no circumstances will a client that correctly implements HTTP send a
second request on the *same* TCP connection as a previous one without
having received a response yet.  Of course, whether it's the same TCP
connection or a different one makes absolutely no difference in the fact
that you do need to deal with the SUBMIT -- STOP -- SUBMIT behavior of
users.  How the client and server communicate (one socket versus many, one
request per socket or persistent connections) is an irrelevant technical
detail.

Craig

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



Re: Suggested enhancements for next version

2003-09-10 Thread Craig R. McClanahan
On Wed, 10 Sep 2003, David Thielen wrote:

 Date: Wed, 10 Sep 2003 10:22:10 -0600
 From: David Thielen [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts-Users [EMAIL PROTECTED]
 Subject: Suggested enhancements for next version

 Hi;

 These are a couple of suggestions I have for the next version of struts:

   1.. Can get the session in the ActionForm constructor. This would be
 very useful for initializing with data attached to the session.

   2.. Have a pre-page method in the Action that can be set in an
 action like validate=true. This would give the Action class a chance
 to determine if this page can be displayed and do a forward if it
 cannot. For example in pages 2 - N of a multi-page series of forms.

   3.. Allow an action with no form. This would be useful where a page
 has a form that is just a submit button. No ActionForm is needed but the
 html:form is still prefered for the action it submits to. thanks -
 dave

The best way to record suggestions like this is to put enhancement
requests into our issue tracking system:

  http://nagoya.apache.org/bugzilla/

Craig

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



Problems using html tag lib

2003-09-10 Thread Dhaliwal, Pritpal (HQP)
Hello,

I do this in my code:

html:form action=/Greetings
html:text property=flyer2/
/html:form

And it says this when I run it :
javax.servlet.jsp.JspException: Cannot retrieve definition for form bean
null
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:831)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
at _greetings__jsp._jspService(/greetings.jsp:25)


In my struts-config.xml I do not have any for this form. I have Greetings
action, but its not a form action.

Relevent part of struts-config.xml:
action-mappings
!-- We are specifying that path /Greetings should go to our
GreetingsAction --
action path=/Greetings type=struts.action.GreetingsAction /

/action-mappings

TIA for your help.

Pritpal Dhaliwal


RE: Problems using html tag lib

2003-09-10 Thread Slattery, Tim - BLS
 I do this in my code:
 
 html:form action=/Greetings

I think the action property needs to include the .do extension:

html:form action=/Greetings.do

 html:text property=flyer2/
 /html:form


--
Tim Slattery
[EMAIL PROTECTED]


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



Link

2003-09-10 Thread Francisco Vides Fernandez

Hi

I want to generate a link from a file name which is a property from an
action form. Can I generate one with html:a whose href is this
property?
Something like

class MyForm extends ActionForm
{
  private String myFile;

  public void setMyFile (String MyFile)
  {
this.myFile = MyFile;
  }

  public String getMyFile()
  {
return this.myFile;
  }
}


and later do something like:
html:a property=myFile/

I have RTFM and seen that I can do some sofisticated stuff with
parameters, but I want to do this (I think) simpler thing. Is this
possible?

Saludos


-- 
+-
| Francisco Vides Fernández [EMAIL PROTECTED]
| Director técnico.
| Teléfono fijo:   952 60 29 59
| Teléfono móvil:  661 67 32 73
| Fax: 952 60 29 59
| Dédalo Ingenieros http://www.dedaloingenieros.com/
| PGP: http://pgp.rediris.es:11371/pks/lookup?op=indexsearch=0x5AAE6285
+--


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



Re: Problems using html tag lib

2003-09-10 Thread Nate Drake
Do you have a ActionForm for use with the action?  I think you need to
specify one in the action mapping.

On Wed, 2003-09-10 at 13:48, Dhaliwal, Pritpal (HQP) wrote:
 Hello,
 
 I do this in my code:
 
 html:form action=/Greetings
 html:text property=flyer2/
 /html:form
 
 And it says this when I run it :
 javax.servlet.jsp.JspException: Cannot retrieve definition for form bean
 null
   at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:831)
   at
 org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
   at _greetings__jsp._jspService(/greetings.jsp:25)
 
 
 In my struts-config.xml I do not have any for this form. I have Greetings
 action, but its not a form action.
 
 Relevent part of struts-config.xml:
 action-mappings
   !-- We are specifying that path /Greetings should go to our
 GreetingsAction --
 action path=/Greetings type=struts.action.GreetingsAction /
 
 /action-mappings
 
 TIA for your help.
 
 Pritpal Dhaliwal


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



RE: Problems using html tag lib

2003-09-10 Thread Yuan, Saul (TOR-ML)
I don't think you need the .do extension, unless you have that defined
in the web.xml mapping. 

If you use html:form, Struts is supposed to find a form bean defined
either through the action mapping or the name attribute in the tag
html:form..., if you don't really need a from bean, then use the
standard html form tag, ie. 

form action=
input type=text ...


Saul


 
 
  I do this in my code:
 
  html:form action=/Greetings
 
 I think the action property needs to include the .do extension:
 
 html:form action=/Greetings.do
 
  html:text property=flyer2/
  /html:form
 
 
 --
 Tim Slattery
 [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]



can somebody explain this to me?

2003-09-10 Thread Robert Upshall
I am attempting to convert a site to work with the struts tiles taglib. 
 Below are 2 copies of a menu.jsp file that is being use in a template 
with the tiles:put directive.  The top one is a hack that works and the 
bottom is what I would like to do if I could get it working.

Is there any way to get the menu.jsp #2 working? What happenes when I 
try to use #2 is that %= request.getParameter(pageName) % is passed 
into the psa:menu tag not the value that it resolves to.

Thanks,
Robert


-- menu.jsp # 1 -
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
%@ taglib uri=/psa-taglib.tld prefix=psa %
%
   String pageName = request.getParameter(pageName);
   if (pageName == null)
 pageName = ;
%
% if (pageName.trim().toUpperCase().equals(INDEX)) { %
psa:menu pageName=INDEX/
% } else if (pageName.trim().toUpperCase().equals(HOME)) { %
psa:menu pageName=HOME/
% } else if (pageName.trim().toUpperCase().equals(ACCTINFO)) { %
psa:menu pageName=ACCTINFO/
% } else if (pageName.trim().toUpperCase().equals(BILLPAY)) { %
psa:menu pageName=BILLPAY/
% } else if (pageName.trim().toUpperCase().equals(ABOUT)) { %
psa:menu pageName=ABOUT/
% } else { %
psa:menu pageName=/
% } %
-



-- menu.jsp # 2 -

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
%@ taglib uri=/psa-taglib.tld prefix=psa %
psa:menu pageName=%= request.getParameter(pageName) %/

-





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


RE: can somebody explain this to me?

2003-09-10 Thread Pady Srinivasan

Is the pageName attribute defined with rtexprvalue set to true in the tld ?

Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Robert Upshall [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2003 2:16 PM
To: Struts Users Mailing List
Subject: can somebody explain this to me?

I am attempting to convert a site to work with the struts tiles taglib. 
  Below are 2 copies of a menu.jsp file that is being use in a template 
with the tiles:put directive.  The top one is a hack that works and the 
bottom is what I would like to do if I could get it working.

Is there any way to get the menu.jsp #2 working? What happenes when I 
try to use #2 is that %= request.getParameter(pageName) % is passed 
into the psa:menu tag not the value that it resolves to.

Thanks,
Robert



-- menu.jsp # 1 -
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
%@ taglib uri=/psa-taglib.tld prefix=psa %

%
String pageName = request.getParameter(pageName);
if (pageName == null)
  pageName = ;
%

% if (pageName.trim().toUpperCase().equals(INDEX)) { %
 psa:menu pageName=INDEX/
% } else if (pageName.trim().toUpperCase().equals(HOME)) { %
 psa:menu pageName=HOME/
% } else if (pageName.trim().toUpperCase().equals(ACCTINFO)) { %
 psa:menu pageName=ACCTINFO/
% } else if (pageName.trim().toUpperCase().equals(BILLPAY)) { %
 psa:menu pageName=BILLPAY/
% } else if (pageName.trim().toUpperCase().equals(ABOUT)) { %
 psa:menu pageName=ABOUT/
% } else { %
 psa:menu pageName=/
% } %

-




-- menu.jsp # 2 -

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
%@ taglib uri=/psa-taglib.tld prefix=psa %

psa:menu pageName=%= request.getParameter(pageName) %/

-






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



Reversing the mapping between content-JSPs and Tiles definition

2003-09-10 Thread Marco Tedone
Hi guys,

as you'll probably know, I'm realizing a utility to realize a search in a
web site using Struts and Tiles. I'm nearly there. The only problem I've got
is that the indexed pages are the one containing actually the content (let's
say contenta-body.jsp, contentb-body.jsp), while the pages mapped against a
Forward are usually JSPs which define a Tiles definition (i.e. named
contenta.jsp, content.jsp), which, therefore, are empty.

Now, I would need, starting from a JSP with content defined in the
tiles-definition configuration file, to retrieve the page to which it
belongs to. For instance:

contenta-body.jsp - contenta.jsp
contentb-body.jsp - contentb.jsp

I presume that, like struts configuration information can be retrieved from
the ModuleConfig object, than the tiles-definition information can be
retrieved in some TilesConfig object.

I would need access to Tiles API and possibly documentation, but I don't
know if this is part of the Struts project, or a project itself, and where
to find eventually code and Javadoc.

Could please someone give me advise on it?

Thanks,

Marco




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



Client side validation when using validation against Action path

2003-09-10 Thread Yuan, Saul (TOR-ML)
Hi,

I'm using the Validator to validate against an action path (rather than
a form), it works fine on the server side. But it doesn't work on the
client side using javascript. All the javascripts are spitted out as
text, I noticed the starting and ending script tag is missing in the
generated javascript. I wonder what the problem could be. I have the
following in my jsp file:


html:form action=/addAsset.do enctype=multipart/form-data
onsubmit=return validateAssetForm(this);


html:javascript formName=assetForm dynamicJavascript=true
staticJavascript=true /


and should I use addAsset or /addAsset for the formName attribute?
It doesn't work either.


thanks,

Saul

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



Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Jing Zhou

- Original Message - 
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]; Jing
Zhou [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 12:12 PM
Subject: Re: What's the best strategy to handle this kind of thread issues?


 On Wed, 10 Sep 2003, Jing Zhou wrote:

  Date: Wed, 10 Sep 2003 02:16:49 -0500
  From: Jing Zhou [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
   Jing Zhou [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: What's the best strategy to handle this kind of thread issues?
 
  As we realize so far, a browser window may send
  request A to a server. The server starts thread A
  to handle it. Before the thread A returns, the same
  window may send request B to the server, therefore
  the server creates thread B to handle it.
 

 Technically, the threads are usually there already in a pool, rather than
 being created, but that is not really relevant to your question.

 The only ways the same browser window can send more than one request
 (in the manner you describe) are:
 (a) User presses STOP and then manually triggers a second request.
 (b) A page includes one or more tags like img that fire
 off parallel requests for each image
 (c) Window includes multiple frames (the frames themselves
 are often loaded with parallel requests) just like (b)
 (d) JavaScript techniques similar in (b) that are used by the client
 to reassemble the output.

 So the answer to your question really depends on which use case we're
 talking about.  In scenario (a), thread A will continue to run the
 original request, because the server has no way to know that the user
 pressed STOP.  Because the client has closed the TCP connection, the
 servlet will generally encounter an I/O exception when writing out the
 response -- but if the response fits inside a buffer, it might not be seen
 until after the servlet returns.

What we found in IE 6.0 sp1 is that end users do not have to press STOP
and then manually trigger a second request. They could just press buttons
in a web form and trigger different requests to the server. Is this a bug
in IE 6.0? (The scenario (a) looks correct in IE 5.0)

If we regard this scenario as (a+), then we know thread A could still be
executing in its valid mode (not cancelled or to-be-cancelled) after
thread B returns.


 In scenarios (b) - (d) the requests run in parallel and the client
 assembles the resulting page.


  Assuming thread B finishes earlier than thread A, we
  could have the following possibilities:
 
  1) The server waits thread A to finish and send response A
  and then send response B. (I do not believe this is the
  Tomcat implementation, correct?)
 
  2) The server sends response B back to the browser
  window and the browser window displays it and ignores
  response A after it.
 
   3) The browser displays response B and then displays
  response A.
 
  What I can see is that thread B is the trouble maker. But it
  is possible when end users click more than one buttons.

 This is my scenario (a) use case, and behaves as I described above.

  In Swing, such problems are resolved by Single Thread
  Model. Should we follow Single Thread Model at
  servers? Are there any other practical solutions to it out
  there?

 The key problem in dealing with scenario (a) is detecting that it has
 even happened.  The most important case is when you're doing a POST that
 updates the database -- for example, you don't want an order to be
 submitted twice simply because the user pressed SUBMIT, hit the back
 arrow, and pressed SUBMIT again.  The transaction token facility
 provided by Struts can be used to detect the second submit.


When dealing scenario (a+), thread B returns an error message from
our custom token facility. The browser window displays it (Fine). But the
window does not display any more responses from thread A. Is this
the supposed behaviors of browser windows or another bug in IE?
It is terrible anyway.

 Note that there is an API called SingleThreadModel in servlets, but it
 has nothing to do with this kind of problem, and should be avoided anyway
 (it's being deprecated in Servlet 2.4) because it doesn't really solve all
 of the problems that it tries to solve.


The Servlet API about SingleThreadModel is irrelevant to our problems.
I am thinking if we could block thread B or cancel it using a Filter at
server sides
with a concept similar to Swing. Such ideas could be very wrong as
I explained in my message, due to exception handlings.

 
 
  Jing
  Netspread Carrier
  http://www.netspread.com
 
 
 

 Craig


 -
 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 

RE: Tiles problem?

2003-09-10 Thread Yann Lebreton
My understanding with tiles is that they act like a server-side include. 
Meaning they are self contained and therefore doesn't know anything of the page that 
called it.

As a result whatever you place in the page scope should not be known by the tile since 
it's a different page. So, it should never have worked.

Yann

-Original Message-
From: Roland Berger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 1:01 AM
To: Struts Users Mailing List
Subject: AW: Tiles problem?


Well, the tile which is referenced with the attribute billingAddress is
found. The problem starts latter. Again the hole story  in short:

- The code is working with sturts 1.1 beta xy? Sorry I can not find out
which beta it was. Now I use 1.1 final.

- My tiles definitions are in a seprate file -- tiles-defs.xml
- I hava a master layout jsp page where usually only the body part is
changing.
- One of the body tiles is called: let's say 'tile1' referencing a jsp page:
let's say page1
- I have another tile (tile2) referencing page2 which is inserted in tile1

The structure of the pages is as follows (Comments start with ***):

page1 (tile1):

html:form action=/RegisterAddressAction.do
*** RegisterAddressAction.do works with an actionformbean ( lets call it
AFB1 which isdefined in struts-config.xml) which has a getter to get orderFB
nested:nest property=orderFB
  nested:text property=billingEqualShippingAddress /
/nested:nest
*** -- Cedric told me I can not use tiles in a nested context. -- so I
close the nested context before tiles:insert
tiles:insert  attribute=tile2/
/html:form

page2 (tile2):

*** because the information I want to display is in
AFB1--orderFB--orderBean I start to nest again in tile2

 nested:nest property=orderFB
 nested:nest property=orderBean

*** here the problem starts. the property invoiceCompany can not be
displayed because it seems that the AFB1, orderFB or orderBean are not found
in any scope. The error which is displayed here is: [ServletException
in:/WEB-INF/pages/JSPPage2.jsp] Cannot find bean in any scope'

  nested:text property=invoiceCompany size=50 maxlength=50/
  /nested:nest
  /nested:nest


Again, this code is working with beta versions of struts 1.1.

Any hints?

Thank you
Roland



-Ursprüngliche Nachricht-
Von: Yann Lebreton [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 9. September 2003 19:22
An: Struts Users Mailing List
Betreff: RE: Tiles problem?


you could pass it along with the tile.

  tiles:insert attribute=billingAddress 
tiles:put name=billing beanName=.../
  /tiles:insert

or re-access it from whichever scope it was put in.

Yann

-Original Message-
From: Roland Berger [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 8:22 AM
To: Struts
Subject: Tiles problem?


Hi all

I have JSP code which used to work with older struts versions (1.1 beta xy).
Now I use struts 1.1 stable release.

I have  two jsp pages. I want to nest JSPPage2 into JSPPage1 with
tiles:insert ( see JSPCode ). All I get is [ServletException
in:/WEB-INF/pages/JSPPage2.jsp] Cannot find bean in any scope'
With debugging I have found out that JSP Page 2 losses the parent context (I
mean the bean which is assosiated to the /RegisterAddressAction.do action in
struts-config.xml). How can I handle over the parent context to the nested
JSPPage2 tile?


Thanks for any help
Roland

JSPPage1
--
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested %
%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

nested:form action=/RegisterAddressAction.do
nested:nest property=orderFB
table width=100% border=0 cellspacing=1
  tr
td class=subtitlebean:message
key=jsp.registerAddress.title//td
td class=subtitle width=20%html:image
property=method_continueShopping
src=images/16x16/normal/Purchases-txweitereinkaufen.gif
titleKey=common.tooltip.continueShopping
align=absbottom/html:image/td
  /tr
/table
pbean:message key=jsp.registerAddress.text1//p
  span class=kleineSchriftbean:message
key=common.label.mustFields//span/p
p
  nested:checkbox property=billingEqualShippingAddress value=true
/bean:message key=jsp.registerAddress.text2/
/p
  /nested:nest

***
  tiles:insert attribute=billingAddress /
***

  table width=100% border=0 cellspacing=1
  tr
td width=30%nbsp;/td
td width=2%nbsp;/td
tdhtml:image property=method_submitAddresses
src=images/16x16/normal/Forward-2-txweiter.gif
titleKey=common.tooltip.next align=absbottom/html:image/td
  /tr
  /table
  /nested:form
 end JSPPage1


JSPPage2 (is referenced by   tiles:insert attribute=billingAddress /
)
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested %

 nested:nest property=orderFB
 nested:nest property=orderBean
  table 

Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Mike Kienenberger
Jing Zhou [EMAIL PROTECTED] wrote:
 What we found in IE 6.0 sp1 is that end users do not have to press STOP
 and then manually trigger a second request. They could just press buttons
 in a web form and trigger different requests to the server. Is this a bug
 in IE 6.0? (The scenario (a) looks correct in IE 5.0)

No, it just means that triggering a second request implicitly executes a 
stop action first.

-Mike

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



javascript with struts nested fields?

2003-09-10 Thread David G Friedman
In an html page, is there a way to reference a nested form variable without
using array subscripts?

In the web page the client sees, it gets the below:

input type=text name=order.program value=108

I want a pop-up calendar window button next to it that populates that field
with the selected date.  When I switched from program to a nested field
named order.program, it broke.  The program can be referenced by
formName.program but the nested one causes javascript errors trying to
reference it as fornName.order.program.   I don't want to use
fornName.elements[XXX] since any changes to the page layout might reorder
fields and change those array subscripts, making development very messy.
Any suggestions?  I tried formName.order.program but it gave out
Javascript errors.

I've already checked some Javascript 1.1 developer and reference guides from
Netscape and didn't find anything suggesting how to do it this way.

Thanks for any suggestions,
David



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



Re: javascript with struts nested fields?

2003-09-10 Thread news.gmane.org
Why don't you use just formName[order.program] ?


David G Friedman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 In an html page, is there a way to reference a nested form variable
without
 using array subscripts?

 In the web page the client sees, it gets the below:

 input type=text name=order.program value=108

 I want a pop-up calendar window button next to it that populates that
field
 with the selected date.  When I switched from program to a nested field
 named order.program, it broke.  The program can be referenced by
 formName.program but the nested one causes javascript errors trying to
 reference it as fornName.order.program.   I don't want to use
 fornName.elements[XXX] since any changes to the page layout might reorder
 fields and change those array subscripts, making development very messy.
 Any suggestions?  I tried formName.order.program but it gave out
 Javascript errors.

 I've already checked some Javascript 1.1 developer and reference guides
from
 Netscape and didn't find anything suggesting how to do it this way.

 Thanks for any suggestions,
 David




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



RE: Prevent URL requested directly from browser

2003-09-10 Thread veera maria
Thanks Trieu,

I was also thingking about tokens and will try them.
But I'm sure that I have seen a solution for the problem I asked
but can't remember it. So, brain capacity is limited ;)
Br

From: Trieu, Danny [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Prevent URL requested directly from browser
Date: Wed, 10 Sep 2003 08:26:39 -0700
Transaction Token will help, but it will not do everything you want to do.
Max is right, this is the nature of Web application.  Even with Transaction
Token user, if he has a copy of the token, can still create request and hit
your app without the app knowing about.  Plus, not every resource in your
app. Will have a transaction token, even if it is a lot of effort need to 
be
made for every request to check and update token.

-Original Message-
From: veera maria [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 8:20 AM
To: [EMAIL PROTECTED]
Subject: Re: Prevent URL requested directly from browser
Yes... I know quite well the philosophy around this question
but how about the technical implemantation?
Have you any ideas about it?

Has anyone used succesfully tokens to solve this kind of problem?

I have seen technical solution to this kind of problen (and it worked),
but can not remember it's details.
So, please those who have experience give some tips.

Br M.V

From: Max Cooper [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Prevent URL requested directly from browser
Date: Tue, 9 Sep 2003 18:06:04 -0700

Keep these things in mind as you develop a solution:

1. There is absolutely no way to prevent users from making whatever
requests
they want. Bookmarking, typing in URLs, emailing URLs, etc. are all
possible
and there is nothing that can be done to prevent people from making these
requests.

2. You do have total control over how your web app responds to those
requests.

-Max

- Original Message -
From: veera maria [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 11:11 AM
Subject: Prevent URL requested directly from browser


  Hello,
 
  What is the best way to prevent user to request web application's
  actions from browser manually?
 
  E.g. user is using web application and taking it's current url
  to clipboard. Then user goes e.g. to Google for surfing for a while.
  After surfing (s)he pastes web applications url back to browser's
  address field.
  Best technique in Struts applicaton to prevent this?
 
  Vera
 
  _
  Tilaa nyt Hotmail postit kännykkääsi! http://www.msn.fi/mobiili/
 
 
  -
  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]

_
MSN Messenger - kaikki ystävät klikkauksen päässä! Lataa tästä ilmaiseksi.
http://www.msn.fi/viestintapalvelut/Messenger
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message and any attachments are for the intended recipient(s) only and 
may contain privileged, confidential and/or proprietary information about 
Downey Savings or its customers, which Downey Savings does not intend to 
disclose to the public. If you received this message by mistake, please 
notify the sender by reply e-mail and delete the message and attachments.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
MSN Messenger - kaikki ystävät klikkauksen päässä! Lataa tästä ilmaiseksi. 
http://www.msn.fi/viestintapalvelut/Messenger

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


RE: JavaScript with struts nested fields?

2003-09-10 Thread David G Friedman
Thanks.  That works well.  I didn't see that in my
documentation: ClientReferenceJS13.pdf. :)  But hey,
I'll take anything that's clear, simple, and works.

-David

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of news.gmane.org
Sent: Wednesday, September 10, 2003 3:24 PM
To: [EMAIL PROTECTED]
Subject: Re: javascript with struts nested fields?


Why don't you use just formName[order.program] ?


David G Friedman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 In an html page, is there a way to reference a nested form variable
without
 using array subscripts?

 In the web page the client sees, it gets the below:

 input type=text name=order.program value=108

 I want a pop-up calendar window button next to it that populates that
field
 with the selected date.  When I switched from program to a nested field
 named order.program, it broke.  The program can be referenced by
 formName.program but the nested one causes javascript errors trying to
 reference it as fornName.order.program.   I don't want to use
 fornName.elements[XXX] since any changes to the page layout might reorder
 fields and change those array subscripts, making development very messy.
 Any suggestions?  I tried formName.order.program but it gave out
 Javascript errors.

 I've already checked some Javascript 1.1 developer and reference guides
from
 Netscape and didn't find anything suggesting how to do it this way.

 Thanks for any suggestions,
 David




-
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: Suggested enhancements for next version

2003-09-10 Thread David Thielen
ok - will do - thanks

- Original Message - 
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 11:28 AM
Subject: Re: Suggested enhancements for next version


 On Wed, 10 Sep 2003, David Thielen wrote:

  Date: Wed, 10 Sep 2003 10:22:10 -0600
  From: David Thielen [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts-Users [EMAIL PROTECTED]
  Subject: Suggested enhancements for next version
 
  Hi;
 
  These are a couple of suggestions I have for the next version of struts:

1.. Can get the session in the ActionForm constructor. This would be
  very useful for initializing with data attached to the session.

2.. Have a pre-page method in the Action that can be set in an
  action like validate=true. This would give the Action class a chance
  to determine if this page can be displayed and do a forward if it
  cannot. For example in pages 2 - N of a multi-page series of forms.

3.. Allow an action with no form. This would be useful where a page
  has a form that is just a submit button. No ActionForm is needed but the
  html:form is still prefered for the action it submits to. thanks -
  dave

 The best way to record suggestions like this is to put enhancement
 requests into our issue tracking system:

   http://nagoya.apache.org/bugzilla/

 Craig

 -
 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: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Jing Zhou

- Original Message - 
From: Mike Kienenberger [EMAIL PROTECTED]
To: Jing Zhou [EMAIL PROTECTED]; Struts Users Mailing List
[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 1:56 PM
Subject: Re: What's the best strategy to handle this kind of thread issues?


 Jing Zhou [EMAIL PROTECTED] wrote:
  What we found in IE 6.0 sp1 is that end users do not have to press STOP
  and then manually trigger a second request. They could just press
buttons
  in a web form and trigger different requests to the server. Is this a
bug
  in IE 6.0? (The scenario (a) looks correct in IE 5.0)

 No, it just means that triggering a second request implicitly executes a
 stop action first.


The behaviors of IE browser windows will always STOP the first
request explicitly or implicitly before sending the second request.
It looks right. If so, there is no way/need to block or cancel thread B.
Just let it return error message and then we find a way to pull out the
calculated results from thread A, if any interesting things had happened.

 -Mike


Jing


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



Re: can somebody explain this to me?

2003-09-10 Thread Robert Upshall
Pady Srinivasan wrote:
Is the pageName attribute defined with rtexprvalue set to true in the tld ?

Thanks allot!!!  That was it, I have never needed to use that before, 
didn't even know there was such a thing :)

Thanks again,
Robert

Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: Robert Upshall [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2003 2:16 PM
To: Struts Users Mailing List
Subject: can somebody explain this to me?

I am attempting to convert a site to work with the struts tiles taglib. 
  Below are 2 copies of a menu.jsp file that is being use in a template 
with the tiles:put directive.  The top one is a hack that works and the 
bottom is what I would like to do if I could get it working.

Is there any way to get the menu.jsp #2 working? What happenes when I 
try to use #2 is that %= request.getParameter(pageName) % is passed 
into the psa:menu tag not the value that it resolves to.

Thanks,
Robert


-- menu.jsp # 1 -
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
%@ taglib uri=/psa-taglib.tld prefix=psa %
%
String pageName = request.getParameter(pageName);
if (pageName == null)
  pageName = ;
%
% if (pageName.trim().toUpperCase().equals(INDEX)) { %
 psa:menu pageName=INDEX/
% } else if (pageName.trim().toUpperCase().equals(HOME)) { %
 psa:menu pageName=HOME/
% } else if (pageName.trim().toUpperCase().equals(ACCTINFO)) { %
 psa:menu pageName=ACCTINFO/
% } else if (pageName.trim().toUpperCase().equals(BILLPAY)) { %
 psa:menu pageName=BILLPAY/
% } else if (pageName.trim().toUpperCase().equals(ABOUT)) { %
 psa:menu pageName=ABOUT/
% } else { %
 psa:menu pageName=/
% } %
-



-- menu.jsp # 2 -

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
%@ taglib uri=/psa-taglib.tld prefix=psa %
psa:menu pageName=%= request.getParameter(pageName) %/

-





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



--

Robert Upshall
Professional Software of Amarillo
(806) 358-8928
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


java.util.Date in a Bean/ActionForm

2003-09-10 Thread Cees van de Griend
L.S.

I'm new at Struts, but I got it working.

I've an simple Bean with a java.util.Date property and the set and get methods 
with to set/get the java.util.Date values. I've an (almost) working 
ActionForm with the same properties.

In a Action I use somthing like: 
org.apache.commons.beanutils.PropertyUtils.copyProperties(form, bean) to copy 
all the properties from the bean to the form and forward to a JSP page to 
edit the properties in an HTML-form. So far, all is well; the date is 
displayed like '2003-09-10' in an text-field.

If I submit this page, a 'IllegalArgumentException: argument type mismatch' is 
thrown. If I remove all the java.util.Date code, all is working as expected.

Clearly I'm doing something wrong with the java.util.Date.

What is the best way to get a date from a HTML-form to a Bean?

Regards,
Cees.

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



YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread Gregory F. March

I seem to have successfully pushed Struts in my company (a big Wall
St. bank).  However, today, I was asked the following question:

How can I guarantee that there are no hacks, bombs, etc. in the
Struts code or any OS code for that matter?

My immediate response was, how can you guarantee it for any code?
However, being a large bank with literally trillions of dollars a day
passing though our systems, I can definitely understand their concern.

At a minimum, we will obtain the source code and at least do a minimal
code walk-through and then compile our own binaries.

What other guarantees can I make to my management?  What is the process
the Struts team uses to control a rogue contributor?

Thanks,

/greg

--
Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet

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



RE: java.util.Date in a Bean/ActionForm

2003-09-10 Thread Matt Raible
I've accomplished this by registering a DateConverter in a static block.

From my BaseManager.java class:

static {
   ...
   ConvertUtils.register(new DateConverter(), Date.class);
   ...
}

DateConverter.java

public class DateConverter implements Converter {
//~ Instance fields


/** Log instance for this class */
private Log log = LogFactory.getLog(DateConverter.class);

//~ Methods


/**
 * Convert a String to a Date and a Date to a String
 *
 * @param type the class type to output
 * @param value the object to convert
 * @return object the converted object (Date or String)
 */
public final Object convert(final Class type, final Object value) {
log.debug(entered method);
// for a null value, return null
if (value == null) {
return null;
} else {
if (value instanceof String) {
log.debug(value ( + value + ) instance of
String);

try {
if
(StringUtils.isEmpty(value.toString())) {
return null;
}

return
DateUtil.convertStringToDate(value.toString());
} catch (ParseException pe) {
pe.printStackTrace();
}
} else if (value instanceof Date) {
log.debug(value ( + value + ) instance of
Date);

return DateUtil.convertDateToString((Date)
value);
}
}

throw new ConversionException(Could not convert 
  +
value.getClass().getName() +  to 
  +
type.getName() + !);
}
}

-Original Message-
From: Cees van de Griend [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 2:00 PM
To: Struts Users
Subject: java.util.Date in a Bean/ActionForm


L.S.

I'm new at Struts, but I got it working.

I've an simple Bean with a java.util.Date property and the set and get
methods 
with to set/get the java.util.Date values. I've an (almost) working 
ActionForm with the same properties.

In a Action I use somthing like: 
org.apache.commons.beanutils.PropertyUtils.copyProperties(form, bean) to
copy 
all the properties from the bean to the form and forward to a JSP page to 
edit the properties in an HTML-form. So far, all is well; the date is 
displayed like '2003-09-10' in an text-field.

If I submit this page, a 'IllegalArgumentException: argument type mismatch'
is 
thrown. If I remove all the java.util.Date code, all is working as expected.

Clearly I'm doing something wrong with the java.util.Date.

What is the best way to get a date from a HTML-form to a Bean?

Regards,
Cees.

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



Quick template question

2003-09-10 Thread Stephane Grenier
Hello all.

I've got the following template file:

%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %
template:insert template='/tilesExample.jsp'
 template:put name='title' content='Templates' direct='true'/
 template:put name='header' content='/header.html' /
 template:put name='sidebar' content='/menu.html' /
 template:insert name='content' content='/content.html' /
 template:put name='footer' content='/footer.html' /
/template:insert

Is there a mechanism to have just one file rather than 2 seperate files for the 
content ? Is it possible to at least replace the line:

 template:insert name='content' content='/content.html' /

with just the html code for that page directly in this file ? And if so how would I do 
that ?

Thank you,
Stephane




Valid Regexp for MM/dd/yyyy matching in a string?

2003-09-10 Thread David Erickson
Here is what I came up with.. I don't know if its valid or not but I'd like
it to match a date in the format MM/dd/ for parsing.

var-namemask/var-name

var-value^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$/var-value



Thanks!

-David




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



Integer Validator

2003-09-10 Thread Srinivas Gunturu
All,

I have following validation rule defined on my form.  medication.drugText is getting 
validated.  However medication.formCode is not being enforced as required.

form name=wrongFormForm
   field property=medication.drugText depends=required
   arg0 key=prompt.medication.drugText /
   /field
   field property=medication.formCode depends=required,integer
arg0 key=prompt.medication.dosageForm /
   /field
/form 

My Medication bean returns an Integer for getFormCode().  Any idea why would the 
validation not work.  I can post more of my code if needed.

TIA.

Srinivas




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



Re: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread David Graham
--- Gregory F. March [EMAIL PROTECTED] wrote:
 
 I seem to have successfully pushed Struts in my company (a big Wall
 St. bank).  However, today, I was asked the following question:
 
 How can I guarantee that there are no hacks, bombs, etc. in the
 Struts code or any OS code for that matter?
 
 My immediate response was, how can you guarantee it for any code?
 However, being a large bank with literally trillions of dollars a day
 passing though our systems, I can definitely understand their concern.
 
 At a minimum, we will obtain the source code and at least do a minimal
 code walk-through and then compile our own binaries.
 
 What other guarantees can I make to my management?  What is the process
 the Struts team uses to control a rogue contributor?

There are rather few committers than can change the code base (roughly
10-15 people).  All commits are mailed to struts-dev for the team to
review.  Even if Struts were secretly hacked, it isn't all that much code
to review anyways (about 14,000 lines of non-test/example code).  You
could narrow your code review to only the packages you'll actually be
using.

You will always have access to the source to do security reviews unlike
proprietary commercial software :-).

David

 
 Thanks,
 
 /greg
 
 --
 Gregory F. March-=-http://www.gfm.net:81/~march-=-   
 AIM:GfmNet
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread David Graham
--- David Graham [EMAIL PROTECTED] wrote:
 --- Gregory F. March [EMAIL PROTECTED] wrote:
  
  I seem to have successfully pushed Struts in my company (a big Wall
  St. bank).  However, today, I was asked the following question:
  
  How can I guarantee that there are no hacks, bombs, etc. in the
  Struts code or any OS code for that matter?
  
  My immediate response was, how can you guarantee it for any code?
  However, being a large bank with literally trillions of dollars a day
  passing though our systems, I can definitely understand their concern.
  
  At a minimum, we will obtain the source code and at least do a minimal
  code walk-through and then compile our own binaries.
  
  What other guarantees can I make to my management?  What is the
 process
  the Struts team uses to control a rogue contributor?
 
 There are rather few committers than can change the code base (roughly
 10-15 people).  All commits are mailed to struts-dev for the team to
 review.  Even if Struts were secretly hacked, it isn't all that much
 code
 to review anyways (about 14,000 lines of non-test/example code).  

Actually, that line count may be incorrect.  I was using an Eclipse plugin
for the metrics but the numbers don't seem to add up.  The point is that
it's a *relatively* small amount of code.

You
 could narrow your code review to only the packages you'll actually be
 using.
 
 You will always have access to the source to do security reviews unlike
 proprietary commercial software :-).
 
 David
 
  
  Thanks,
  
  /greg
  
  --
  Gregory F. March-=-http://www.gfm.net:81/~march-=-   
  AIM:GfmNet
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: Serializing ActionForm (Urgent)

2003-09-10 Thread António Santos

Hi Andrew and Gin,

Thanks for your help. I will try to use intermediate DTOs (simple Javabeans)
and hope that AXIS serialize them well (I'm afraid about FormFile). However,
and since ActionForms comply to the JavaBean specification, I was wondering if
it would be a good idea to have this serialization problem fixed. I don't
think that it's that handy to have ActionForms to hold the data entered in a
HTML form and then having to copy the data to a simple DTO in the Action class
in order to have it serialized and sent through an RPC.

Thanks for your tips,

António Santos
FEUP - Portugal

---

Hmm. I was about to finger the ActionServlet reference, and the
MultipartRequestWrapper ref, but they are both transient, so can't be
causing the problem.
My next suspect would be the FormFile (but its the actionservletwrapper its
listing in the except... ahhh... but of course its a wrapper - not the ref
itself - the ActionServlet reference is transient, but the *wrapper* object
a new instance of which is returned on each call to getServletWrapper()
doesnt implement Serializable.

Hmm. You cant do much about that. IMHO given that ActionForm claims to
implement Serializable, thats would be a bug!

silly-idea
heres a nasty hack: Perhaps you could add a transient field to your action
form:

public transient boolean _disableWrapper = false;

And override getServletWrapper thusly:

public ActionServletWrapper getServletWrapper()
{
 return _disableWrapper ? null : super.getServlet();
}

Prior to serialisation set the field to true. Serialise and then set it
back.

Oh and lose the formfiles, as for sure they will be the next problem -
unless you make their fields transient in your form.
/silly-idea

Why on earth are you using an ActionForm as a parameter to an RPC though?
ActionForms are VIEW components. Very bad karma to use them as DTOs.

better-idea
You would do better to create a normal bean class with the properties you
want and serialise that (you can use PropertyUtils.copyProperties() to
transfer the data from the ActionForm to the DTO if you dont fancy a lot of
typing...).
/better-idea


---

I'm assuming it's a configuration issue with your AXIS implementation.
But rather then get into that... why not just create a interim bean that
will store the data then BeanUtil.copyProperties it back to the ActionForm?
-Tim


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



RE: Valid Regexp for MM/dd/yyyy matching in a string?

2003-09-10 Thread Andy Kriger
Looks like it should work, you might need to escape the slashes.

It's easy enough to test either by using grep on the command line (which is
not the best test since there are differences btw Unix regexp and Java
regexp) or by writing a test class that uses the ORO library (Validator
doesn't use the Java regexp package) or by using the ORO test applet at
http://jakarta.apache.org/oro/demo.html.

-Original Message-
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 16:28
To: Struts Mailing List
Subject: Valid Regexp for MM/dd/ matching in a string?


Here is what I came up with.. I don't know if its valid or not but I'd like
it to match a date in the format MM/dd/ for parsing.

var-namemask/var-name

var-value^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$/var-value



Thanks!

-David




-
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: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread Vic Cekvenic
This is almost a Linux vs Windows: which is more secure/ the one that 
has millions of user eyes on the code!

In commercial code, a bomb is very easy and possible. In OS, unlikely.
I would also bet that given any industry (banks for ex), Struts is the 
most popular in production use.
I know a few large banks using Struts I am sure that they did due 
process.

But if PHB does not want to use it, they don't want to use it. Maybe sit 
in a legal review to negotiate a proprietary framework license suits 
them, with no?? access to source.

.V

- may the source be with you

Gregory F. March wrote:
I seem to have successfully pushed Struts in my company (a big Wall
St. bank).  However, today, I was asked the following question:
How can I guarantee that there are no hacks, bombs, etc. in the
Struts code or any OS code for that matter?
My immediate response was, how can you guarantee it for any code?
However, being a large bank with literally trillions of dollars a day
passing though our systems, I can definitely understand their concern.
At a minimum, we will obtain the source code and at least do a minimal
code walk-through and then compile our own binaries.
What other guarantees can I make to my management?  What is the process
the Struts team uses to control a rogue contributor?
Thanks,

/greg

--
Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet


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


[OT] RE: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread Chen, Gin
Offer them kool aid.
It will make them feel better.
Write 'Struts Good' in the bottom of the cups though.
Now they associate the good taste of kool aid with Struts!

-Tim

-Original Message-
From: Gregory F. March [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 4:09 PM
To: [EMAIL PROTECTED]
Subject: YASJR (Yet Another Struts Justification Request)



I seem to have successfully pushed Struts in my company (a big Wall
St. bank).  However, today, I was asked the following question:

How can I guarantee that there are no hacks, bombs, etc. in the
Struts code or any OS code for that matter?

My immediate response was, how can you guarantee it for any code?
However, being a large bank with literally trillions of dollars a day
passing though our systems, I can definitely understand their concern.

At a minimum, we will obtain the source code and at least do a minimal
code walk-through and then compile our own binaries.

What other guarantees can I make to my management?  What is the process
the Struts team uses to control a rogue contributor?

Thanks,

/greg

--
Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet

-
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: [OT] RE: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread jlord





Unless you get the Kool-aid from Jim Jones; in which case they would
associate the taste of Kool-aid with being dead.  ;-)


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



RE: Valid Regexp for MM/dd/yyyy matching in a string?

2003-09-10 Thread Chen, Gin
That doesnt look very Y3K compliant :-P
If you have complex logic then best thing to do is to create a custom date
validator.
The code would be really simple and will catch cases where people might
enter in:

19/39/1000

Btw.. why not just use the date validator? It will handle exactly that
format easily

-Tim

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 4:44 PM
To: Struts Users Mailing List
Subject: RE: Valid Regexp for MM/dd/ matching in a string?


Looks like it should work, you might need to escape the slashes.

It's easy enough to test either by using grep on the command line (which is
not the best test since there are differences btw Unix regexp and Java
regexp) or by writing a test class that uses the ORO library (Validator
doesn't use the Java regexp package) or by using the ORO test applet at
http://jakarta.apache.org/oro/demo.html.

-Original Message-
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 16:28
To: Struts Mailing List
Subject: Valid Regexp for MM/dd/ matching in a string?


Here is what I came up with.. I don't know if its valid or not but I'd like
it to match a date in the format MM/dd/ for parsing.

var-namemask/var-name

var-value^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$/var-value



Thanks!

-David




-
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: Valid Regexp for MM/dd/yyyy matching in a string?

2003-09-10 Thread Dhaliwal, Pritpal (HQP)

Very new to the list, so be easy if I mess up..

Why not use the Calendar class? 

Pritpal

-Original Message-
From: Chen, Gin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2003 2:01 PM
To: 'Struts Users Mailing List'
Subject: RE: Valid Regexp for MM/dd/ matching in a string?


That doesnt look very Y3K compliant :-P
If you have complex logic then best thing to do is to create a custom date
validator. The code would be really simple and will catch cases where people
might enter in:

19/39/1000

Btw.. why not just use the date validator? It will handle exactly that
format easily

-Tim

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 4:44 PM
To: Struts Users Mailing List
Subject: RE: Valid Regexp for MM/dd/ matching in a string?


Looks like it should work, you might need to escape the slashes.

It's easy enough to test either by using grep on the command line (which is
not the best test since there are differences btw Unix regexp and Java
regexp) or by writing a test class that uses the ORO library (Validator
doesn't use the Java regexp package) or by using the ORO test applet at
http://jakarta.apache.org/oro/demo.html.

-Original Message-
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 16:28
To: Struts Mailing List
Subject: Valid Regexp for MM/dd/ matching in a string?


Here is what I came up with.. I don't know if its valid or not but I'd like
it to match a date in the format MM/dd/ for parsing.

var-namemask/var-name

var-value^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$/var-value



Thanks!

-David




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



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



Re: Valid Regexp for MM/dd/yyyy matching in a string?

2003-09-10 Thread Michael Ruppin
This might provide more ideas for your regexp pattern, it works with egrep:
 
^((0?[1-9]{1})|(1[0-2]{1})){1}[/]((0?[1-9]{1})|(1[0-9]{1})|(2[0-9]{1})|(3[0-1]{1})){1}[/][0-9]{4}$
 
Not sure about the date validator.  Does it prevent submission of 2/29/2003?  I do 
everything server side ;)
 
m

David Erickson [EMAIL PROTECTED] wrote:
Here is what I came up with.. I don't know if its valid or not but I'd like
it to match a date in the format MM/dd/ for parsing.

mask

^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$



Thanks!

-David




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


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

RE: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread naveen . joshi
YES, We at Citibank use Struts extensively and i know that our auditors did 
the review and gave the good feed back. We all love this framwork. 

But, Currently i'am running in to small production problem because of the JDK 
change in Weblogic SP4 and i have no one to help me out resolving it, rather 
i'am getting some workaround ways from the groups which i cannot do 'cos i have 
almost 80 modules to change and almost 1000 properties to be changed. Can 
struts guru's look at the problem i posted 2 days back with the Subject  
Struts 1.0 problem.

Thanks
Naveen

-Original Message-
From: cekvenich.vic [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 2:45 PM
To: struts-user; cekvenich.vic
Subject: Re: YASJR (Yet Another Struts Justification Request)


This is almost a Linux vs Windows: which is more secure/ the one that 
has millions of user eyes on the code!

In commercial code, a bomb is very easy and possible. In OS, unlikely.
I would also bet that given any industry (banks for ex), Struts is the 
most popular in production use.
I know a few large banks using Struts I am sure that they did due 
process.

But if PHB does not want to use it, they don't want to use it. Maybe sit 
in a legal review to negotiate a proprietary framework license suits 
them, with no?? access to source.


.V

- may the source be with you

Gregory F. March wrote:
 I seem to have successfully pushed Struts in my company (a big Wall
 St. bank).  However, today, I was asked the following question:
 
 How can I guarantee that there are no hacks, bombs, etc. in the
 Struts code or any OS code for that matter?
 
 My immediate response was, how can you guarantee it for any code?
 However, being a large bank with literally trillions of dollars a day
 passing though our systems, I can definitely understand their concern.
 
 At a minimum, we will obtain the source code and at least do a minimal
 code walk-through and then compile our own binaries.
 
 What other guarantees can I make to my management?  What is the process
 the Struts team uses to control a rogue contributor?
 
 Thanks,
 
 /greg
 
 --
 Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet



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



DynaForms and validation

2003-09-10 Thread Barry Volpe
Hi,

I have setup a DynaActionForm and wish to perform validation.
How is this done when I do not have an ActionForm which requires
extending org.apache.struts.validator.ValidatorActionForm 

Thanks,
Barry

RE: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread Steve Raeburn
Congratulations and thanks for evangalising Struts to your organization.

 How can I guarantee that there are no hacks, bombs, etc. in the
 Struts code or any OS code for that matter?

The clue is in the title - OPEN source :-)

If open source has a weakness it certainly is not that anyone is hiding
things in the code.

If they're worried about rogue committers -- and I'd say we're probably all
rogues ;-) -- you can monitor the struts-dev list and be notified of every
single change to the codebase as it happens. I bet you can't get that level
of reassurance from any commercial vendor.

Out of interest, what web server is your bank running its website on?
Apache, by any chance? :-)

Steve



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



RE: DateUtil

2003-09-10 Thread Matt Raible
I created it myself - here's the method you're looking for:

  /**
 * This method converts a String to a date using the pattern
MM/dd/
 *
 * @param strDate the date to convert 
 * @return a date object
 *
 * @throws ParseException exception thrown when formatting fails
 */
public static Date convertStringToDate(String strDate)
  throws ParseException {

SimpleDateFormat df = new SimpleDateFormat(MM/dd/);
Date date = null;

if (log.isDebugEnabled()) {
log.debug(converting ' + strDate + ' to date);
}

try {
date = df.parse(strDate);
} catch (ParseException pe) {
log.error(ParseException:  + pe);
throw new ParseException(pe.getMessage(),
pe.getErrorOffset());
}

return date;
}

-Original Message-
From: Cees van de Griend [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 3:11 PM
To: Matt Raible
Subject: DateUtil


Hello Matt,

I can't find the class DateUtil.
Could you tell me where you found it or send the code to me?

TIA,
Cees.

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



Strange filter problem?

2003-09-10 Thread Bjørn T Johansen
Hi..

I am trying to write my very first filter running on Tomcat, but when I
include the definition of the filter in my web.xml file, I get this
exeption..:

org.apache.jasper.JasperException: File /tags/struts-logic not found

at 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:105)
at 
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430)
at 
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:180)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795)
at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at 
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)

When I remove the filter def, everything works again...

Any suggestions?

Btw, does using filter drain much performance? Is there any other way to ensure 
that one can't access the jsp files without being logged in? A bean in every jsp page?


Cheers,

BTJ


html:form; action attribute problem

2003-09-10 Thread Kumar M
Hi all,

I have a question re the action attribute of a html:form.  The html:form is 
spread over a few tiles. Currently, its value is populated using a run time 
expression

html:form action='%= (String)request.getAttribute(FORM_ACTION) %' 
method=POST

But some times, the page that I need to display may not have any associated 
mapping. But the problem is I cannot seem to find a way to indicate that to 
struts. If there is no FORM_ACTION attribute on the request I get a NPE. If 
I put something generic then I would have to create a dummy mapping by that 
name.

How do I check to see if FORM_ACTION is null and then insert the action 
attribute (or not).

Thanks in advance.

_
Get a FREE computer virus scan online from McAfee. 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re: YASJR (Yet Another Struts Justification Request)

2003-09-10 Thread Craig R. McClanahan
On Wed, 10 Sep 2003, Gregory F. March wrote:

 [snip]
 What other guarantees can I make to my management?  What is the process
 the Struts team uses to control a rogue contributor?

The only potential rogue contributor that could possibly affect
things is someone who has commit access on the CVS repositories (there's
roughly 20 people with commit access on Struts, about half of that number
is active recently).  Any contribution from anyone else has to be go
through a committer before it actually becomes part of Struts.

In addition, all commits of changes to the codebase by *any* committer are
mailed to the STRUTS-DEV list, and are thus available for inspection by
all of us.  No surprises.

A more strategic mechanism relates to how committers become committers in
the first place -- by being voted in by the other committers on that
project, after having demonstrated themselves to be both smart and
trustworthy.  All of the current committers went through this gauntlet,
and I have a high degree of confidence that we don't have any closet
rogues in our midst :-).

For more info on how Apache projects (including Jakarta, which includes
Struts) make decisions and do things, you might find the following stuff
interesting:

  http://jakarta.apache.org/site/guidelines.html

 Thanks,

 /greg

Craig

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



Re: What's the best strategy to handle this kind of thread issues?

2003-09-10 Thread Craig R. McClanahan
On Wed, 10 Sep 2003, Jing Zhou wrote:

 Date: Wed, 10 Sep 2003 13:49:18 -0500
 From: Jing Zhou [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Cc: Craig R. McClanahan [EMAIL PROTECTED]
 Subject: Re: What's the best strategy to handle this kind of thread
 issues?


 - Original Message -
 From: Craig R. McClanahan [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]; Jing
 Zhou [EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 12:12 PM
 Subject: Re: What's the best strategy to handle this kind of thread issues?


  On Wed, 10 Sep 2003, Jing Zhou wrote:
 
   Date: Wed, 10 Sep 2003 02:16:49 -0500
   From: Jing Zhou [EMAIL PROTECTED]
   Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
Jing Zhou [EMAIL PROTECTED]
   To: Struts Users Mailing List [EMAIL PROTECTED]
   Subject: What's the best strategy to handle this kind of thread issues?
  
   As we realize so far, a browser window may send
   request A to a server. The server starts thread A
   to handle it. Before the thread A returns, the same
   window may send request B to the server, therefore
   the server creates thread B to handle it.
  
 
  Technically, the threads are usually there already in a pool, rather than
  being created, but that is not really relevant to your question.
 
  The only ways the same browser window can send more than one request
  (in the manner you describe) are:
  (a) User presses STOP and then manually triggers a second request.
  (b) A page includes one or more tags like img that fire
  off parallel requests for each image
  (c) Window includes multiple frames (the frames themselves
  are often loaded with parallel requests) just like (b)
  (d) JavaScript techniques similar in (b) that are used by the client
  to reassemble the output.
 
  So the answer to your question really depends on which use case we're
  talking about.  In scenario (a), thread A will continue to run the
  original request, because the server has no way to know that the user
  pressed STOP.  Because the client has closed the TCP connection, the
  servlet will generally encounter an I/O exception when writing out the
  response -- but if the response fits inside a buffer, it might not be seen
  until after the servlet returns.

 What we found in IE 6.0 sp1 is that end users do not have to press STOP
 and then manually trigger a second request. They could just press buttons
 in a web form and trigger different requests to the server. Is this a bug
 in IE 6.0? (The scenario (a) looks correct in IE 5.0)


I suppose that behavior is similar on lots of other browsers -- I just
tried it on Mozilla 1.4 and it does the same thing; as far as the browser
is concerned, it just stops paying attention to the original request and
starts paying attention to the new one.

 If we regard this scenario as (a+), then we know thread A could still be
 executing in its valid mode (not cancelled or to-be-cancelled) after
 thread B returns.


This is the crux of the issue -- there is no such thing as cancelling an
HTTP request.  There's nothing in the protocol analogous to typing a
Ctrl+C into a command shell to interrupt the currently running program.

The original request is going to keep running until it runs into an I/O
error because the client closed the underlying TCP connection.  And even
that will often not happen until after the response has been completely
written to the output buffer, and the container tries to flush it.

All you can really do is detect that the situation happened, synchronize
against multithread race conditions, and make sure that the second
response sends back what you want (since the user isn't going to see the
first response).

Craig

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



Re: What's the best strategy to handle this kind of thread issues ?

2003-09-10 Thread Sasha Borodin
Consider this timeline as a possible solution:

1.  Form is submitted, token is invalidated.

2.  Form submitted again; error cause token is invalid; sit there and check
lost and found for HttpServletResponse that original request will generate
and leave there.

3.  Request A is processed and response generated.

4.  IOException thrown, HttpServletResponse saved in a lost and found.

5.  Second request finally finds the HttpServletResponse in the lost and
found, and returns that to the browser.



This way, there's no duplicate records in the database, and the origian
requests's response is returned for any subsequent (stupid user!) submits.
The only design that's gotta be done is this global lost and found where
responses are left and picked up.

Comments?

-Sasha

 From: Jing Zhou [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 Date: Wed, 10 Sep 2003 11:23:47 -0500
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: What's the best strategy to handle this kind of thread issues ?
 
 
 - Original Message -
 From: Mainguy, Mike [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 9:14 AM
 Subject: RE: What's the best strategy to handle this kind of thread issues ?
 
 
 I think, however that this proposed solution (almost) entirely defeats the
 purpose of having a multithreaded environment.  If you try and synchronize
 all responses and disregard duplicates, you will most likely end up with a
 slow and cumbersome application.
 
 Swing takes advantages of multithreaded environments. But its event
 handling model does use single thread to execute queued events.
 Such mechanism does not cause slow responses at all,
 both in theory and in reality. How to get it done in web tiers is an open
 challenging.
 
 my $.02
 
 Jing
 
 
 I would say to achieve the sort of efficiencies you are describing one
 would
 be better served to look into the app/web server code.  Doing this at a
 servlet level will most likely just get one into a big mess.
 
 It actually seems like a good idea (if it isn't already there) for a
 caching
 proxy or appserver, but certainly not a web application.
 
 Just my $.02
 
 
 -Original Message-
 From: Andrew Hill [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 10, 2003 4:18 AM
 To: Struts Users Mailing List
 Subject: RE: What's the best strategy to handle this kind of thread
 issues?
 
 My undertsanding was that the browser will only show the response to the
 the
 second of the requests - forgetting about the first. The server of course
 hasnt forgetten about it and keeps processing (one hopes). Im not quite
 sure
 what happens to its response stream (null?) but the browser is now only
 waiting for the second requests response - which I presume is a seperate
 connection?
 
 Now if we are using tokens or some such mechanism to detect that its a
 second request and thus illigitimate then we can of course return some
 kind
 of error to the user instead of processing the request (since we know its
 already been processed).
 
 This however isnt very friendly. What we really want to do is to have the
 second request return the same response as would have been returned by the
 first request after it did its work. I have no practical solution for this
 :-(
 
 Hmm. Actually I have an idea. Not a good one, but maybe worth a passing
 thought:
 (Thinking off the top of my head here  btw (and the following will not
 work
 in a distributed environment unless one has sticky sessions so that all
 requests for a particular session are gauranteed to be processed by the
 same
 JVM)):
 
 0. Requests A,B,C,N come in in rapid succession and cause threads to be
 started in the container to process the requests - probably but not
 necessarily in the order they came in.
 
 1. Thread B (or any other thread) is lucky enough to start running first
 and. Synchronizing on some global object (probably its own Class object if
 its a singleton) it checks the session for a token (under a key that was
 generated earlier and submitted as a request param in a hidden field). Not
 finding it, it creates it and stores it in the session, and proceeds to
 marshall the data needed to render a response - whatever it is the action
 is
 supposed to actually do.
 
 2. Threads A,C,N also sync on the global object and check the session.
 Unlike thread B, they find the token, so they all call wait() on the token
 object.
 
 3. Having doing the processing  read/updated the db (or whatever), and
 obtained the necessary info, etc... Thread B is finally ready to render a
 response. It doesnt know however if it is the 'lucky last' thread that the
 browser is actually waiting for. What it does then is to add the necessary
 information to render the response to the session (perhaps the token could
 provide getters for it?), and having done so it calls notifyAll() on the
 token object, and then proceeds itself to 

Re: Strange filter problem?

2003-09-10 Thread Mike Deegan
Ensure u have the web.xml file in the right order of elements as per the
appropriate DTD
And the right DTD for that matter ...
Plus I'm not sure if *filter-mapping* element is mandatory ...

eg  http://java.sun.com/dtd/web-app_2_3.dtd

!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*,
security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)

I may be wrong, but I'm sure web-app2.2 doesn't allow filters
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd

!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, servlet*, servlet-mapping*, session-config?,
mime-mapping*, welcome-file-list?, error-page*, taglib*,
resource-ref*, security-constraint*, login-config?, security-role*,
env-entry*, ejb-ref*)

If removing the element from the web.xml fixes your problem it really seems
to point to the web.xml syntax as being the culprit.

Regards,
Mike

An example filter mapping that works for me ...

after context-param elements...

filter
filter-namecompressionFilter/filter-name
filter-classCompressionFilter/filter-class
init-param
  param-namecompressionThreshold/param-name
  param-value10/param-value
/init-param
/filter

filter-mapping
filter-namecompressionFilter/filter-name
servlet-namecompressionTest/servlet-name
/filter-mapping

before ... servlet elements




- Original Message - 
From: Bjørn T Johansen [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, September 10, 2003 3:55 PM
Subject: Strange filter problem?


 Hi..

 I am trying to write my very first filter running on Tomcat, but when I
 include the definition of the filter in my web.xml file, I get this
 exeption..:

 org.apache.jasper.JasperException: File /tags/struts-logic not found

 at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:105)
 at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430
)
 at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154
)
 at
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:180)
 at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354)
 at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
 at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:4
73)
 at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:1
90)
 at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at 

  1   2   >