RE: strut-config.xml parse error issue - Urgent!!

2004-07-13 Thread Ashutosh Satyam
Thnx a million Erik.
It worked but still couldn't
make out how DTD is enforcing this particular
behaviour.

:-) Ashutosh

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 14, 2004 10:31 AM
To: Struts Users Mailing List
Subject: Re: strut-config.xml parse error issue - Urgent!!


In your action mapping, put your exception elements *before* your 
forward elements, not after.

Cheers,
Erik



Ashutosh Satyam wrote:

>Hi,
> I have a struts based web application.
>Recently I updated my struts config file
>to handle exceptions declaratively.
>
>Below is the snippet of the struts config file.
>
> 
>   
>   key="error.runtime"
>path="Error"
>scope="request"
>type="java.lang.Exception" 
>   handler="com.exception.MyExceptionHandler"/>
>
> 
> 
>  
>
>   path="/CCMCmtsConfig"
>type="com.test.ui.action.CCMCmtsConfAction"
>name="ccmCmtsConfForm"
>scope="session"
>parameter="method"> 
>
>
>
>
>
>key="error.session.expired"
>type="com.exception.InvalidSessionException"
>path="CmtsError"/>
>key="error.invalid.parameter"
>type="com.exception.InvalidParameterException"
>path="CmtsError"/>
>
>
>
>After doing this modification, I'm getting this exception
>during start up. I'm building the application using Struts1.1
>
>2004-07-14 09:34:17,654 [Thread-3 ] digester.Digester   : ERROR - Parse Error at
> line 134 column 14: The content of element type "action" must match "(icon?,dis
>play-name?,description?,set-property*,exception*,forward*)".
>org.xml.sax.SAXParseException: The content of element type "action" must match "
>(icon?,display-name?,description?,set-property*,exception*,forward*)".
>
>Please provide me the solution for this.
>
>
>Regards,
>Ashutosh
>
>
>
>-
>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: Declarative Exception handling question

2004-07-13 Thread Hubert Rabago
Just to clarify for archive searchers.

The  and  work with declarative
programming.  These tags were introduced to provide the programmer more
control over the formatting of the messages, compared to what 
provide.  For example,  require HTML tags to be present in the
message itself in the application resources file.  With logic:messagesPresent
and html:messages, all the actual formatting can be done on the JSP.  The
example I showed was written just to illustrate the difference between the
regular "validation errors" as opposed to non-validation errors which one
might want to format differently.

--- Erik Weber <[EMAIL PROTECTED]> wrote:
> Thanks Hubert. If you see my last post, you'll see that I solved the 
> problem without having to write any Java code -- I did it all 
> declaratively and with tags. Nowhere in my code do I create 
> ActionMessages instances -- I am trying to let Struts do this for me, 
> and stick with declarative programming!
> 
> Perhaps people will have opinions on these two ways of solving the same 
> problem.
> 
> Erik
> 
> 
> Hubert Rabago wrote:
> 
> >For validation errors, do the usual, using the saveErrors to pass them to
> the
> >JSP:
> >
> >// validation error
> >ActionMessages actionMessages = new ActionMessages();
> >actionMessages.add(ActionMessages.GLOBAL_MESSAGE, 
> >new ActionMessage("illegal.username", username));
> >saveErrors(request, actionMessages);
> >
> >
> >For other messages you want special formatting, save it in a different
> >request attribute, say "autherrors":
> >
> >// special error
> >ActionMessages actionMessages = new ActionMessages();
> >actionMessages.add(ActionMessages.GLOBAL_MESSAGE, 
> >new ActionMessage("auth.failed", someOptionalParam));
> >request.setAttribute("autherrors", actionMessages);
> >
> >The attribute name "autherrors" is what you'll use to render it
> differently.
> >
> >Now, in your JSP, use the  tag to display all the messages
> >under the "autherrors" request attribute.  If you want to add special
> headers
> >and footers, use the  to make sure they don't get
> >shown when there are no messages.
> >
> >
> >Authentication error:
> >
> >
> >
> >
> >
> >hth,
> >Hubert
> >
> >--- Erik Weber <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>Well, this didn't work, the header and footer from the default bundle 
> >>are rendered even though there are no form validation errors, despite 
> >>that the displayed error message is from the other bundle! Perhaps the 
> >>errors.header and errors.footer are "inherited" from the default bundle 
> >>if they are not defined in the secondary bundle?
> >>
> >>Regardless, I am back to square one. I would appreciate any help.
> >>
> >>Erik
> >>
> >>
> >>
> >>Erik Weber wrote:
> >>
> >>
> >>
> >>>Seemingly a simple way to accomplish this would be to put the form 
> >>>validation error messages into one properties file, and to define 
> >>>errors.header and errors.footer for that file, and to put the non-form 
> >>>validation error messages into a different properties file, and to 
> >>>*not* define errors.header and errors.footer for that file. Then, in 
> >>>my JSP, I could put two html:errors tags in the error presentation 
> >>>area, each with a different bundle attribute:
> >>>
> >>>
> >>>
> >>>
> >>>The idea is that at most one of the two would ever actually render 
> >>>anything.
> >>>
> >>>This is what I will try unless someone has a better ideer . . . . 
> >>>Sorry but I find the HTML tag documentation to be far from clear, 
> >>>despite how great the tags are. There is probably a better way, but I 
> >>>need a concrete example.
> >>>
> >>>Erik
> >>>
> >>>
> >>>
> >>>Erik Weber wrote:
> >>>
> >>>  
> >>>
> I am using the Validator plugin to do my form validation, and so with 
> the  tag placed at the top of my content area, the form 
> validation messages are presented, with the header and footer defined 
> by errors.header and errors.footer. In the traditional manner, the 
> form validation output looks something like this:
> 
> Error
> 
> Please correct these errors:
> 
> * Username is required
> * Password2 must match Password1
> 
> Now, I am also presenting non-validation error messages in the same 
> location on some pages; These are caused by Exceptions that are 
> accounted for declaratively in struts-config.xml. The problem is, I 
> don't want these messages to be presented with the header and footer 
> (or maybe I want a different header and footer).
> 
> A concrete example:
> 
> For my login page, if you fail to enter a username or password, I 
> want the error message presentation to look like the example above -- 
> with a header and a footer (causing a table with a bulleted list to 
> be rendered). But, if you enter the *wrong* password, and an 
> AuthenticationException is thrown, the user ends up back at the same 
> screen, except this time, 

Re: strut-config.xml parse error issue - Urgent!!

2004-07-13 Thread Erik Weber
In your action mapping, put your exception elements *before* your 
forward elements, not after.

Cheers,
Erik

Ashutosh Satyam wrote:
Hi,
I have a struts based web application.
Recently I updated my struts config file
to handle exceptions declaratively.
Below is the snippet of the struts config file.

	
	
   key="error.runtime"
   path="Error"
   scope="request"
   type="java.lang.Exception" 
		handler="com.exception.MyExceptionHandler"/>


 

  
   type="com.test.ui.action.CCMCmtsConfAction"
   name="ccmCmtsConfForm"
   scope="session"
   parameter="method"> 
   
   
   
   
   
   
   key="error.session.expired"
   type="com.exception.InvalidSessionException"
   path="CmtsError"/>
   
   key="error.invalid.parameter"
   type="com.exception.InvalidParameterException"
   path="CmtsError"/>
   

After doing this modification, I'm getting this exception
during start up. I'm building the application using Struts1.1
2004-07-14 09:34:17,654 [Thread-3 ] digester.Digester   : ERROR - Parse Error at
line 134 column 14: The content of element type "action" must match "(icon?,dis
play-name?,description?,set-property*,exception*,forward*)".
org.xml.sax.SAXParseException: The content of element type "action" must match "
(icon?,display-name?,description?,set-property*,exception*,forward*)".
Please provide me the solution for this.
Regards,
Ashutosh

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


strut-config.xml parse error issue - Urgent!!

2004-07-13 Thread Ashutosh Satyam
Hi,
 I have a struts based web application.
Recently I updated my struts config file
to handle exceptions declaratively.

Below is the snippet of the struts config file.

 



 
 
  












After doing this modification, I'm getting this exception
during start up. I'm building the application using Struts1.1

2004-07-14 09:34:17,654 [Thread-3 ] digester.Digester   : ERROR - Parse Error at
 line 134 column 14: The content of element type "action" must match "(icon?,dis
play-name?,description?,set-property*,exception*,forward*)".
org.xml.sax.SAXParseException: The content of element type "action" must match "
(icon?,display-name?,description?,set-property*,exception*,forward*)".

Please provide me the solution for this.


Regards,
Ashutosh



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



Re: Declarative Exception handling question

2004-07-13 Thread Erik Weber
Thanks Hubert. If you see my last post, you'll see that I solved the 
problem without having to write any Java code -- I did it all 
declaratively and with tags. Nowhere in my code do I create 
ActionMessages instances -- I am trying to let Struts do this for me, 
and stick with declarative programming!

Perhaps people will have opinions on these two ways of solving the same 
problem.

Erik
Hubert Rabago wrote:
For validation errors, do the usual, using the saveErrors to pass them to the
JSP:
// validation error
ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, 
   new ActionMessage("illegal.username", username));
saveErrors(request, actionMessages);

For other messages you want special formatting, save it in a different
request attribute, say "autherrors":
// special error
ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, 
   new ActionMessage("auth.failed", someOptionalParam));
request.setAttribute("autherrors", actionMessages);

The attribute name "autherrors" is what you'll use to render it differently.
Now, in your JSP, use the  tag to display all the messages
under the "autherrors" request attribute.  If you want to add special headers
and footers, use the  to make sure they don't get
shown when there are no messages.

   Authentication error:
   
   
   


hth,
Hubert
--- Erik Weber <[EMAIL PROTECTED]> wrote:
 

Well, this didn't work, the header and footer from the default bundle 
are rendered even though there are no form validation errors, despite 
that the displayed error message is from the other bundle! Perhaps the 
errors.header and errors.footer are "inherited" from the default bundle 
if they are not defined in the secondary bundle?

Regardless, I am back to square one. I would appreciate any help.
Erik

Erik Weber wrote:
   

Seemingly a simple way to accomplish this would be to put the form 
validation error messages into one properties file, and to define 
errors.header and errors.footer for that file, and to put the non-form 
validation error messages into a different properties file, and to 
*not* define errors.header and errors.footer for that file. Then, in 
my JSP, I could put two html:errors tags in the error presentation 
area, each with a different bundle attribute:



The idea is that at most one of the two would ever actually render 
anything.

This is what I will try unless someone has a better ideer . . . . 
Sorry but I find the HTML tag documentation to be far from clear, 
despite how great the tags are. There is probably a better way, but I 
need a concrete example.

Erik

Erik Weber wrote:
 

I am using the Validator plugin to do my form validation, and so with 
the  tag placed at the top of my content area, the form 
validation messages are presented, with the header and footer defined 
by errors.header and errors.footer. In the traditional manner, the 
form validation output looks something like this:

Error
Please correct these errors:
* Username is required
* Password2 must match Password1
Now, I am also presenting non-validation error messages in the same 
location on some pages; These are caused by Exceptions that are 
accounted for declaratively in struts-config.xml. The problem is, I 
don't want these messages to be presented with the header and footer 
(or maybe I want a different header and footer).

A concrete example:
For my login page, if you fail to enter a username or password, I 
want the error message presentation to look like the example above -- 
with a header and a footer (causing a table with a bulleted list to 
be rendered). But, if you enter the *wrong* password, and an 
AuthenticationException is thrown, the user ends up back at the same 
screen, except this time, I want the error message to be unadorned 
(or possibly with a different treatment), like this:

Authentication failed
As I said, AuthenticationException is handled declaratively. What is 
the easiest way to present the message associated with the exception 
*without* the header and footer in this case, while leaving the form 
validation error presentation (with header and footer) intact?

Thanks,
Erik
-
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]
   


		
__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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

Re: Declarative Exception handling question

2004-07-13 Thread Erik Weber
OK I solved the problem. The problem was that the html:errors tag that 
is pulling messages from the default bundle apparently renders 
errors.header and error.footer if *any* error message is stored as a 
request attribute, no matter what bundle that error message might come 
from. This seems wrong to me. It seems that if you specify the bundle to 
the html:errors tag, it should only present anything if there is a 
message to display that is from that particular bundle.

So, I had this originally:


The idea was that the top tag would present any form validation error 
messages, while the bottom tag would present any messages associated 
with exceptions that occur after validation has succeeded, such as an 
InvalidLoginException, or similar. The two bundles have different values 
for errors.header and errors.footer, so that the two types of feedback 
can be formatted differently.

But this did not work because the first tag was presenting its header 
and footer even though there were no form validation error messages, 
seemingly because there was an error message associated with the 
exception available as a request attribute. Shouldn't the html:errrors 
tag go a step further, and only render anything if there are messages 
*from the specified bundle* in scope, and not just any error message at 
all? I tried explicity declaring the default bundle in the first tag; it 
made no difference.

Anyway, I enumerated the request parameters present when a form 
validation error occurred, and those present when an exception occurred 
after form validation had succeeded. There was, Thank God because it's 
late, one difference: When an Exception is thrown, there is one 
additional request attribute under the key 
"org.apache.struts.action.EXCEPTION". That request attribute is not 
there when a form validation error has cut processing short.

So then I found the logic:present and logic:notPresent tags . . . . Now 
I have this:







Now, if a form validation error occurs, the top html:errors tag renders 
nothing (this works even without the logic:present tag, but I included 
it for goodness), and the bottom html:errors tag presents the form 
validation error messages, including header and footer, from the default 
bundle. If, on the other hand, an Exception occurs after form validation 
has succeeded, the top html:errors tag renders the exception message, 
with a different header and footer, and the bottom html:errors tag 
renders nothing (event though it so desperately WANTS to), because it 
has been foiled by the logic:notPresent tag.

Someone slap me. The ordeal seemingly is finished.
This also brings up another question: Is there any way to tell the 
Validator plugin to pull messages from some bundle other than the 
default bundle? Ultimately I want my solution to look like this:



The top tag should only render if there are messages in scope *from the 
specified bundle*. Ditto for the second tag. This also would assume that 
the Validator plugin could be told to pull its messages from the 
FORM_VALIDATION_ERROR_MESSAGES properties file, instead of the default file.

Thanks and good night!
Erik

Erik Weber wrote:
Well, this didn't work, the header and footer from the default bundle 
are rendered even though there are no form validation errors, despite 
that the displayed error message is from the other bundle! Perhaps the 
errors.header and errors.footer are "inherited" from the default 
bundle if they are not defined in the secondary bundle?

Regardless, I am back to square one. I would appreciate any help.
Erik

Erik Weber wrote:
Seemingly a simple way to accomplish this would be to put the form 
validation error messages into one properties file, and to define 
errors.header and errors.footer for that file, and to put the 
non-form validation error messages into a different properties file, 
and to *not* define errors.header and errors.footer for that file. 
Then, in my JSP, I could put two html:errors tags in the error 
presentation area, each with a different bundle attribute:



The idea is that at most one of the two would ever actually render 
anything.

This is what I will try unless someone has a better ideer . . . . 
Sorry but I find the HTML tag documentation to be far from clear, 
despite how great the tags are. There is probably a better way, but I 
need a concrete example.

Erik

Erik Weber wrote:
I am using the Validator plugin to do my form validation, and so 
with the  tag placed at the top of my content area, 
the form validation messages are presented, with the header and 
footer defined by errors.header and errors.footer. In the 
traditional manner, the form validation output looks something like 
this:

Error
Please correct these errors:
* Username is required
* Password2 must match Password1
Now, I am also presenting non-validation error messages in the same 
location on some pages; These are caused by Exceptions that are 
accounted for declaratively in struts-config.xml. The problem is, I

RE: Can html:checkbox take only yes/true/on as value?

2004-07-13 Thread Shilpa Vaidya


Hi prashant

One of my edit pages faced this kinda stufff...

 checked  <%}
else{%> <%}%> value="Y">
  value="Y" <%}
else{%> value=""<%}%>


perhaps this will work as it encloses the check box ...its prepoulated
value...at the same time...a hidden field which sets the new value...incase
we click the checkbox in the edit section.
Shilpa



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 13, 2004 2:14 AM
To: [EMAIL PROTECTED]
Subject: Can html:checkbox take only yes/true/on as value?


Hi,



In regular HTML checkbox, the value of the checkbox can practically be
anything. Does the struts html:checkbox limit us to just yes/true/on
values?

If I have a list of records that I get from the database and I want to
display it with a checkbox at the left, the value of the checkbox being
the id of the record, how do I do that? Should there be another hidden
field for the checkbox with the actual value? And how do I connect the
checkbox to its corresponding hidden field?



I have searched high and low and found no clear explanation. I just want
someone to explain this to me.



Also how does the multibox fall into the picture? Can I use checkbox and
multibox interchangeably?

Thanks

Prashanthi



-- 


"This e-mail message may contain confidential, proprietary or legally privileged 
information. It 
should not be used by anyone who is not the original intended recipient. If you have 
erroneously 
received this message, please delete it immediately and notify the sender. The 
recipient 
acknowledges that ICICI Bank or its subsidiaries and associated companies,  
(collectively "ICICI 
Group"), are unable to exercise control or ensure or guarantee the integrity of/over 
the contents of the information contained in e-mail transmissions and further 
acknowledges that any views 
expressed in this message are those of the individual sender and no binding nature of 
the message shall be implied or assumed unless the sender does so expressly with due 
authority of ICICI Group.Before opening any attachments please check them for viruses 
and defects." 




Re: Browser's refresh problem

2004-07-13 Thread Hubert Rabago
Any chance that you just forget the resetToken() call?

http://husted.com/struts/catalog.html (search for "resetToken")

--- Ding Lei <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 13, 2004 at 08:12:23AM -0700, Hubert Rabago wrote:
> > --- Ding Lei <[EMAIL PROTECTED]> wrote:
> > > 
> > > Hi Hubert,
> > > Thanks for your reply first .. but:
> > > 
> > > On Mon, Jul 12, 2004 at 09:32:45PM -0700, Hubert Rabago wrote:
> > > > This is really how it's designed to work.  For a form to be
> resubmitted,
> > > the
> > > > user will have to regenerate the form, maybe by going back two pages,
> to
> > > the
> > > > page that was shown *before* the form.  As you might already know,
> this
> > > > protects against accidental double submits.
> > > 
> > > Yes, the problem is that even if the form is regenerated, it is STILL
> USING
> > > THE SAME REQUEST object, which means that the token still stays there.
> > 
> > This suggests that either your Action is not being called (the form is
> being
> > cached by the browser or the server), or you missed the call to
> > saveToken(request).  
> IMHO, the saveToken(request) IS CALLED for sure. It's actually the
> opposite,
> the token is saved, but never "resest"  anywhere.
> 
> A simple "refresh" problem is becoming more and more complicated,
> perhaps a uniqueness check on user ID upon creation is the easiest way to
> to avoid duplicate records.
> 
> Thanks for all of your help, anyway.
> 
> 
> 
> -- 
> Layman <[EMAIL PROTECTED]> Ext: 8059
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

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



Re: Declarative Exception handling question

2004-07-13 Thread Hubert Rabago

For validation errors, do the usual, using the saveErrors to pass them to the
JSP:

// validation error
ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage("illegal.username", username));
saveErrors(request, actionMessages);


For other messages you want special formatting, save it in a different
request attribute, say "autherrors":

// special error
ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage("auth.failed", someOptionalParam));
request.setAttribute("autherrors", actionMessages);

The attribute name "autherrors" is what you'll use to render it differently.

Now, in your JSP, use the  tag to display all the messages
under the "autherrors" request attribute.  If you want to add special headers
and footers, use the  to make sure they don't get
shown when there are no messages.


Authentication error:





hth,
Hubert

--- Erik Weber <[EMAIL PROTECTED]> wrote:
> Well, this didn't work, the header and footer from the default bundle 
> are rendered even though there are no form validation errors, despite 
> that the displayed error message is from the other bundle! Perhaps the 
> errors.header and errors.footer are "inherited" from the default bundle 
> if they are not defined in the secondary bundle?
> 
> Regardless, I am back to square one. I would appreciate any help.
> 
> Erik
> 
> 
> 
> Erik Weber wrote:
> 
> > Seemingly a simple way to accomplish this would be to put the form 
> > validation error messages into one properties file, and to define 
> > errors.header and errors.footer for that file, and to put the non-form 
> > validation error messages into a different properties file, and to 
> > *not* define errors.header and errors.footer for that file. Then, in 
> > my JSP, I could put two html:errors tags in the error presentation 
> > area, each with a different bundle attribute:
> >
> > 
> > 
> >
> > The idea is that at most one of the two would ever actually render 
> > anything.
> >
> > This is what I will try unless someone has a better ideer . . . . 
> > Sorry but I find the HTML tag documentation to be far from clear, 
> > despite how great the tags are. There is probably a better way, but I 
> > need a concrete example.
> >
> > Erik
> >
> >
> >
> > Erik Weber wrote:
> >
> >> I am using the Validator plugin to do my form validation, and so with 
> >> the  tag placed at the top of my content area, the form 
> >> validation messages are presented, with the header and footer defined 
> >> by errors.header and errors.footer. In the traditional manner, the 
> >> form validation output looks something like this:
> >>
> >> Error
> >>
> >> Please correct these errors:
> >>
> >> * Username is required
> >> * Password2 must match Password1
> >>
> >> Now, I am also presenting non-validation error messages in the same 
> >> location on some pages; These are caused by Exceptions that are 
> >> accounted for declaratively in struts-config.xml. The problem is, I 
> >> don't want these messages to be presented with the header and footer 
> >> (or maybe I want a different header and footer).
> >>
> >> A concrete example:
> >>
> >> For my login page, if you fail to enter a username or password, I 
> >> want the error message presentation to look like the example above -- 
> >> with a header and a footer (causing a table with a bulleted list to 
> >> be rendered). But, if you enter the *wrong* password, and an 
> >> AuthenticationException is thrown, the user ends up back at the same 
> >> screen, except this time, I want the error message to be unadorned 
> >> (or possibly with a different treatment), like this:
> >>
> >> Authentication failed
> >>
> >> As I said, AuthenticationException is handled declaratively. What is 
> >> the easiest way to present the message associated with the exception 
> >> *without* the header and footer in this case, while leaving the form 
> >> validation error presentation (with header and footer) intact?
> >>
> >> Thanks,
> >>
> >> Erik
> >>
> >>
> >> -
> >> 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]
> 
> 




__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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

Re: Browser's refresh problem

2004-07-13 Thread Ding Lei
On Tue, Jul 13, 2004 at 08:12:23AM -0700, Hubert Rabago wrote:
> --- Ding Lei <[EMAIL PROTECTED]> wrote:
> > 
> > Hi Hubert,
> > Thanks for your reply first .. but:
> > 
> > On Mon, Jul 12, 2004 at 09:32:45PM -0700, Hubert Rabago wrote:
> > > This is really how it's designed to work.  For a form to be resubmitted,
> > the
> > > user will have to regenerate the form, maybe by going back two pages, to
> > the
> > > page that was shown *before* the form.  As you might already know, this
> > > protects against accidental double submits.
> > 
> > Yes, the problem is that even if the form is regenerated, it is STILL USING
> > THE SAME REQUEST object, which means that the token still stays there.
> 
> This suggests that either your Action is not being called (the form is being
> cached by the browser or the server), or you missed the call to
> saveToken(request).  
IMHO, the saveToken(request) IS CALLED for sure. It's actually the opposite,
the token is saved, but never "resest"  anywhere.

A simple "refresh" problem is becoming more and more complicated,
perhaps a uniqueness check on user ID upon creation is the easiest way to
to avoid duplicate records.

Thanks for all of your help, anyway.



-- 
Layman <[EMAIL PROTECTED]> Ext: 8059

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



RE: How to extract columnNames values

2004-07-13 Thread Indra Gunawan
I have found a class in Spring framework ... BeanWrapperImpl which is useful
but we have to use it in condition : we have to include Pojo always in ql
 for example we can't query only column names like userid, username 
we have to do it using Pojo itself like Person, User. Then we pass the Pojo
to BeanWrapperImpl which functions as the decorator to make us view the Pojo
as property bag... the rest is easy.

But well, I will check if Hibernate version is more useful. Thanks for your
suggestion David!!!

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 14, 2004 9:49 AM
To: Struts Users Mailing List
Subject: RE: How to extract columnNames values


Indra,

I believe you want the latest verion of Hibernate which has some Metadata
available which should have the column names.  I've never used it so you
might want to check out the hibernate forums on hibernate.org.

Regards,
David

-Original Message-
From: Indra Gunawan [mailto:[EMAIL PROTECTED]
Sent: Friday, June 11, 2004 2:27 AM
To: 'Struts Users Mailing List'
Subject: How to extract columnNames values


Dear Hibernate Users,

I want to write a component or hopefully find one if there is any that can
create a Swing table model based on query results . I could achieve this
using resultset metadata (jdbc brute force way) . And I want to use
Hibernate to do the same .

But the difficulty is Hibernate uses POJO classes . Then one thing came up :
reflection ... but I tend to not using it as reflection will consume
processing time more . How can I extract column names and all values in it ?
... I do really hope Hibernate provides a method that will give Map object
that wraps column names along with its values .

Thanks

Indra

-
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: Declarative Exception handling question

2004-07-13 Thread Erik Weber
Well, this didn't work, the header and footer from the default bundle 
are rendered even though there are no form validation errors, despite 
that the displayed error message is from the other bundle! Perhaps the 
errors.header and errors.footer are "inherited" from the default bundle 
if they are not defined in the secondary bundle?

Regardless, I am back to square one. I would appreciate any help.
Erik

Erik Weber wrote:
Seemingly a simple way to accomplish this would be to put the form 
validation error messages into one properties file, and to define 
errors.header and errors.footer for that file, and to put the non-form 
validation error messages into a different properties file, and to 
*not* define errors.header and errors.footer for that file. Then, in 
my JSP, I could put two html:errors tags in the error presentation 
area, each with a different bundle attribute:



The idea is that at most one of the two would ever actually render 
anything.

This is what I will try unless someone has a better ideer . . . . 
Sorry but I find the HTML tag documentation to be far from clear, 
despite how great the tags are. There is probably a better way, but I 
need a concrete example.

Erik

Erik Weber wrote:
I am using the Validator plugin to do my form validation, and so with 
the  tag placed at the top of my content area, the form 
validation messages are presented, with the header and footer defined 
by errors.header and errors.footer. In the traditional manner, the 
form validation output looks something like this:

Error
Please correct these errors:
* Username is required
* Password2 must match Password1
Now, I am also presenting non-validation error messages in the same 
location on some pages; These are caused by Exceptions that are 
accounted for declaratively in struts-config.xml. The problem is, I 
don't want these messages to be presented with the header and footer 
(or maybe I want a different header and footer).

A concrete example:
For my login page, if you fail to enter a username or password, I 
want the error message presentation to look like the example above -- 
with a header and a footer (causing a table with a bulleted list to 
be rendered). But, if you enter the *wrong* password, and an 
AuthenticationException is thrown, the user ends up back at the same 
screen, except this time, I want the error message to be unadorned 
(or possibly with a different treatment), like this:

Authentication failed
As I said, AuthenticationException is handled declaratively. What is 
the easiest way to present the message associated with the exception 
*without* the header and footer in this case, while leaving the form 
validation error presentation (with header and footer) intact?

Thanks,
Erik
-
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: How to extract columnNames values

2004-07-13 Thread David Friedman
Indra,

I believe you want the latest verion of Hibernate which has some Metadata
available which should have the column names.  I've never used it so you
might want to check out the hibernate forums on hibernate.org.

Regards,
David

-Original Message-
From: Indra Gunawan [mailto:[EMAIL PROTECTED]
Sent: Friday, June 11, 2004 2:27 AM
To: 'Struts Users Mailing List'
Subject: How to extract columnNames values


Dear Hibernate Users,

I want to write a component or hopefully find one if there is any that can
create a Swing table model based on query results . I could achieve this
using resultset metadata (jdbc brute force way) . And I want to use
Hibernate to do the same .

But the difficulty is Hibernate uses POJO classes . Then one thing came up :
reflection ... but I tend to not using it as reflection will consume
processing time more . How can I extract column names and all values in it ?
... I do really hope Hibernate provides a method that will give Map object
that wraps column names along with its values .

Thanks

Indra

-
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: Declarative Exception handling question

2004-07-13 Thread Erik Weber
Seemingly a simple way to accomplish this would be to put the form 
validation error messages into one properties file, and to define 
errors.header and errors.footer for that file, and to put the non-form 
validation error messages into a different properties file, and to *not* 
define errors.header and errors.footer for that file. Then, in my JSP, I 
could put two html:errors tags in the error presentation area, each with 
a different bundle attribute:



The idea is that at most one of the two would ever actually render anything.
This is what I will try unless someone has a better ideer . . . . Sorry 
but I find the HTML tag documentation to be far from clear, despite how 
great the tags are. There is probably a better way, but I need a 
concrete example.

Erik

Erik Weber wrote:
I am using the Validator plugin to do my form validation, and so with 
the  tag placed at the top of my content area, the form 
validation messages are presented, with the header and footer defined 
by errors.header and errors.footer. In the traditional manner, the 
form validation output looks something like this:

Error
Please correct these errors:
* Username is required
* Password2 must match Password1
Now, I am also presenting non-validation error messages in the same 
location on some pages; These are caused by Exceptions that are 
accounted for declaratively in struts-config.xml. The problem is, I 
don't want these messages to be presented with the header and footer 
(or maybe I want a different header and footer).

A concrete example:
For my login page, if you fail to enter a username or password, I want 
the error message presentation to look like the example above -- with 
a header and a footer (causing a table with a bulleted list to be 
rendered). But, if you enter the *wrong* password, and an 
AuthenticationException is thrown, the user ends up back at the same 
screen, except this time, I want the error message to be unadorned (or 
possibly with a different treatment), like this:

Authentication failed
As I said, AuthenticationException is handled declaratively. What is 
the easiest way to present the message associated with the exception 
*without* the header and footer in this case, while leaving the form 
validation error presentation (with header and footer) intact?

Thanks,
Erik
-
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]


popup with dynamic controls

2004-07-13 Thread Christina Siena
I'm developing a complex UI and need some help with managing dynamic controls in a 
popup.

There is a main screen and a popup.

The main screen displays data in table format:

- in column one, a checkbox so the user can select which row they want to operate on
- in column two, a date range i.e. from 01-01-2005 to 03-31-2005

On the main form, there is a button that the user would select to display the popup.

On the popup, the existing date range is displayed as read-only text as follows:

Existing values:

|min_|max_|
|_01-01-2005_|_03-31-2005_| (this is the value from the selected item on the main 
screen)

Also on the popup, there are two rows of min and max fields as follows:

New values:

|min_|max_|
||| (row 1)
||| (row 2)

The user may enter data as follows:

New values:

|min_|max_|
|_01-01-2005_|_02-15-2005_| (row 1)
|_02-16-2005_|_03-31-2005_| (row 2)

There is a button named "Add More". If the user selects "Add More", the popup should 
display:

Existing values:

|min_|max_|
|_01-01-2005_|_03-31-2005_| (this is the value from the selected item on the main 
screen)

New values:

|min_|max_|
|_01-01-2005_|_02-15-2005_| (row 1)
|_02-16-2005_|_03-31-2005_| (row 2)
||| (row 3)

The user may select "Add More" multiple times to dynamically grow the min-max value 
pairs.

There is a button named "Save". If the user selects "Save", some validation occurs to 
ensure that the min-max date ranges are valid.

If valid, the main form will be redrawn based on the saved data.

I have a few questions about how this should be done:

Can I use JavaScript or do I have to go back to the server to re-display the popup 
with the added row? i.e. the min and max controls

If I have to go back to the server, I only have to go back to re-display the popup 
only, not the main screen, right? I think I answered this myself -- if going back to 
the server, this is the sequence when the user selects "Add More":
(1) close popup passing back to main screen the indicator indicating that "Add More" 
was selected and another indicator indicating that the popup needs to be opened again
(2) submit action with hidden field indicating that "Add More" was selected
(3) in the action, add a row to the map (list) representing the rows (the map is in 
the form bean)
(4) re-display the popup based on the contents of the map (list)
(5) then when the user enters values and selects "Save", the map-backed form 
attributes will be updated (have not tried but it should work, right?)

Now that I've thought about it, I don't think JavaScript is an option to accomplish 
this. Has anyone done something similar? I need some advice about some best practices 
if anyone has developed similar pages.

To further complicate things, these min-max date range entry fields will most likely 
utilize a calendar component, so I need to ensure that I can build that dynamically as 
well (since each calendar has to reference the control). Further, the validation at 
save time also needs to be dynamically generated or I have to go back to the server to 
validate.

If anyone has developed similar dynamically generated pages, any advice would be 
appreciated.

Thanks in advance.


Declarative Exception handling question

2004-07-13 Thread Erik Weber
I am using the Validator plugin to do my form validation, and so with 
the  tag placed at the top of my content area, the form 
validation messages are presented, with the header and footer defined by 
errors.header and errors.footer. In the traditional manner, the form 
validation output looks something like this:

Error
Please correct these errors:
* Username is required
* Password2 must match Password1
Now, I am also presenting non-validation error messages in the same 
location on some pages; These are caused by Exceptions that are 
accounted for declaratively in struts-config.xml. The problem is, I 
don't want these messages to be presented with the header and footer (or 
maybe I want a different header and footer).

A concrete example:
For my login page, if you fail to enter a username or password, I want 
the error message presentation to look like the example above -- with a 
header and a footer (causing a table with a bulleted list to be 
rendered). But, if you enter the *wrong* password, and an 
AuthenticationException is thrown, the user ends up back at the same 
screen, except this time, I want the error message to be unadorned (or 
possibly with a different treatment), like this:

Authentication failed
As I said, AuthenticationException is handled declaratively. What is the 
easiest way to present the message associated with the exception 
*without* the header and footer in this case, while leaving the form 
validation error presentation (with header and footer) intact?

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


Re: Can html:checkbox take only yes/true/on as value?

2004-07-13 Thread Wendy Smoak
From: <[EMAIL PROTECTED]>
> In regular HTML checkbox, the value of the checkbox can practically be
> anything. Does the struts html:checkbox limit us to just yes/true/on
> values?

No, you can have anything you want as the value.  It might default to yes or
true, I haven't tried it.

> If I have a list of records that I get from the database and I want to
> display it with a checkbox at the left, the value of the checkbox being
> the id of the record, how do I do that?

Use the 'value' attribute of the  tag, then if the box is
checked, that value will be submitted as the value of the form element.

(Checkboxes are special-- only successful/checked ones will be submitted, so
read the docs and reset them properly or you'll never be able to UNcheck
them.)

> Also how does the multibox fall into the picture? Can I use checkbox and
> multibox interchangeably?

No... checkbox is a single thing, and corresponds to a String property in
your Form bean.  Multibox corresponds to a String[], because you can choose
more than one item.  Here's an example of multibox:


   
 



Technically, I suppose you could use multibox in place of checkbox, but if
you're expecting multiple values, checkbox won't work, you'll only ever see
the final value that the browser submitted.

HTH,
-- 
Wendy Smoak


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



RE: Can html:checkbox take only yes/true/on as value?

2004-07-13 Thread Jim Barrows


> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 12, 2004 1:44 PM
> To: [EMAIL PROTECTED]
> Subject: Can html:checkbox take only yes/true/on as value?



> I have searched high and low and found no clear explanation. 

Try husted.com/struts for really cool tips and tricks :)

> I just want 
> someone to explain this to me. 

http://husted.com/struts/tips/007.html

> 
>  
> 
> Also how does the multibox fall into the picture? Can I use 
> checkbox and 
> multibox interchangeably? 

I suppose but why?


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



Can html:checkbox take only yes/true/on as value?

2004-07-13 Thread Prashanthi . Pokala
Hi, 

 

In regular HTML checkbox, the value of the checkbox can practically be 
anything. Does the struts html:checkbox limit us to just yes/true/on 
values? 

If I have a list of records that I get from the database and I want to 
display it with a checkbox at the left, the value of the checkbox being 
the id of the record, how do I do that? Should there be another hidden 
field for the checkbox with the actual value? And how do I connect the 
checkbox to its corresponding hidden field? 

 

I have searched high and low and found no clear explanation. I just want 
someone to explain this to me. 

 

Also how does the multibox fall into the picture? Can I use checkbox and 
multibox interchangeably? 

Thanks

Prashanthi


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

RE: webapp deployment

2004-07-13 Thread Jim Barrows


> -Original Message-
> From: Phyl [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 13, 2004 3:25 PM
> To: Struts Users Mailing List
> Subject: Re: webapp deployment
> 
> 
> 
> 
> I'm using Tomcat 4.1.29 in the development machine and Tomcat 
> 4.0.3 in 
> the webserver.
> 
> I wonder if this problem might have to be with the way  is 
> declared in server.xml. This is the way I have it in the development 
> machine:
> - server.xml -
> [...]
>  docBase="D:\Project1\www" workDir="D:\Project1\work\org\apache\jsp" />
> [...]
> --
> 
> and this is the way my hosting company configured it for me:
> - server.xml -
> [...]
> docBase="/home/virtual/sitexyz/fst/var/www/html"
> crossContext="false"
> reloadable="true" />
> [...]


Pardon the obvious, but just in case you're WEB-INF should be:
/home/virtual/sitexyz/fst/var/www/html/WEB-INF/struts-config.xml

If that's it again, pardon the obvious, but how is the struts-config.xml coded in 
the web.xml?


> --
> 
> 
> The following global-forward is the one i'm calling:
> --- struts-config.xml -
> [...]
> 
>  
> 
> [...]
> --
> 
> I'm trying to call it from index.jsp:
> -- index.jsp --
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> 
> 
> 
> 
> 
> ---
> 
> 
>   Cheers,
>   Phyl
>   
> 
> > Can you provide a bit more information and code?  What do 
> you have for 
> > global forwards in your struts-config.xml?  Where is the "welcome" 
> > forward called?  Etc.
> >
> > At 04:08 PM 7/12/2004, you wrote:
> >
> >>   Hi,
> >>
> >> I've been developing a struts webapp using tomcat and am 
> now trying 
> >> to deploy it to my webserver. I copied every class and jsp 
> manually 
> >> since there is no .war deployment available on the server.
> >> Invoking a simple jsp directly works fine, however, when 
> invoking a 
> >> *struts' jsp* this exception is being thrown:
> >>
> >> javax.servlet.jsp.JspException: Cannot find global 
> ActionForward for 
> >> name welcome
> >> at 
> >> 
> org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.
> java:142)
> >> at org.apache.jsp.index$jsp._jspService(index$jsp.java:73)
> >> at 
> >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >> ...
> >>
> >> this is the associated .jsp:
> >>
> >> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> >>
> >> It seems  the "welcome" global forward isn't being found in
> >> struts-config, but I'm sure it exists.
> >> When calling an action directly I get a "Not Found" error. 
> I'm beginning
> >> to doubt that struts-config.xml is even being loaded.
> >> What do you think might be the problem?
> >>
> >>
> >>thanks in advance,
> >>Phyl
> >>
> >>
> >>
> >>
> >>
> >>
> >> 
> -
> >> 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: webapp deployment

2004-07-13 Thread Phyl
  yep, load-on-startup is declared. i'm using it this way:
  
   action
   
org.apache.struts.action.ActionServlet
   
   config
   /WEB-INF/struts-config.xml
   
[...]
   1
   

 Phyl

Erik Weber wrote:
Make sure you have load-on-startup declared in web.xml! I had a 
problem with Struts not being loaded at all when I didn't have this 
declared, and the first request did not cause it to load either.

Erik
Phyl wrote:
  Hi,
I've been developing a struts webapp using tomcat and am now trying 
to deploy it to my webserver. I copied every class and jsp manually 
since there is no .war deployment available on the server.
Invoking a simple jsp directly works fine, however, when invoking a 
*struts' jsp* this exception is being thrown:

javax.servlet.jsp.JspException: Cannot find global ActionForward for 
name welcome
at 
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:73)
at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

this is the associated .jsp:
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


 


It seems  the "welcome" global forward isn't being found in 
struts-config, but I'm sure it exists.
When calling an action directly I get a "Not Found" error. I'm 
beginning to doubt that struts-config.xml is even being loaded.
What do you think might be the problem?

  thanks in advance,
  Phyl


-
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: webapp deployment

2004-07-13 Thread Phyl
  Tomcat is running with Apache web server, but in a Red hat linux 
system. I think the reason war deployment isn't available is somehow 
related to the way accounts provided by my hosting company are managed. 
I'm not sure though.

 Phyl
[EMAIL PROTECTED] wrote:
Are you using Tomcat in-process with the apache server on an AS/400?
Your problem, and the fact you don't have .war deployment sound familar.
John Thompson
[EMAIL PROTECTED]

|-+>
| |   Phyl |
| |   <[EMAIL PROTECTED]|
| |   net> |
| ||
| |   13/07/2004 11:08 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
 
>--|
 | 
 |
 |   To:   [EMAIL PROTECTED]   
|
 |   cc:   
 |
 |   Subject:  webapp deployment   
 |
 
>--|


  Hi,
I've been developing a struts webapp using tomcat and am now trying to
deploy it to my webserver. I copied every class and jsp manually since
there is no .war deployment available on the server.
Invoking a simple jsp directly works fine, however, when invoking a
*struts' jsp* this exception is being thrown:
javax.servlet.jsp.JspException: Cannot find global ActionForward for
name welcome
at
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
this is the associated .jsp:
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


 


It seems  the "welcome" global forward isn't being found in
struts-config, but I'm sure it exists.
When calling an action directly I get a "Not Found" error. I'm beginning
to doubt that struts-config.xml is even being loaded.
What do you think might be the problem?
  thanks in advance,
  Phyl


-
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: webapp deployment

2004-07-13 Thread Phyl

I'm using Tomcat 4.1.29 in the development machine and Tomcat 4.0.3 in 
the webserver.

I wonder if this problem might have to be with the way  is 
declared in server.xml. This is the way I have it in the development 
machine:
- server.xml -
[...]
   
[...]
--

and this is the way my hosting company configured it for me:
- server.xml -
[...]
   docBase="/home/virtual/sitexyz/fst/var/www/html"
   crossContext="false"
   reloadable="true" />
[...]
--
The following global-forward is the one i'm calling:
--- struts-config.xml -
[...]



[...]
--
I'm trying to call it from index.jsp:
-- index.jsp --
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

   
   
   

---
 Cheers,
 Phyl
 

Can you provide a bit more information and code?  What do you have for 
global forwards in your struts-config.xml?  Where is the "welcome" 
forward called?  Etc.

At 04:08 PM 7/12/2004, you wrote:
  Hi,
I've been developing a struts webapp using tomcat and am now trying 
to deploy it to my webserver. I copied every class and jsp manually 
since there is no .war deployment available on the server.
Invoking a simple jsp directly works fine, however, when invoking a 
*struts' jsp* this exception is being thrown:

javax.servlet.jsp.JspException: Cannot find global ActionForward for 
name welcome
at 
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:142)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:73)
at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

this is the associated .jsp:
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
It seems  the "welcome" global forward isn't being found in
struts-config, but I'm sure it exists.
When calling an action directly I get a "Not Found" error. I'm beginning
to doubt that struts-config.xml is even being loaded.
What do you think might be the problem?
   thanks in advance,
   Phyl


-
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: How Flexible are Struts and El Tags?

2004-07-13 Thread Jim Barrows


> -Original Message-
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 13, 2004 2:53 PM
> To: Struts Users Mailing List
> Subject: How Flexible are Struts and El Tags?
> 
> 
> Using the standard JSP tags, we can pretty do much do 
> anything on a page, e.g.:
> 
> <%
> List list = new TreeList();
> list.add("first");
> list.add("second");
> 
> Iterator iter1 = list.iterator();
> 
> while(iter2.hasNext()) {
>  List list = someMapA.get(iter.next());

The nested map is what proves interesting, as I think you have to drop to a scriptlet 
at this point for the get( iter.next()) bit.
Either   lIterator iter2 = list.iterator();
>  while(iter2.hasNext()) { %>
>  <%= "

RE: Form action relative path

2004-07-13 Thread Jim Barrows


> -Original Message-
> From: toto2004b2000 [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 12, 2004 7:08 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Form action relative path
> 
> 
> I've tried everything like this but it doesn't work...

If you're trying to get outside the application scope, there are issues, you might 
want try using
the full URL, and not use  
> --- In [EMAIL PROTECTED], "atta-ur rehman" <[EMAIL PROTECTED]> wrote:
> > How about:
> > 
> > 
> > 
> > ATTA
> > 
> > - Original Message - 
> > From: "toto2004b2000" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 07, 2004 1:34 AM
> > Subject: Form action relative path
> > 
> > 
> > > Hello,
> > > 
> > > My application is "toto" and with this struts tag
> > > 
> > > the generated HTML code is
> > > 
> > > 
> > > I need to use relative path (without application context), like
> > > 
> > > 
> > > Is it possible ? Any help would be appreciate.
> > > 
> > > Kind of regards
> > > 
> > > 
> > > 
> > > --
> ---
> > > 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]



Please HELP with HARD problem: STRUTS-tags VS Proxy, Weblogic loadbalancing, and BASE tag

2004-07-13 Thread Lukas Latz
Hi List,

I'm badly stuck with a STRUTS web-app that runs fine on Tomcat, but refuses
to bahave nicely in production, where a Netscape Proxy on port 80 maps to a
Netscape Webserver on port 8080, which in turn, with Weblogic plugin, does
loadbalancing to 2 Weblogic machines on port 7001.

As I don't have a lot of STRUTS experience, I stuck closely to the
struts-blank application and tuto, and used the struts-html tags as
advertised, including the  tag and the  tag.

Accessed through the proxy, the RequestUtils.getActionMappingURL() that (it
appears) does the real work inside those tags produces wrong servername /
port combinations (correct would be the Proxy's name on port 80).

What compounds the problem is that the web-app is a frameset.
Unusual, granted, but works just fine in Tomcat (inter-frame communication
with event-model using javascript).

The wrong resolution of  leads to multiple user-sessions within
the frameset (Bad Thing) (one session per frame).

Without success, we've tried several strategies to get around the problem:

- use  or just the regular html  tag, hard setting server
to proper value -> still gets multiple sessions, also can't get the port
right.

- get rid of  tag in all incarnations, only use relative links from /
level, works just fine on tomcat but still fails in production, presumably
because the  tag still resolves wrong?
.. could also be because I still use RequestUtils.getActionMappingURL() to
get the URL for the frame src definitions in the frameset. I had trouble
getting the frames any other way in the absence of the base tag.


I'm now wondering if I can safely do completely without RequestUtils and use
simple html  instead of struts  ??

Does the core functionality of Actions, ActionForms and mappings still work
if I replace the struts  tag with just  ??

Or is there another way around this?

Any pointers much appreciated !

Lukas






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



Re: Form action relative path

2004-07-13 Thread toto2004b2000
I've tried everything like this but it doesn't work...

--- In [EMAIL PROTECTED], "atta-ur rehman" <[EMAIL PROTECTED]> wrote:
> How about:
> 
> 
> 
> ATTA
> 
> - Original Message - 
> From: "toto2004b2000" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 07, 2004 1:34 AM
> Subject: Form action relative path
> 
> 
> > Hello,
> > 
> > My application is "toto" and with this struts tag
> > 
> > the generated HTML code is
> > 
> > 
> > I need to use relative path (without application context), like
> > 
> > 
> > Is it possible ? Any help would be appreciate.
> > 
> > Kind of regards
> > 
> > 
> > 
> > --
---
> > 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]



How Flexible are Struts and El Tags?

2004-07-13 Thread Michael McGrady
Using the standard JSP tags, we can pretty do much do anything on a page, e.g.:
<%
List list = new TreeList();
list.add("first");
list.add("second");
Iterator iter1 = list.iterator();
while(iter2.hasNext()) {
List list = someMapA.get(iter.next());
lIterator iter2 = list.iterator();
while(iter2.hasNext()) { %>
<%= "Thanks!
Michael



Filters, listeners and struts-config.xml

2004-07-13 Thread Jim Barrows
I've just googled to see how to get a filter to grab info from struts-config.xml, and 
haven't been able to find anything on it.  I had assumed  that it would have been a 
nice idea to have a StrutsFilter, just to be able to access the global forwards.
Have I missed something? Is this a 1.2 feature?
Should I invent this wheel?

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



Re: validation wierdness possibly related to multiple struts config files

2004-07-13 Thread Bill Siggelkow
Are you using Struts 1.2 or the nightly build? I had this issue the 
other day and I think I got around it by using the new  element 
instead of  -- simply change arg0 to arg in your validation.xml.


Or you can try using the new position attribute:

Bill Siggelkow
Bryan Hunt wrote:
I have the following jsp page
snip=

 
   
 
   
 
   
 :
 
   
 
etc etc etc
=snip

I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml
They are declared as so in my web.xml file.
snip=

config
/WEB-INF/struts/default.xml,
/WEB-INF/struts/client.xml,
/WEB-INF/struts/sales.xml,
/WEB-INF/struts/admin.xml


=snip
The default.xml contains the following lines which work just fine for 
everything else
snip=



 
   
   
   
 

  
   
 
=snip

My validation.xml file has the following relevant lines ...
snip=
 
   
   
   
   
   
   
   
   
   
   
=snip
My ApplicationResources.properties file has the following content
snip=
label.oldPassword=Old Password
label.newPassword=New Password
label.confirmNewPassword=Confirm New Password
errors.required={0} is required.
errors.minlength={0} cannot be less than {1} characters.
=snip
Now everything works fine including the labels (ie  ) but when
the form is submitted but not all the fields are filled out I get the 
following messages ( output from .

null is required.
null is required.
null is required.
Is this possibly a Struts bug or is it too late in the day and I drink 
to many units at the weekend being an Irishman ?

--b

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


OT:Re: FW: Lesbian & gays Mpeg

2004-07-13 Thread Bryan Hunt
Well that won the prize for most OT message ..
It beat the hibernate/linux/coffee machine questions 
--b
malcolm wrote:
-
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]


validation wierdness possibly related to multiple struts config files

2004-07-13 Thread Bryan Hunt
I have the following jsp page
snip=

 
   
 
   
 
   
 :
 
   
 
etc etc etc
=snip

I have 4 struts config files default.xml,client.xml,admin.xml,sales.xml
They are declared as so in my web.xml file.
snip=

config
/WEB-INF/struts/default.xml,
/WEB-INF/struts/client.xml,
/WEB-INF/struts/sales.xml,
/WEB-INF/struts/admin.xml


=snip
The default.xml contains the following lines which work just fine for 
everything else
snip=



 
   
   
   
 

  
   
 
=snip

My validation.xml file has the following relevant lines ...
snip=
 
   
   
   
   
   
   
   
   
   
   
=snip
My ApplicationResources.properties file has the following content
snip=
label.oldPassword=Old Password
label.newPassword=New Password
label.confirmNewPassword=Confirm New Password
errors.required={0} is required.
errors.minlength={0} cannot be less than {1} characters.
=snip
Now everything works fine including the labels (ie  ) but when
the form is submitted but not all the fields are filled out I get the 
following messages ( output from .

null is required.
null is required.
null is required.
Is this possibly a Struts bug or is it too late in the day and I drink 
to many units at the weekend being an Irishman ?

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


FW: Lesbian & gays Mpeg

2004-07-13 Thread malcolm



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

FW: Lesbian & gays Mpeg

2004-07-13 Thread malcolm



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

Validator confusion

2004-07-13 Thread nikhil walvekar
Hi,all
 
in class 
org.apache.commons.validator.Field
There are two member fileds.
indexedProperty
protected java.lang.String indexedProperty

-

indexedListProperty
protected java.lang.String indexedListProperty

-

 
indexedListProperty is the one which we use while validating fields from list 
(collection).
What is indexedProperty and where it is used and how?
 
Please help me out
 
Thanks
 
Nikhil

Yahoo! India Careers: Over 65,000 jobsonline.

Re: Please HELP with HARD problem: STRUTS-tags VS Proxy, Weblogic loadbalancing, and BASE tag

2004-07-13 Thread Craig McClanahan
Lukas Latz wrote:
Hi List,
Sent this yesterday, but it seemed to not get through to the list. My
apologies if it's come through already. :
I'm badly stuck with a STRUTS web-app that runs fine on Tomcat, but refuses
to bahave nicely in production, where a Netscape Proxy on port 80 maps to a
Netscape Webserver on port 8080, which in turn, with Weblogic plugin, does
loadbalancing to 2 Weblogic machines on port 7001.
As I don't have a lot of STRUTS experience, I stuck closely to the
struts-blank application and tuto, and used the struts-html tags as
advertised, including the  tag and the  tag.
Accessed through the proxy, the RequestUtils.getActionMappingURL() that (it
appears) does the real work inside those tags produces wrong servername /
port combinations (correct would be the Proxy's name on port 80).
What compounds the problem is that the web-app is a frameset.
Unusual, granted, but works just fine in Tomcat (inter-frame communication
with event-model using javascript).
The wrong resolution of  leads to multiple user-sessions within
the frameset (Bad Thing) (one session per frame).
Without success, we've tried several strategies to get around the problem:
- use  or just the regular html  tag, hard setting server
to proper value -> still gets multiple sessions, also can't get the port
right.
- get rid of  tag in all incarnations, only use relative links from /
level, works just fine on tomcat but still fails in production, presumably
because the  tag still resolves wrong?
.. could also be because I still use RequestUtils.getActionMappingURL() to
get the URL for the frame src definitions in the frameset. I had trouble
getting the frames any other way in the absence of the base tag.
I'm now wondering if I can safely do completely without RequestUtils and use
simple html  instead of struts  ??
Does the core functionality of Actions, ActionForms and mappings still work
if I replace the struts  tag with just  ??
 

No, that's not going to work.
Or is there another way around this?
Any pointers much appreciated !
 

The real problem is that your combination of server technologies 
(proxies plus webserver plus servlet container) is not maintaining the 
original URL from the browser all the way through to the servlet -- its 
being modified along the way.  Thus, you are going to have problems with 
*any* technology based on the servlet API (not just Struts), because 
such applications will always assume that they can reconstruct request 
URLs in the way that Struts does it.  Indeed, the assumptions that 
RequestUtils makes are based on *requirements* in the servlet 
specfication that your combination of technologies are, unfortunately, 
violating.

That's not a problem that Struts can fix :-(.
Lukas
 

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


Re: Which validator approach to use

2004-07-13 Thread Craig McClanahan
Rick Reumann wrote:
Bill Siggelkow wrote:
Good point, Rick. Isn't this the sort of thing that JSF allows? 

Not sure haven't looked at JSF yet:) Plan to at some point. Craig?
Of course, you can bind a validation to an action mapping using the 
ValidatorActionForm -- however this still forces your business 
objects to extend this form and it doesn't solve the populate problem.

Well, I'm actually not talking about binding the validation to a 
"form" or any bean but binding it to a mapping. The framework then 
will look at the basic request parameters and validate them based on 
some configuration for the mapping and of course return back to the 
user any errors. It never gets to the population of the bean (POJO/VO 
whatever) until after validation succeeds. Of course you could still 
get an ugly conversion error there if you don't validate properly but 
that's the case with any system. At least with the above approach you 
aren't tied to having to rely on an ActionForm simply for validation 
purposes.

As far as the problem of migrating deeply nested VOs to Action Forms 
-- we have the same issues on the app that I am working on -- I feel 
your pain ;)

Yea, annoying - especially if you have to validate stuff that is nested:)
The key thing to remember is that in Struts, ActionForm is part of the 
*view* tier, not part of the *model*.  It only exists to provide Struts 
a place to store the server side representation of the input data in 
your fields.

Validation was one of the motivations for this design, but not the key 
one.  The primary motivation was to meet a user expectation that, when 
they make a mistake, the form will be redisplayed with exactly what they 
typed into the field, even if it was wrong.  For example, if you have an 
integer field, and I type "1a3" instead of "123", I expect to see an 
error message and what I originally typed (1a3) there for me to fix.  
This is the reason you need string fields -- that's where Struts puts 
the originally typed value, so it can be redisplayed.

JSF does indeed avoid the need for an ActionForm like structure, because 
all the state saving and conversion logic is buried inside the component 
itself.  If you use a value binding expression to tie the value of the 
component directly to a model bean property, you don't even have to 
worry about defining what conversion to use; the binding machinery will 
take care of it for you.

With JSF, I see three different idioms for hooking input fields to data 
objects becoming popular, depending on your background and preferences:

* Bind component values to model bean properties,
 and have event handlers in separate classes
 (since conversion errors are handled for you, the model
 bean can use native data types).
* Bind component values to backing bean properties, and have
 the corresponding event handlers in the same class (sort of
 an ActionForm + Action combined, similar to what WebWorks
 does).
* Instead of binding component values to bean properties,
 bind components themselves (using the "binding" attribute),
 which makes it easy to programmatically modify component
 properties (similar to what ASP.Net does if you use
 code behind pages).
All three models are reasonable, and are not mutually exclusive within 
the same application.

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


performance

2004-07-13 Thread Lionel
Hi all

are there any performance increases between struts revisions ?
1.0 vs 1.1 vs 1.2

thanks




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



Re: Browser's refresh problem

2004-07-13 Thread Hubert Rabago
--- Ding Lei <[EMAIL PROTECTED]> wrote:
> 
> Hi Hubert,
> Thanks for your reply first .. but:
> 
> On Mon, Jul 12, 2004 at 09:32:45PM -0700, Hubert Rabago wrote:
> > This is really how it's designed to work.  For a form to be resubmitted,
> the
> > user will have to regenerate the form, maybe by going back two pages, to
> the
> > page that was shown *before* the form.  As you might already know, this
> > protects against accidental double submits.
> 
> Yes, the problem is that even if the form is regenerated, it is STILL USING
> THE SAME REQUEST object, which means that the token still stays there.

This suggests that either your Action is not being called (the form is being
cached by the browser or the server), or you missed the call to
saveToken(request).  

> 
> > If you're looking for an alternative, you can, instead of using tokens,
> use
> > redirects.  This will not protect against double submits, but will allow
> the
> > same form to be resubmitted deliberately, while still protecting against
> > refresh operations.  You could try manually removing the token, although
> > I think that will defeat the purpose of using them.
> Well, since we need to pass argument to the index page after user creation,
> 
> so redirect doesn't seem to be possible

I actually do this a lot.  Struts doesn't have support for adding parameters
to redirect at runtime, but a lot of people add the support right in.  I have
extensions which allow you to add not just parameters, but also ActionMessage
objects so you can pass arguments as well as messages like "Your changes have
been saved".  See http://www.rabago.net/struts/redirect  

Admittedly it seems like a lot of work to add it into an existing project. 
That's because of the ActionMessage support.  If you don't think you're going
to need ActionMessage support but still want something for passing arguments,
download the first patch attached to bug 866 (which is for this very issue): 
http://issues.apache.org/bugzilla/show_bug.cgi?id=866

Hubert

> 
> 
> Thank you again for your detailed reply!
> 
> -- 
> Layman <[EMAIL PROTECTED]> Ext: 8059
> 





__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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



RE: How to extract columnNames values

2004-07-13 Thread Robert Taylor
You might want to address the Hibernate mailing list
as this is not really a Struts question...or at the 
very least prepend the subject with [OT].

robert

> -Original Message-
> From: Indra Gunawan [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 11, 2004 2:27 AM
> To: 'Struts Users Mailing List'
> Subject: How to extract columnNames values
> 
> 
> Dear Hibernate Users,
> 
> I want to write a component or hopefully find one if there is any that can
> create a Swing table model based on query results . I could achieve this
> using resultset metadata (jdbc brute force way) . And I want to use
> Hibernate to do the same . 
> 
> But the difficulty is Hibernate uses POJO classes . Then one thing came up :
> reflection ... but I tend to not using it as reflection will consume
> processing time more . How can I extract column names and all values in it ?
> ... I do really hope Hibernate provides a method that will give Map object
> that wraps column names along with its values .
> 
> Thanks
> 
> Indra
> 
> -
> 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]



logic:iterate fails on (large) collection - solved

2004-07-13 Thread Trygve Hardersen
Hello again
Problem solved, it was, of course, a data error, caused by a message key
not found in the ApplicationResources file. Sorry to have bothered you
with a non-problem question, and many thanks for the quick and useful
replies. That's (among other things) what makes the Java community so
great. 

A nice debug message from Struts would be to let one know when there is
a problem with the messages, instead of rendering an incomplete
page. Anyway, solved!
Regards
Trygve

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



How to extract columnNames values

2004-07-13 Thread Indra Gunawan
Dear Hibernate Users,

I want to write a component or hopefully find one if there is any that can
create a Swing table model based on query results . I could achieve this
using resultset metadata (jdbc brute force way) . And I want to use
Hibernate to do the same . 

But the difficulty is Hibernate uses POJO classes . Then one thing came up :
reflection ... but I tend to not using it as reflection will consume
processing time more . How can I extract column names and all values in it ?
... I do really hope Hibernate provides a method that will give Map object
that wraps column names along with its values .

Thanks

Indra

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



Re: Browser's refresh problem

2004-07-13 Thread Ding Lei

Hi Hubert,
Thanks for your reply first .. but:

On Mon, Jul 12, 2004 at 09:32:45PM -0700, Hubert Rabago wrote:
> This is really how it's designed to work.  For a form to be resubmitted, the
> user will have to regenerate the form, maybe by going back two pages, to the
> page that was shown *before* the form.  As you might already know, this
> protects against accidental double submits.

Yes, the problem is that even if the form is regenerated, it is STILL USING
THE SAME REQUEST object, which means that the token still stays there.

> If you're looking for an alternative, you can, instead of using tokens, use
> redirects.  This will not protect against double submits, but will allow the
> same form to be resubmitted deliberately, while still protecting against
> refresh operations.  You could try manually removing the token, although I
> think that will defeat the purpose of using them.
Well, since we need to pass argument to the index page after user creation, 
so redirect doesn't seem to be possible


Thank you again for your detailed reply!

-- 
Layman <[EMAIL PROTECTED]> Ext: 8059

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



Re: Check for forward

2004-07-13 Thread Emmanouil Batsis
Bill Siggelkow wrote:
Create a custom RequestProcessor that extends the Struts 
RequestProcessor. In the custom class override the processForwardConfig 
method to do whatever you want.
Although not an API call, this is exactly what I needed. Thanks to all 
who answered.

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


Re: Initialization stuff

2004-07-13 Thread Bill Siggelkow
Martin,
I would not override the ActionServlet -- the plug-in approach is much 
better and not hard at all.

Here is a simple plug in and the
Martin I. Levi wrote:
Is this a better solution than mine?

On Tue, 2004-07-13 at 14:06, Paul McCulloch wrote:
You can do this by creating a class which implements
javax.servlet.ServletContextListener.
This requires a container supporting Servlet 2.3.
Paul

-Original Message-
From: Martin I. Levi [mailto:[EMAIL PROTECTED]
Sent: 13 July 2004 12:47
To: Struts Users Mailing List
Subject: Initialization stuff
Hi!
I would like to call an initialization class when my web 
application is
loaded in the container to perform some extra init tasks. How should I
do this?
My idea was to subclass the ActionServlet and override the 
init method,
is this ok or is there a better way to do this?

Any help is welcome.
Thanks!
--
Saludos,
Martin I. Levi
Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**
-
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: Which validator approach to use

2004-07-13 Thread Rick Reumann
Bill Siggelkow wrote:
Good point, Rick. Isn't this the sort of thing that JSF allows? 
Not sure haven't looked at JSF yet:) Plan to at some point. Craig?
Of course, you can bind a validation to an action mapping using the 
ValidatorActionForm -- however this still forces your business objects 
to extend this form and it doesn't solve the populate problem.
Well, I'm actually not talking about binding the validation to a "form" 
or any bean but binding it to a mapping. The framework then will look at 
the basic request parameters and validate them based on some 
configuration for the mapping and of course return back to the user any 
errors. It never gets to the population of the bean (POJO/VO whatever) 
until after validation succeeds. Of course you could still get an ugly 
conversion error there if you don't validate properly but that's the 
case with any system. At least with the above approach you aren't tied 
to having to rely on an ActionForm simply for validation purposes.

As far as the problem of migrating deeply nested VOs to Action Forms -- 
we have the same issues on the app that I am working on -- I feel your 
pain ;)
Yea, annoying - especially if you have to validate stuff that is nested:)
--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Initialization stuff

2004-07-13 Thread Martin I. Levi
Yeah, but I just need to do initialization when the application starts,
the validator and tiles are working all the time when requests come and
go. Perhaps is a good solution also, but is mine wrong or discouraged?
Thats what i really would like to know.

On Tue, 2004-07-13 at 13:58, Matthias Wessendorf wrote:
> Perhaps you can write a Plugin
> 
> that is the way how tiles and Validator gets init.
> 
> http://struts.apache.org/api/org/apache/struts/action/PlugIn.html
> 
> regards
> 
> > -Original Message-
> > From: Martin I. Levi [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, July 13, 2004 1:47 PM
> > To: Struts Users Mailing List
> > Subject: Initialization stuff
> > 
> > 
> > Hi!
> > 
> > I would like to call an initialization class when my web 
> > application is loaded in the container to perform some extra 
> > init tasks. How should I do this? My idea was to subclass the 
> > ActionServlet and override the init method, is this ok or is 
> > there a better way to do this?
> > 
> > Any help is welcome.
> > 
> > Thanks!
> > 
> > -- 
> > Saludos,
> > 
> > Martin I. Levi
> > 
> > Centre Tecnològic de Transferenciència de Calor
> > Universitat Politècnica de Catalunya
> > www.cttc.upc.edu
> > 
> > 
> > -
> > 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]
-- 
Saludos,

Martin I. Levi

Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu


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



Re: Initialization stuff

2004-07-13 Thread Emmanouil Batsis
Martin I. Levi wrote:
Is this a better solution than mine?
Although I often use servlets for initialization, Paul's suggestion is 
better because ServletContextListener was designed exactly for 
initialization/finalization purposes.

Using the right tool for the job is a good practice even if you gain 
nothing more in functionality; it makes your application 
components/logic easier to identify later.

So i guess I should refactor too ;-)
Manos
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Validator confusion

2004-07-13 Thread nikhil walvekar
Hi,all
 
in class 
org.apache.commons.validator.Field
There are two member fileds.
indexedProperty
protected java.lang.String indexedProperty

-

indexedListProperty
protected java.lang.String indexedListProperty

-

 
indexedListProperty is the one which we use while validating fields from list 
(collection).
What is indexedProperty and where it is used and how?
 
Please help me out
 
Thanks
 
Nikhil

Yahoo! India Careers: Over 65,000 jobsonline.

Re: Check for forward

2004-07-13 Thread Bill Siggelkow
Create a custom RequestProcessor that extends the Struts 
RequestProcessor. In the custom class override the processForwardConfig 
method to do whatever you want.

Emmanouil Batsis wrote:
Bill Siggelkow wrote:
You can use container-managed security to restrict access to URLs -- 
IIRC direct requests (or redirects) to the resources is restricted, 
but forwards are not.

True, as Michael also suggests (WEB-INF is by default protected by the 
container). However, I need some more flexibility without having to move 
 pages between folders or play with container config files.

So I guess my question should be rephrased as "looking for something in 
the Struts APIs to check if the request has been forwarded or not", as 
all requests go through struts and perhaps there could be something in 
there for this; J2EE-based solutions are known but i'm looking for 
something better.

Thanks,
Manos

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


RE: Initialization stuff

2004-07-13 Thread Martin I. Levi
Is this a better solution than mine?

On Tue, 2004-07-13 at 14:06, Paul McCulloch wrote:
> You can do this by creating a class which implements
> javax.servlet.ServletContextListener.
> 
> This requires a container supporting Servlet 2.3.
> 
> Paul
> 
> > -Original Message-
> > From: Martin I. Levi [mailto:[EMAIL PROTECTED]
> > Sent: 13 July 2004 12:47
> > To: Struts Users Mailing List
> > Subject: Initialization stuff
> > 
> > 
> > Hi!
> > 
> > I would like to call an initialization class when my web 
> > application is
> > loaded in the container to perform some extra init tasks. How should I
> > do this?
> > My idea was to subclass the ActionServlet and override the 
> > init method,
> > is this ok or is there a better way to do this?
> > 
> > Any help is welcome.
> > 
> > Thanks!
> > 
> > -- 
> > Saludos,
> > 
> > Martin I. Levi
> > 
> > Centre Tecnològic de Transferenciència de Calor
> > Universitat Politècnica de Catalunya
> > www.cttc.upc.edu
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> **
> Axios Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this message. If you are not 
> the addressee indicated in this message (or responsible for delivery of the message 
> to such person), you may not copy or deliver this message to anyone. In such case, 
> you should destroy this message, and notify us immediately. If you or your employer 
> does not consent to Internet email messages of this kind, please advise us 
> immediately. Opinions, conclusions and other information expressed in this message 
> are not given or endorsed by my Company or employer unless otherwise indicated by an 
> authorised representative independent of this message.
> WARNING:
> While Axios Systems Ltd takes steps to prevent computer viruses from being 
> transmitted via electronic mail attachments we cannot guarantee that attachments do 
> not contain computer virus code.  You are therefore strongly advised to undertake 
> anti virus checks prior to accessing the attachment to this electronic mail.  Axios 
> Systems Ltd grants no warranties regarding performance use or quality of any 
> attachment and undertakes no liability for loss or damage howsoever caused.
> **
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Saludos,

Martin I. Levi

Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu


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



Re: Check for forward

2004-07-13 Thread Emmanouil Batsis
Bill Siggelkow wrote:
You can use container-managed security to restrict access to URLs -- 
IIRC direct requests (or redirects) to the resources is restricted, but 
forwards are not.
True, as Michael also suggests (WEB-INF is by default protected by the 
container). However, I need some more flexibility without having to move 
 pages between folders or play with container config files.

So I guess my question should be rephrased as "looking for something in 
the Struts APIs to check if the request has been forwarded or not", as 
all requests go through struts and perhaps there could be something in 
there for this; J2EE-based solutions are known but i'm looking for 
something better.

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


Validator confusion

2004-07-13 Thread nikhil walvekar
Hi,all
 
in class 
org.apache.commons.validator.Field
There are two member fileds.
indexedProperty
protected java.lang.String indexedProperty

-

indexedListProperty
protected java.lang.String indexedListProperty

-

 
indexedListProperty is the one which we use while validating fields from list 
(collection).
What is indexedProperty and where it is used and how?
 
Please help me out
 
Thanks
 
Nikhil

Yahoo! India Careers: Over 65,000 jobsonline.

Re: logic:iterate fails on (large) collection

2004-07-13 Thread Bill Siggelkow
Oops -- my bad -- the JSP comments are balanced <%-- --%>
Bill Siggelkow wrote:
It is not the size of the collection you are having the problem with but 
more likely it is data-related. Make sure you view the source that gets 
generated -- that will usually clue you into the offending data.

Hmm -- I noticed that you are using HTML comments  around some 
of your  tags.
Keep in mind that HTML comments *do not* prevent translation of the tags 
within the comments. If you truly want to comment out the tags you need 
to use JSP comments <%-- -->


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


Re: Which validator approach to use

2004-07-13 Thread Bill Siggelkow
Good point, Rick. Isn't this the sort of thing that JSF allows? Of 
course, you can bind a validation to an action mapping using the 
ValidatorActionForm -- however this still forces your business objects 
to extend this form and it doesn't solve the populate problem.

As far as the problem of migrating deeply nested VOs to Action Forms -- 
we have the same issues on the app that I am working on -- I feel your 
pain ;)

Rick Reumann wrote:
Bill Siggelkow wrote:
I would concur with Ted -- I have worked with Struts apps that take 
approach (B) -- that is, using the business object as the Form -- not 
only does this bind your business object to the Struts API -- more 
importantly, you have to make sure that all the field types are 
strings or booleans. If not, Struts will not be able to populate the 
form when bad data is sent -- the dreaded *BeanUtils.populate* error! 
So, if you have to make all your fields be strings and booleans, now 
you are letting presentation drive the spec for your business objects!

But see isn't that all a limitation of Struts and its validation 
framework? This is my major complaint I have with Struts - the 
requirment to create ActionForms simply so validation can work properly. 
I think a  much cleaner approach would be to bind a "valdiation" to your 
action-mapping and then the RequestProcessor would be a
ble to interpret
the request and validate the request parameters correctly before trying 
to populate your backing object (POJO).  I haven't really used the 
Spring framework, but I believe it behaves in some similar way - where 
the framework takes care of validation of the request parameters (not of 
an ActionForm).

I think Struts ties your hands too much forcing reliance on the use of 
ActionForms for everything. For your typical simple JSP form, 
ActionForms are not that big of a deal (although I still find them a bit 
annoying), but it really falls apart when you have to create some 
complex forms where you have a lot of nested objects. It's incredibly 
annoying trying to convert all the nested objects, sometimes in our 
case, three or four deep, into nested ActionForms. You're probably going 
"ughh" what kind of form is that:) but business requirments dictate we 
need it since we're stuck with the initial objects coming back as VOs.


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


multiple struts-config.xml and validator.xml files for dealing with "stories"

2004-07-13 Thread Mark Shifman
Ted Husted wrote:
For a large, heavy-duty-input data-driven web application, I would recommend C. 

 

C)  [Conventional class] is NOT used, data form validation is defined within the
validation.xml and handled by struts, the Action class (or some
surrogate) then enforces all business rules.
   

I've had deep discussions with other large teams in similar circumstances, and the 
consensus has been that (C) is the most safe, sane, and simple route.
I would also recommend finely-grained DynaValidatorForms to ensure only the expected properties are captured and validated. 

Nowadays, I also use finely-grained Struts configs, so that each "pageflow" or "story" is represented by its own struts-config.xml and validator.xml. This requires a strong naming convention to be sure the members of each config overlaps, but it makes it very easy to work with each use-case or story independently. 

 

Do you have an example which uses multiple struts-config.xml  and 
validator.xml files for dealing with "stories"?
...

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


Re: logic:iterate fails on (large) collection

2004-07-13 Thread Bill Siggelkow
It is not the size of the collection you are having the problem with but 
more likely it is data-related. Make sure you view the source that gets 
generated -- that will usually clue you into the offending data.

Hmm -- I noticed that you are using HTML comments  around some 
of your  tags.
Keep in mind that HTML comments *do not* prevent translation of the tags 
within the comments. If you truly want to comment out the tags you need 
to use JSP comments <%-- -->

Trygve Hardersen wrote:
Hello there
This is driving me mad, any help or hints are much appreciated. I have a
page that iterates through a collection of simple objects, and lists
them for users to select some of them (checkbox), edit a property and
submit the results (much like an inbox). This works great, when the list
has less than 10 elements, or the iteration is limited by using the
length property of the logic:iterate tag. When there are more than 10
elements, the iteration stops on the middle of writing html. The stop
point is not consistent; sometimes it writes the complete 10th element,
but no 11th, other times half of the 11th element is written. The
generated HTML page is invalid, indicated by a sudden abruption in the
middle of a tag ( without >, or a half written URL). I have tried
with different data, the same error occurs, and I cannot find anything
wrong with the objects in the list. However, I have the same page
displaying a large set of objects where none have selected checkboxes.
Is there a size limit on the indexed html list, in relation to
checkboxes? I can't find any error messages in the log or at the
generated page. This is the page code:
<%@ include file="/common/taglibs.jsp"%>












































































































function cancel(form) {
location.href = '';
}

Any ideas?
Thanks and regards
Trygve Hardersen

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


Re: Which validator approach to use

2004-07-13 Thread Rick Reumann
Bill Siggelkow wrote:
I would concur with Ted -- I have worked with Struts apps that take 
approach (B) -- that is, using the business object as the Form -- not 
only does this bind your business object to the Struts API -- more 
importantly, you have to make sure that all the field types are strings 
or booleans. If not, Struts will not be able to populate the form when 
bad data is sent -- the dreaded *BeanUtils.populate* error! So, if you 
have to make all your fields be strings and booleans, now you are 
letting presentation drive the spec for your business objects!
But see isn't that all a limitation of Struts and its validation 
framework? This is my major complaint I have with Struts - the 
requirment to create ActionForms simply so validation can work properly. 
I think a  much cleaner approach would be to bind a "valdiation" to your 
action-mapping and then the RequestProcessor would be able to interpret 
the request and validate the request parameters correctly before trying 
to populate your backing object (POJO).  I haven't really used the 
Spring framework, but I believe it behaves in some similar way - where 
the framework takes care of validation of the request parameters (not of 
an ActionForm).

I think Struts ties your hands too much forcing reliance on the use of 
ActionForms for everything. For your typical simple JSP form, 
ActionForms are not that big of a deal (although I still find them a bit 
annoying), but it really falls apart when you have to create some 
complex forms where you have a lot of nested objects. It's incredibly 
annoying trying to convert all the nested objects, sometimes in our 
case, three or four deep, into nested ActionForms. You're probably going 
"ughh" what kind of form is that:) but business requirments dictate we 
need it since we're stuck with the initial objects coming back as VOs.

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


Re: logic:iterate fails on (large) collection

2004-07-13 Thread Michael McGrady
At 05:24 AM 7/13/2004, you wrote:
This is the page code:
<%@ include file="/common/taglibs.jsp"%>

As you can see, this is not enough info.  You might want to substitute 
escape characters for the html?


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


Re: Check for forward

2004-07-13 Thread Bill Siggelkow
You can use container-managed security to restrict access to URLs -- 
IIRC direct requests (or redirects) to the resources is restricted, but 
forwards are not.

Emmanouil Batsis wrote:
Michael McGrady wrote:
You can add information to your forwards, but, since they are your 
forwards, why would you? 

I would like to protect resources from direct access (i.e. non forwarded 
requests), and was wondering if there is a more standard way to do it 
besides forcing everyone in my team to mark forwarded requests with an 
attribute.

 > I don't understand the practical reach of this
 > question.
Hope it's clearer now.
Cheers,
Manos

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


Re: Check for forward

2004-07-13 Thread Michael McGrady
There are all sorts of ways to do this.  One good one is to put all your 
jsp pages inside WEB-INF.

At 04:44 AM 7/13/2004, you wrote:
Michael McGrady wrote:
You can add information to your forwards, but, since they are your 
forwards, why would you?
I would like to protect resources from direct access (i.e. non forwarded 
requests), and was wondering if there is a more standard way to do it 
besides forcing everyone in my team to mark forwarded requests with an 
attribute.

> I don't understand the practical reach of this
> question.
Hope it's clearer now.
Cheers,
Manos
-
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: logic:iterate fails on (large) collection

2004-07-13 Thread Matthias Wessendorf
only a quick hint.

did you look into displaytags ?
-->http://displaytag.sourceforge.net/

i usem them for iterating. since they create HTML as well

hope it helps (abit...)



> -Original Message-
> From: Trygve Hardersen [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 13, 2004 2:25 PM
> To: [EMAIL PROTECTED]
> Subject: logic:iterate fails on (large) collection
> 
> 
> Hello there
> This is driving me mad, any help or hints are much 
> appreciated. I have a page that iterates through a collection 
> of simple objects, and lists them for users to select some of 
> them (checkbox), edit a property and submit the results (much 
> like an inbox). This works great, when the list has less than 
> 10 elements, or the iteration is limited by using the length 
> property of the logic:iterate tag. When there are more than 
> 10 elements, the iteration stops on the middle of writing 
> html. The stop point is not consistent; sometimes it writes 
> the complete 10th element, but no 11th, other times half of 
> the 11th element is written. The generated HTML page is 
> invalid, indicated by a sudden abruption in the middle of a 
> tag ( without >, or a half written URL). I have tried 
> with different data, the same error occurs, and I cannot find 
> anything wrong with the objects in the list. However, I have 
> the same page displaying a large set of objects where none 
> have selected checkboxes. Is there a size limit on the 
> indexed html list, in relation to checkboxes? I can't find 
> any error messages in the log or at the generated page. This 
> is the page code:
> 
> <%@ include file="/common/taglibs.jsp"%>
> 
> 
>   
>   
>property="orders" scope="session">
>   
>   
>property="orders" scope="session">
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>property="orders" scope="session">
>   
>   
>paramId="id" paramName="orders" paramProperty="oaseId">
>   
>   
>   
>   
>name="orders" property="webOrderParameters" target="webWindow">
>   
>   
>   
>   
>paramId="transact" paramName="orders" paramProperty="dibsId" 
> target="dibsWindow">
>   
>   
>   
>   
>   
>dateStyle="${initParam.dateFormat}" value="${orders.bookingDate}"/>
>   
>   
>property="orderDate">
>dateStyle="${initParam.dateFormat}" value="${orders.orderDate}"/>
>   
>   
>   
>   
>   
>minFractionDigits="${initParam.moneyMinFractions}"
> maxFractionDigits="${initParam.moneyMaxFractions}"
> value="${orders.authAmount}"/>
>   
>   
>   
>   
>minFractionDigits="${initParam.moneyMinFractions}"
> maxFractionDigits="${initParam.moneyMaxFractions}"
> value="${orders.oaseSum}" var="bookedSum"/>
>property="oaseSum" value="${bookedSum}" indexed="true" size="10"/>
>   
>   
>   
>   
>   
>   
>property="capture" indexed="true" value="true"/>
>   
>   
>   
>   
>   
>   
> 
>   
> 
> 
> 
>  onclick="cancel(this.form)">
> 
> 
> 
> 
> 
> 
> 
> function cancel(form) {
> location.href = '';
> }
> 
> 
> Any ideas?
> 
> Thanks and regards
> Trygve Hardersen
> 
> 
> -
> 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]



logic:iterate fails on (large) collection

2004-07-13 Thread Trygve Hardersen
Hello there
This is driving me mad, any help or hints are much appreciated. I have a
page that iterates through a collection of simple objects, and lists
them for users to select some of them (checkbox), edit a property and
submit the results (much like an inbox). This works great, when the list
has less than 10 elements, or the iteration is limited by using the
length property of the logic:iterate tag. When there are more than 10
elements, the iteration stops on the middle of writing html. The stop
point is not consistent; sometimes it writes the complete 10th element,
but no 11th, other times half of the 11th element is written. The
generated HTML page is invalid, indicated by a sudden abruption in the
middle of a tag ( without >, or a half written URL). I have tried
with different data, the same error occurs, and I cannot find anything
wrong with the objects in the list. However, I have the same page
displaying a large set of objects where none have selected checkboxes.
Is there a size limit on the indexed html list, in relation to
checkboxes? I can't find any error messages in the log or at the
generated page. This is the page code:

<%@ include file="/common/taglibs.jsp"%>












































































































function cancel(form) {
location.href = '';
}


Any ideas?

Thanks and regards
Trygve Hardersen


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



Re: Which validator approach to use

2004-07-13 Thread Bill Siggelkow
I would concur with Ted -- I have worked with Struts apps that take 
approach (B) -- that is, using the business object as the Form -- not 
only does this bind your business object to the Struts API -- more 
importantly, you have to make sure that all the field types are strings 
or booleans. If not, Struts will not be able to populate the form when 
bad data is sent -- the dreaded *BeanUtils.populate* error! So, if you 
have to make all your fields be strings and booleans, now you are 
letting presentation drive the spec for your business objects!

Ted Husted wrote:
For a large, heavy-duty-input data-driven web application, I would recommend C. 


C)  [Conventional class] is NOT used, data form validation is defined within the
validation.xml and handled by struts, the Action class (or some
surrogate) then enforces all business rules.

I've had deep discussions with other large teams in similar circumstances, and the 
consensus has been that (C) is the most safe, sane, and simple route.
I would also recommend finely-grained DynaValidatorForms to ensure only the expected properties are captured and validated. 

Nowadays, I also use finely-grained Struts configs, so that each "pageflow" or "story" is represented by its own struts-config.xml and validator.xml. This requires a strong naming convention to be sure the members of each config overlaps, but it makes it very easy to work with each use-case or story independently. 

So instead of allocating a module or multiple struts-config to a "team" or "component", we 
allocate them to each use-case or story. You do end up with lots and lots of struts-configs, but if they are 
well-named and use strong conventions, finding what you need is actually faster and easier than pouring through 
several much larger files. You can see the trees within the forest. There also tends to be less "cruft" 
since each struts-config is cohesive and only contains the elements used by a given story.
(I discovered finely-grained struts-configs as part of a spelunking session. I pulled out all 
the elements for a pageflow to figure out how it worked, and then realized this was a pretty 
cool way to handle struts-configs in general. My team calls it "config-behind-story".)
The business rules validations are often better handled by a non-Struts component that can be used outside of Struts or shared by Struts applications. This validation can take place after the Action executes. The trick is to have the business-rules validator return messages that can be converted to Struts Action Messages. If we ever finish the migration to Commons Resources, this part will be cleaner. We may also see more uses of Commons Validator outside of web application frameworks. 

You might also want to look at Niall's extension  
which could work itself into the distribution one day if LazyDynaClass is accepted by Commons 
BeanUtils .
-Ted.

We are having an internal discussion about the best
use of struts for a large heavy-input data-driven web application.
We have discerned 4 approaches in the way we can use Struts. Given
this example class:
Class (form bean)
Public class Person extends  implements java.io.Serializable {
protected String firstName; protected String lastName; protected
int wein = 0; }
These are four types of Struts usage:
A)  Person extends ActionForm, and provides implementation for
validate() method - validate data form and data type enforcement,
and then validates some object level business rules before handing
off to Action class

B)  Person extends ValidatorForm, and provides implementation for
validate() method - validate data form through against
validation.xml through struts, and then validate some object level
business rules before handing off to Action class.

C)  Person is NOT used, data form validation is defined within the
validation.xml and handled by struts, the Action class (or some
surrogate) then enforces all business rules.
  
 
D)  Person is a business object only implementing
java.io.Serializable with no knowledge of application space, data
form validation is defined within validation.xml handled by struts,
the Action class then enforces all business rules.
  
I personally prefer C. It is my understanding that DynaActionForm
should be used as a "firewall" to collect all strings (to return
invalid data to the client), use the Validator to perform
client/server side validation, the Action then copies the form data
into business objects, and then invokes delegates to perform
business processing.
Please feel free to be candid with your views. I appreciate your
time reading this.
Thanks,


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


RE: Initialization stuff

2004-07-13 Thread Paul McCulloch
You can do this by creating a class which implements
javax.servlet.ServletContextListener.

This requires a container supporting Servlet 2.3.

Paul

> -Original Message-
> From: Martin I. Levi [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2004 12:47
> To: Struts Users Mailing List
> Subject: Initialization stuff
> 
> 
> Hi!
> 
> I would like to call an initialization class when my web 
> application is
> loaded in the container to perform some extra init tasks. How should I
> do this?
> My idea was to subclass the ActionServlet and override the 
> init method,
> is this ok or is there a better way to do this?
> 
> Any help is welcome.
> 
> Thanks!
> 
> -- 
> Saludos,
> 
> Martin I. Levi
> 
> Centre Tecnològic de Transferenciència de Calor
> Universitat Politècnica de Catalunya
> www.cttc.upc.edu
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



RE: Initialization stuff

2004-07-13 Thread Matthias Wessendorf
Perhaps you can write a Plugin

that is the way how tiles and Validator gets init.

http://struts.apache.org/api/org/apache/struts/action/PlugIn.html

regards

> -Original Message-
> From: Martin I. Levi [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 13, 2004 1:47 PM
> To: Struts Users Mailing List
> Subject: Initialization stuff
> 
> 
> Hi!
> 
> I would like to call an initialization class when my web 
> application is loaded in the container to perform some extra 
> init tasks. How should I do this? My idea was to subclass the 
> ActionServlet and override the init method, is this ok or is 
> there a better way to do this?
> 
> Any help is welcome.
> 
> Thanks!
> 
> -- 
> Saludos,
> 
> Martin I. Levi
> 
> Centre Tecnològic de Transferenciència de Calor
> Universitat Politècnica de Catalunya
> www.cttc.upc.edu
> 
> 
> -
> 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]



Initialization stuff

2004-07-13 Thread Martin I. Levi
Hi!

I would like to call an initialization class when my web application is
loaded in the container to perform some extra init tasks. How should I
do this?
My idea was to subclass the ActionServlet and override the init method,
is this ok or is there a better way to do this?

Any help is welcome.

Thanks!

-- 
Saludos,

Martin I. Levi

Centre Tecnològic de Transferenciència de Calor
Universitat Politècnica de Catalunya
www.cttc.upc.edu


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



Declarative Exception Handling

2004-07-13 Thread Ashutosh Satyam
Hi All,
 If I'm going by the Declarative Exception handling approach,
either by configuring  in the struts-config.xml file
or by using the exception element of , how do I replace 
parameter values for the key pointing to the message resource 
property file.

+ +
| |
|   |
+-+

some.key=Error Occured : {0}

Kindly provide some insight into it.


Regards,
Ashutosh

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



Re: Check for forward

2004-07-13 Thread Emmanouil Batsis
Michael McGrady wrote:
You can add information to your forwards, but, since they are your 
forwards, why would you? 
I would like to protect resources from direct access (i.e. non forwarded 
requests), and was wondering if there is a more standard way to do it 
besides forcing everyone in my team to mark forwarded requests with an 
attribute.

> I don't understand the practical reach of this
> question.
Hope it's clearer now.
Cheers,
Manos
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Validator confusion

2004-07-13 Thread nikhil walvekar

Hi,all

in class 
org.apache.commons.validator.Field
There are two member fields.
indexedProperty
protected java.lang.String indexedProperty

-
indexedListProperty
protected java.lang.String indexedListProperty


Please tell me differnce between the two.

In validation we user indexedListProperty then for which purpose indexedProperty is 
used and how?

Nikhil


Yahoo! India Careers: Over 65,000 jobsonline.

Re: Check for forward

2004-07-13 Thread Michael McGrady
You can add information to your forwards, but, since they are your 
forwards, why would you?  I don't understand the practical reach of this 
question.

At 03:56 AM 7/13/2004, you wrote:

Is there a way to "know" whether the HttpServletRequest I am processing 
(in my action or whatever) was forwarded and thus is not a direct or 
redirected request?

Thanks,
Manos
-
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: Check for forward

2004-07-13 Thread ravi.vedala

My 2 cents :

Add an attribute and decide from that !!

-Original Message-
From: Emmanouil Batsis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 13, 2004 4:26 PM
To: Struts Users Mailing List
Subject: Check for forward





Is there a way to "know" whether the HttpServletRequest I am processing
(in my action or whatever) was forwarded and thus is not a direct or
redirected request?

Thanks,

Manos

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


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Check for forward

2004-07-13 Thread Emmanouil Batsis

Is there a way to "know" whether the HttpServletRequest I am processing 
(in my action or whatever) was forwarded and thus is not a direct or 
redirected request?

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


Please HELP with HARD problem: STRUTS-tags VS Proxy, Weblogic loadbalancing, and BASE tag

2004-07-13 Thread Lukas Latz
Hi List,

Sent this yesterday, but it seemed to not get through to the list. My
apologies if it's come through already. :

I'm badly stuck with a STRUTS web-app that runs fine on Tomcat, but refuses
to bahave nicely in production, where a Netscape Proxy on port 80 maps to a
Netscape Webserver on port 8080, which in turn, with Weblogic plugin, does
loadbalancing to 2 Weblogic machines on port 7001.

As I don't have a lot of STRUTS experience, I stuck closely to the
struts-blank application and tuto, and used the struts-html tags as
advertised, including the  tag and the  tag.

Accessed through the proxy, the RequestUtils.getActionMappingURL() that (it
appears) does the real work inside those tags produces wrong servername /
port combinations (correct would be the Proxy's name on port 80).

What compounds the problem is that the web-app is a frameset.
Unusual, granted, but works just fine in Tomcat (inter-frame communication
with event-model using javascript).

The wrong resolution of  leads to multiple user-sessions within
the frameset (Bad Thing) (one session per frame).

Without success, we've tried several strategies to get around the problem:

- use  or just the regular html  tag, hard setting server
to proper value -> still gets multiple sessions, also can't get the port
right.

- get rid of  tag in all incarnations, only use relative links from /
level, works just fine on tomcat but still fails in production, presumably
because the  tag still resolves wrong?
.. could also be because I still use RequestUtils.getActionMappingURL() to
get the URL for the frame src definitions in the frameset. I had trouble
getting the frames any other way in the absence of the base tag.


I'm now wondering if I can safely do completely without RequestUtils and use
simple html  instead of struts  ??

Does the core functionality of Actions, ActionForms and mappings still work
if I replace the struts  tag with just  ??

Or is there another way around this?

Any pointers much appreciated !

Lukas





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



Re: Which validator approach to use

2004-07-13 Thread Ted Husted
For a large, heavy-duty-input data-driven web application, I would recommend C.

> C)  [Conventional class] is NOT used, data form validation is defined within the
> validation.xml and handled by struts, the Action class (or some
> surrogate) then enforces all business rules.

I've had deep discussions with other large teams in similar circumstances, and the 
consensus has been that (C) is the most safe, sane, and simple route.

I would also recommend finely-grained DynaValidatorForms to ensure only the expected 
properties are captured and validated.

Nowadays, I also use finely-grained Struts configs, so that each "pageflow" or "story" 
is represented by its own struts-config.xml and validator.xml. This requires a strong 
naming convention to be sure the members of each config overlaps, but it makes it very 
easy to work with each use-case or story independently.

So instead of allocating a module or multiple struts-config to a "team" or 
"component", we allocate them to each use-case or story. You do end up with lots and 
lots of struts-configs, but if they are well-named and use strong conventions, finding 
what you need is actually faster and easier than pouring through several much larger 
files. You can see the trees within the forest. There also tends to be less "cruft" 
since each struts-config is cohesive and only contains the elements used by a given 
story.

(I discovered finely-grained struts-configs as part of a spelunking session. I pulled 
out all the elements for a pageflow to figure out how it worked, and then realized 
this was a pretty cool way to handle struts-configs in general. My team calls it 
"config-behind-story".)

The business rules validations are often better handled by a non-Struts component that 
can be used outside of Struts or shared by Struts applications. This validation can 
take place after the Action executes. The trick is to have the business-rules 
validator return messages that can be converted to Struts Action Messages. If we ever 
finish the migration to Commons Resources, this part will be cleaner. We may also see 
more uses of Commons Validator outside of web application frameworks.

You might also want to look at Niall's extension 
 which could work itself into the 
distribution one day if LazyDynaClass is accepted by Commons BeanUtils 
.

-Ted.

>We are having an internal discussion about the best
> use of struts for a large heavy-input data-driven web application.
>
> We have discerned 4 approaches in the way we can use Struts. Given
> this example class:
>
> Class (form bean)
> Public class Person extends  implements java.io.Serializable {
> protected String firstName; protected String lastName; protected
> int wein = 0; }
>
> These are four types of Struts usage:
>
> A)  Person extends ActionForm, and provides implementation for
> validate() method - validate data form and data type enforcement,
> and then validates some object level business rules before handing
> off to Action class
>
> 
>
> B)  Person extends ValidatorForm, and provides implementation for
> validate() method - validate data form through against
> validation.xml through struts, and then validate some object level
> business rules before handing off to Action class.
>
> 
>
> C)  Person is NOT used, data form validation is defined within the
> validation.xml and handled by struts, the Action class (or some
> surrogate) then enforces all business rules.
>
>  type="org.apache.struts.validator.DynaValidatorForm" >  property name="firstName" type="java.lang.String"/>  name="lastName" type="java.lang.String"/>
>  
>
> D)  Person is a business object only implementing
> java.io.Serializable with no knowledge of application space, data
> form validation is defined within validation.xml handled by struts,
> the Action class then enforces all business rules.
>
>  type="org.apache.struts.validator.DynaValidatorForm" >  property name="employee" type="com.merck.Person "/> 
>
> I personally prefer C. It is my understanding that DynaActionForm
> should be used as a "firewall" to collect all strings (to return
> invalid data to the client), use the Validator to perform
> client/server side validation, the Action then copies the form data
> into business objects, and then invokes delegates to perform
> business processing.
>
> Please feel free to be candid with your views. I appreciate your
> time reading this.
>
> Thanks,


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



Problems in deploying struts-documentation.war in weblogic6.1 sp2

2004-07-13 Thread alok . garg
Hello,
I am trying to deploy the struts-documentation.war that comes with struts 
1.1 on weblogic 6.1 sp2. It does not deploy the application and it gives 
the following error:



  
 <> <101158>  
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1525)
at 
weblogic.utils.jars.ManifestEntry.stream(ManifestEntry.java:166)
at weblogic.utils.jars.Manifest.stream(Manifest.java:78)
at 
weblogic.servlet.internal.WebAppHelper.resolveManifestName(WebAppHelper.java:398)
at 
weblogic.servlet.internal.WebAppHelper.extractClassFiles(WebAppHelper.java:177)
at 
weblogic.servlet.internal.WebAppServletContext.extractClassFiles(WebAppServletContext.java:3405)
at 
weblogic.servlet.internal.WebAppServletContext.setDocroot(WebAppServletContext.java:3376)
at 
weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:862)
at 
weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:815)
at 
weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:428)
at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
at weblogic.j2ee.Application.addComponent(Application.java:163)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at 
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
at 
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
at 
weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76)
at java.lang.reflect.Method.invoke(Native Method)
at 
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at 
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at 
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at 
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at 
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy29.addWebDeployment(Unknown Source)
at 
weblogic.management.configuration.WebServerMBean_CachingStub.addWebDeployment(WebServerMBean_CachingStub.java:1121)
at 
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:315)
at 
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
at java.lang.reflect.Method.invoke(Native Method)
at 
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at 
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at 
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at 
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:491)
at 
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:361)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at 
weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:984)
at 
weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:971)
at 
weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:956)
at 
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:648)
at 
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at 
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at 
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at 
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy64.addTarget(Unknown Source)
at 
weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(ApplicationManager.java:867)
at 
weblogic.management.mbeans.custom.ApplicationManager.addApplication(ApplicationManager.java:966)
at 
weblogic.management.mbeans.custom.ApplicationManager.addApplication(ApplicationManager.java:886)
at 
weblogic.management.mbeans.custom.ApplicationManager.poll(Appl