RE: getting non-struts form elements

2004-05-14 Thread None None
Good, that's what I had assumed was the case.  The app I'm converting next 
week was based on a home-grown framework, and at least in the first 
iteration it's easiest to not even think about ActionForms.  We have Value 
Object classes that are akin to ActionForms, except that they are just 
transfer mechanisms, no notion of validation whatsoever, and then we have 
App Controllers, which are Actions.  So, my conversion should mostly just 
amount to changing the classes these extend from (the Actions anyway), and 
then converting my Profile XML to struts-config.xml form, not too big a deal 
in theory.  Knowing that this assumption was correct removes one potential 
hassle.  Thanks!


From: Avinash Gangadharan <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: getting non-struts form elements
Date: Fri, 14 May 2004 15:46:24 -0700
Exactly, that's true. If you just want a struts action performing your
request processing you do not need any form.
Your mapping will look something like.

And in your action class you can then do the same thing as earlier :
public ActionForward execute(ActionMapping mapping, ActionForm form,
 HttpServletRequest request, HttpServletResponse response)
 throws java.lang.Exception {
String xxx = ( String ) request.getParameter("xxx");
// now do anything with xxx
}
But as pointed out in one of the mails in the thread, without an 
ActionForm,
you won't be able to use the Struts  and related tags and form
validation.



-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 3:27 PM
To: 'Struts Users Mailing List'
Subject: RE: getting non-struts form elements

Actually, it's not at all the case.
To merge a couple of simultaneous threads here, my app has a link that lets
the user toggle between languages. It calls an action that cares nothing
about any form. It just looks at the current Locale  and goes on
:-)
You only need an ActionForm in your action if you need to get told 
something
about what to do by the user. If the fact the action is being called is
sufficient knowledge, then dispense with the form declaration.

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 6:12 PM
> To: [EMAIL PROTECTED]
> Subject: RE: getting non-struts form elements
>
>
> Is it the case that every Action MUST be associated with an
> ActionForm?
> Next week I have to start converting an app to Struts, and one of the
> assumptions I've been making is that I can just NOT associate
> any ActionForm
> with the Actions.  As you say it's not a big deal, I can just
> do the empty
> form like you said, but I'd like to know if that's the only way...
>
>
> >From: Avinash Gangadharan <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: getting non-struts form elements
> >Date: Fri, 14 May 2004 15:08:10 -0700
> >
> >Matt,
> >In your action class, you have the request and the response object
> >which will get you all your form elements
> >
> >public ActionForward execute(ActionMapping mapping, ActionForm form,
> > HttpServletRequest request, HttpServletResponse response)
> > throws java.lang.Exception {
> >   String xxx = ( String ) request.getParameter("xxx");
> >   // now do anything with xxx
> >}
> >
> >As far as configuring your action in the struts-config, you can
> >associate
> >an
> >empty form to your action :
> >
> >  > name="emptyForm"
> > type="org.apache.struts.action.DynaActionForm"/>
> >
> >
> >and then add 'name="emptyForm"' in your action mapping:
> >
> >   > type="your.action.type"
> > name="emptyForm"
> > scope="request"
> > >
> >> name="..."
> > path="..."/>
> >   
> >
> >
> >I hope this is what you are looking for.
> >
> >Avinash
> >
> >
> >
> >
> >-Original Message-
> >From: Matt Bathje [mailto:[EMAIL PROTECTED]
> >Sent: Friday, May 14, 2004 2:45 PM
> >To: Struts Users Mailing List
> >Subject: getting non-struts form elements
> >
> >
> >Hi all.
> >
> >I have a form that is not a struts form bean (no actionform, no
> >dynaform,
> >nothing...)
> >
> >Is it possible to have this submit to a struts action, and read the
> >form elements somehow? I need to be able to read simple (String)
> >elements as well as multi-part (formfile) elements from the form.
> >
> >Any way to do it in struts, or do I just need to give up and make
> >something non-struts to do it?
> >
> >
> >
> >Thanks,
> >Matt Bathje
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTE

RE: getting non-struts form elements

2004-05-14 Thread Avinash Gangadharan
Exactly, that's true. If you just want a struts action performing your
request processing you do not need any form. 
Your mapping will look something like.



And in your action class you can then do the same thing as earlier :

public ActionForward execute(ActionMapping mapping, ActionForm form,
 HttpServletRequest request, HttpServletResponse response)
 throws java.lang.Exception {
String xxx = ( String ) request.getParameter("xxx");
// now do anything with xxx
}

But as pointed out in one of the mails in the thread, without an ActionForm,
you won't be able to use the Struts  and related tags and form
validation.





-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 3:27 PM
To: 'Struts Users Mailing List'
Subject: RE: getting non-struts form elements



Actually, it's not at all the case.

To merge a couple of simultaneous threads here, my app has a link that lets
the user toggle between languages. It calls an action that cares nothing
about any form. It just looks at the current Locale  and goes on
:-)

You only need an ActionForm in your action if you need to get told something
about what to do by the user. If the fact the action is being called is
sufficient knowledge, then dispense with the form declaration.

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 6:12 PM
> To: [EMAIL PROTECTED]
> Subject: RE: getting non-struts form elements
> 
> 
> Is it the case that every Action MUST be associated with an
> ActionForm?  
> Next week I have to start converting an app to Struts, and one of the 
> assumptions I've been making is that I can just NOT associate 
> any ActionForm 
> with the Actions.  As you say it's not a big deal, I can just 
> do the empty 
> form like you said, but I'd like to know if that's the only way...
> 
> 
> >From: Avinash Gangadharan <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: getting non-struts form elements
> >Date: Fri, 14 May 2004 15:08:10 -0700
> >
> >Matt,
> >In your action class, you have the request and the response object
> >which will get you all your form elements
> >
> >public ActionForward execute(ActionMapping mapping, ActionForm form,
> > HttpServletRequest request, HttpServletResponse response)
> > throws java.lang.Exception {
> > String xxx = ( String ) request.getParameter("xxx");
> > // now do anything with xxx
> >}
> >
> >As far as configuring your action in the struts-config, you can
> >associate
> >an
> >empty form to your action :
> >
> >  > name="emptyForm"
> > type="org.apache.struts.action.DynaActionForm"/>
> >
> >
> >and then add 'name="emptyForm"' in your action mapping:
> >
> >   > type="your.action.type"
> > name="emptyForm"
> > scope="request"
> > >
> >> name="..."
> > path="..."/>
> >   
> >
> >
> >I hope this is what you are looking for.
> >
> >Avinash
> >
> >
> >
> >
> >-Original Message-
> >From: Matt Bathje [mailto:[EMAIL PROTECTED]
> >Sent: Friday, May 14, 2004 2:45 PM
> >To: Struts Users Mailing List
> >Subject: getting non-struts form elements
> >
> >
> >Hi all.
> >
> >I have a form that is not a struts form bean (no actionform, no
> >dynaform,
> >nothing...)
> >
> >Is it possible to have this submit to a struts action, and read the
> >form elements somehow? I need to be able to read simple (String) 
> >elements as well as multi-part (formfile) elements from the form.
> >
> >Any way to do it in struts, or do I just need to give up and make
> >something non-struts to do it?
> >
> >
> >
> >Thanks,
> >Matt Bathje
> >
> >
> >-
> >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]
> >
> 
> _
> Check out the coupons and bargains on MSN Offers!
http://youroffers.msn.com


-
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: Server side validation

2004-05-14 Thread Samuel Rochas
Hello Geeta,
I've solved the problem, still don't really understand the reason.
I've defined a global forward for the input of my reluctant form, and 
now, in case of validation error, I am forwarded to the desired page, 
not to the blank one.

Thanks for you help.
Samuel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: getting non-struts form elements

2004-05-14 Thread Joe Hertz

Actually, it's not at all the case.

To merge a couple of simultaneous threads here, my app has a link that
lets the user toggle between languages. It calls an action that cares
nothing about any form. It just looks at the current Locale  and goes on
:-)

You only need an ActionForm in your action if you need to get told
something about what to do by the user. If the fact the action is being
called is sufficient knowledge, then dispense with the form declaration.

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 14, 2004 6:12 PM
> To: [EMAIL PROTECTED]
> Subject: RE: getting non-struts form elements
> 
> 
> Is it the case that every Action MUST be associated with an 
> ActionForm?  
> Next week I have to start converting an app to Struts, and one of the 
> assumptions I've been making is that I can just NOT associate 
> any ActionForm 
> with the Actions.  As you say it's not a big deal, I can just 
> do the empty 
> form like you said, but I'd like to know if that's the only way...
> 
> 
> >From: Avinash Gangadharan <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: getting non-struts form elements
> >Date: Fri, 14 May 2004 15:08:10 -0700
> >
> >Matt,
> >In your action class, you have the request and the response object 
> >which will get you all your form elements
> >
> >public ActionForward execute(ActionMapping mapping, ActionForm form,
> > HttpServletRequest request, HttpServletResponse response)
> > throws java.lang.Exception {
> > String xxx = ( String ) request.getParameter("xxx");
> > // now do anything with xxx
> >}
> >
> >As far as configuring your action in the struts-config, you can 
> >associate
> >an
> >empty form to your action :
> >
> >  > name="emptyForm"
> > type="org.apache.struts.action.DynaActionForm"/>
> >
> >
> >and then add 'name="emptyForm"' in your action mapping:
> >
> >   > type="your.action.type"
> > name="emptyForm"
> > scope="request"
> > >
> >> name="..."
> > path="..."/>
> >   
> >
> >
> >I hope this is what you are looking for.
> >
> >Avinash
> >
> >
> >
> >
> >-Original Message-
> >From: Matt Bathje [mailto:[EMAIL PROTECTED]
> >Sent: Friday, May 14, 2004 2:45 PM
> >To: Struts Users Mailing List
> >Subject: getting non-struts form elements
> >
> >
> >Hi all.
> >
> >I have a form that is not a struts form bean (no actionform, no 
> >dynaform,
> >nothing...)
> >
> >Is it possible to have this submit to a struts action, and read the 
> >form elements somehow? I need to be able to read simple (String) 
> >elements as well as multi-part (formfile) elements from the form.
> >
> >Any way to do it in struts, or do I just need to give up and make 
> >something non-struts to do it?
> >
> >
> >
> >Thanks,
> >Matt Bathje
> >
> >
> >-
> >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]
> >
> 
> _
> Check out the coupons and bargains on MSN Offers! 
http://youroffers.msn.com


-
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: getting non-struts form elements

2004-05-14 Thread Hubert Rabago
You can use request.getParameter()/getParameterValues() inside an Action to
retrieve form values without using an ActionForm.  However, without an
ActionForm, you won't be able to use the Struts  and related tags
and form validation.

--- None None <[EMAIL PROTECTED]> wrote:
> Is it the case that every Action MUST be associated with an ActionForm?  
> Next week I have to start converting an app to Struts, and one of the 
> assumptions I've been making is that I can just NOT associate any
> ActionForm 
> with the Actions.  As you say it's not a big deal, I can just do the empty 
> form like you said, but I'd like to know if that's the only way...
> 
> 
> >From: Avinash Gangadharan <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: getting non-struts form elements
> >Date: Fri, 14 May 2004 15:08:10 -0700
> >
> >Matt,
> >In your action class, you have the request and the response object which
> >will get you all your form elements
> >
> >public ActionForward execute(ActionMapping mapping, ActionForm form,
> > HttpServletRequest request, HttpServletResponse response)
> > throws java.lang.Exception {
> > String xxx = ( String ) request.getParameter("xxx");
> > // now do anything with xxx
> >}
> >
> >As far as configuring your action in the struts-config, you can associate 
> >an
> >empty form to your action :
> >
> >  > name="emptyForm"
> > type="org.apache.struts.action.DynaActionForm"/>
> >
> >
> >and then add 'name="emptyForm"' in your action mapping:
> >
> >   > type="your.action.type"
> > name="emptyForm"
> > scope="request"
> > >
> >> name="..."
> > path="..."/>
> >   
> >
> >
> >I hope this is what you are looking for.
> >
> >Avinash
> >
> >
> >
> >
> >-Original Message-
> >From: Matt Bathje [mailto:[EMAIL PROTECTED]
> >Sent: Friday, May 14, 2004 2:45 PM
> >To: Struts Users Mailing List
> >Subject: getting non-struts form elements
> >
> >
> >Hi all.
> >
> >I have a form that is not a struts form bean (no actionform, no dynaform,
> >nothing...)
> >
> >Is it possible to have this submit to a struts action, and read the form
> >elements somehow? I need to be able to read simple (String) elements as 
> >well
> >as multi-part (formfile) elements from the form.
> >
> >Any way to do it in struts, or do I just need to give up and make
> something
> >non-struts to do it?
> >
> >
> >
> >Thanks,
> >Matt Bathje
> >
> >
> >-
> >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]
> >
> 
> _
> Check out the coupons and bargains on MSN Offers! http://youroffers.msn.com
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 





__
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

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



RE: Sharing what I've learned: locale switching

2004-05-14 Thread None None
Excellent, even better!  Thank you!
It's becoming obvious to me that I need to spend a few hours just looking at 
what's available in the Action (and other) base classes.  I've been just 
learning what I need to each step of the way, but maybe a little time 
reading through the javadocs would be useful.

Thanks again!
From: "Joe Hertz" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: Sharing what I've learned: locale switching
Date: Fri, 14 May 2004 18:09:01 -0400
Suggestion:
Rather than using the GLOBALS.Locale_Key in the session, use the
action.setLocale() method. This way you won't have to be changing your
code if the internals change.
For example, to decide between, say English and Russian, you can do this
and never mess with the httpSession directly.
Locale russian = new Locale("ru");
Locale english = Locale.ENGLISH;
if (condition == true)
{
  this.setLocale(request, english);
}
else
{
  this.setLocale(request, russian);
}
> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 2:16 PM
> To: [EMAIL PROTECTED]
> Subject: Sharing what I've learned: locale switching
>
>
> Because this might be helpful to others, and because I
> probably would have
> spent another couple of hours figuring it out on my own
> without the help of
> some people on this lsit, I wanted to give back as much as I
> could.  So,
> here's a consolidated bit of info I've learned about
> switching language in
> your Struts apps...
>
> What I have is a file manager application, more or less just
> for me to learn
> Struts.  I wanted to have the ability to switch languages
> on-the-fly.  To do
> this, I've done the following:
>
> (1) I created two files and placed them in WEB-INF/classes.  They are
> ofmResources_en.properties and ofmResources_de.properties (en
> for English,
> de for German).  These files contain various text strings in
> both language.
> For instance, there is a lable on the screen for file uploads
> which is
> defined as follows:
>
> labels.uploadFile=Upload a file:
>
> and for the German version:
>
> labels.uploadFile=hochladen Sie eine Datei:
>
> (2) I added the following entry to web.xml, as an init
> parameter of the
> ActionServlet:
>
> 
> application
> ofmResources
> 
>
> As near as I can tell, NO entries are required in
> struts-config.xml.  You
> also do NOT need to do anything for each version of the
> resource file.  As
> long as they are named x_ll.properties, where x is
> the value of the
> application parameter above, and ll is a valid country code,
> that's all
> there is to it.
>
> (3) Next, I added some flag graphics to my web pages, one an
> American flag,
> one a German flag.  Here is the HTML for them:
>
>  action="changeLocale.ofm"
> style="display:inline;">
> 
>  cellspacing="0">
>  hspace="6" border="0"
> onClick="changeLocaleForm.languageCode.value='en';">
>  border="0" onClick="changeLocaleForm.languageCode.value='de';">
> 
> 
>
> Pretty trivial stuff there.
>
> (4) Next, I created an ActionForm called
> ChangeLocaleActionForm as follows:
>
> package com.mycompany.ofm.actionforms;
> import org.apache.struts.action.*;
> public class ChangeLocaleActionForm extends ActionForm {
> private String languageCode = null;
> public ChangeLocaleActionForm() {
> languageCode = null;
> }
> public void setLanguageCode(String inLanguageCode) {
> languageCode = inLanguageCode;
> }
> public String getLsnguageCode() {
> return languageCode;
> }
> }
>
> (5) Next, I created an accompanying Action:
>
> package com.mycompany.ofm.actions;
> import java.util.*;
> import javax.servlet.http.*;
> import com.omnytex.ofm.actionforms.*;
> import org.apache.struts.*;
> import org.apache.struts.action.*;
> public class ChangeLocaleAction extends Action {
> public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request, HttpServletResponse response)
> throws Exception {
> ChangeLocaleActionForm claf =
> (ChangeLocaleActionForm)form;
> String languageCode = claf.getLsnguageCode();
>
> request.getSession().setAttribute(Globals.LOCALE_KEY, new
> Locale(languageCode));
> return mapping.findForward("showPathContents");
> }
> }
>
> As it turns out as someone here informed me, there is
> "automagically" a
> Locale in session, created based on what is sent by the
> browser.  So, by
> default on my system the value en_US is stored in session
> under the name
> Globals.LOCALE_KEY.  By the way, as near as I can tell, the
> _US portion of
> the language code doesn't matter (I'm sure it MATTERS, but
> for what I'm
> describing it doesn't).  S

RE: getting non-struts form elements

2004-05-14 Thread None None
Is it the case that every Action MUST be associated with an ActionForm?  
Next week I have to start converting an app to Struts, and one of the 
assumptions I've been making is that I can just NOT associate any ActionForm 
with the Actions.  As you say it's not a big deal, I can just do the empty 
form like you said, but I'd like to know if that's the only way...


From: Avinash Gangadharan <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: getting non-struts form elements
Date: Fri, 14 May 2004 15:08:10 -0700
Matt,
In your action class, you have the request and the response object which
will get you all your form elements
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws java.lang.Exception {
String xxx = ( String ) request.getParameter("xxx");
// now do anything with xxx
}
As far as configuring your action in the struts-config, you can associate 
an
empty form to your action :


name="emptyForm"
type="org.apache.struts.action.DynaActionForm"/>


and then add 'name="emptyForm"' in your action mapping:
 
  
  
I hope this is what you are looking for.
Avinash

-Original Message-
From: Matt Bathje [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:45 PM
To: Struts Users Mailing List
Subject: getting non-struts form elements
Hi all.
I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)
Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as 
well
as multi-part (formfile) elements from the form.

Any way to do it in struts, or do I just need to give up and make something
non-struts to do it?

Thanks,
Matt Bathje
-
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]
_
Check out the coupons and bargains on MSN Offers! http://youroffers.msn.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Sharing what I've learned: locale switching

2004-05-14 Thread Joe Hertz
Suggestion:

Rather than using the GLOBALS.Locale_Key in the session, use the
action.setLocale() method. This way you won't have to be changing your
code if the internals change.

For example, to decide between, say English and Russian, you can do this
and never mess with the httpSession directly.

Locale russian = new Locale("ru");
Locale english = Locale.ENGLISH;

if (condition == true)
{
  this.setLocale(request, english);
}
else
{
  this.setLocale(request, russian);
}

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 14, 2004 2:16 PM
> To: [EMAIL PROTECTED]
> Subject: Sharing what I've learned: locale switching
> 
> 
> Because this might be helpful to others, and because I 
> probably would have 
> spent another couple of hours figuring it out on my own 
> without the help of 
> some people on this lsit, I wanted to give back as much as I 
> could.  So, 
> here's a consolidated bit of info I've learned about 
> switching language in 
> your Struts apps...
> 
> What I have is a file manager application, more or less just 
> for me to learn 
> Struts.  I wanted to have the ability to switch languages 
> on-the-fly.  To do 
> this, I've done the following:
> 
> (1) I created two files and placed them in WEB-INF/classes.  They are 
> ofmResources_en.properties and ofmResources_de.properties (en 
> for English, 
> de for German).  These files contain various text strings in 
> both language.  
> For instance, there is a lable on the screen for file uploads 
> which is 
> defined as follows:
> 
> labels.uploadFile=Upload a file:
> 
> and for the German version:
> 
> labels.uploadFile=hochladen Sie eine Datei:
> 
> (2) I added the following entry to web.xml, as an init 
> parameter of the 
> ActionServlet:
> 
> 
> application
> ofmResources
> 
> 
> As near as I can tell, NO entries are required in 
> struts-config.xml.  You 
> also do NOT need to do anything for each version of the 
> resource file.  As 
> long as they are named x_ll.properties, where x is 
> the value of the 
> application parameter above, and ll is a valid country code, 
> that's all 
> there is to it.
> 
> (3) Next, I added some flag graphics to my web pages, one an 
> American flag, 
> one a German flag.  Here is the HTML for them:
> 
>  action="changeLocale.ofm" 
> style="display:inline;">
> 
>  cellspacing="0">
>  hspace="6" border="0" 
> onClick="changeLocaleForm.languageCode.value='en';">
>  border="0" onClick="changeLocaleForm.languageCode.value='de';">
> 
> 
> 
> Pretty trivial stuff there.
> 
> (4) Next, I created an ActionForm called 
> ChangeLocaleActionForm as follows:
> 
> package com.mycompany.ofm.actionforms;
> import org.apache.struts.action.*;
> public class ChangeLocaleActionForm extends ActionForm {
> private String languageCode = null;
> public ChangeLocaleActionForm() {
> languageCode = null;
> }
> public void setLanguageCode(String inLanguageCode) {
> languageCode = inLanguageCode;
> }
> public String getLsnguageCode() {
> return languageCode;
> }
> }
> 
> (5) Next, I created an accompanying Action:
> 
> package com.mycompany.ofm.actions;
> import java.util.*;
> import javax.servlet.http.*;
> import com.omnytex.ofm.actionforms.*;
> import org.apache.struts.*;
> import org.apache.struts.action.*;
> public class ChangeLocaleAction extends Action {
> public ActionForward execute(ActionMapping mapping, 
> ActionForm form, 
> HttpServletRequest request, HttpServletResponse response) 
> throws Exception {
> ChangeLocaleActionForm claf = 
> (ChangeLocaleActionForm)form;
> String languageCode = claf.getLsnguageCode();
> 
> request.getSession().setAttribute(Globals.LOCALE_KEY, new 
> Locale(languageCode));
> return mapping.findForward("showPathContents");
> }
> }
> 
> As it turns out as someone here informed me, there is 
> "automagically" a 
> Locale in session, created based on what is sent by the 
> browser.  So, by 
> default on my system the value en_US is stored in session 
> under the name 
> Globals.LOCALE_KEY.  By the way, as near as I can tell, the 
> _US portion of 
> the language code doesn't matter (I'm sure it MATTERS, but 
> for what I'm 
> describing it doesn't).  So, this allows one to switch the 
> locale (read: 
> language) of the app by clicking a flag.  No big deal.
> 
> (6) To make use of this all, there are two concerns... One is 
> messages in a 
> JSP rendered with the  tag, the other is 
> messages returned 
> from an Action that you want to display to the user.
> 
> For the JSP side of things, it's simple... you just do this...
> 
> 
> 
> Struts uses the Locale stored in session to pull the key from 
> the correct 

Re: getting non-struts form elements

2004-05-14 Thread Joe Germuska
At 4:44 PM -0500 5/14/04, Matt Bathje wrote:
Hi all.
I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)
Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as well
as multi-part (formfile) elements from the form.
Any way to do it in struts, or do I just need to give up and make something
non-struts to do it?
you can always use request.getParameter(String)
Any other solution to get a populated ActionForm would be way too 
much trouble to even consider.

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
  "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
-- Jef Raskin

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


RE: getting non-struts form elements

2004-05-14 Thread Avinash Gangadharan
Matt,
In your action class, you have the request and the response object which
will get you all your form elements

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws java.lang.Exception { 
String xxx = ( String ) request.getParameter("xxx");
// now do anything with xxx
}

As far as configuring your action in the struts-config, you can associate an
empty form to your action :




and then add 'name="emptyForm"' in your action mapping:

 
  
  


I hope this is what you are looking for.

Avinash




-Original Message-
From: Matt Bathje [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 2:45 PM
To: Struts Users Mailing List
Subject: getting non-struts form elements


Hi all.

I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)

Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as well
as multi-part (formfile) elements from the form.

Any way to do it in struts, or do I just need to give up and make something
non-struts to do it?



Thanks,
Matt Bathje


-
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: getting non-struts form elements

2004-05-14 Thread None None
Unless I'm missing something in your question, the answer is that you can 
access the elements in the request object, they should still be there when 
the submission gets to your Action.


From: "Matt Bathje" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: getting non-struts form elements
Date: Fri, 14 May 2004 16:44:44 -0500
Hi all.
I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)
Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as 
well
as multi-part (formfile) elements from the form.

Any way to do it in struts, or do I just need to give up and make something
non-struts to do it?

Thanks,
Matt Bathje
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Getting married? Find tips, tools and the latest trends at MSN Life Events. 
http://lifeevents.msn.com/category.aspx?cid=married

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


Re: How to set an ActionForm to null

2004-05-14 Thread Richard Yee
pls,
You won't get an null ActionForm in your Action, you
will just get an empty one. I think because you are
testing for null, you are always populating it from
the DB.

Regards,

Richard

--- pls <[EMAIL PROTECTED]> wrote:
> Hi Richard,
> 
>I thought this one would work for sure..  but no
> dice..  the values still
> reappear (except for the multiboxes whcih are
> cleared in the reset() method)
> after
> request.getSession().removeAttribute("MBForm");  and
> a forward to the
> next action.
> 
> 
> "Richard Yee" <[EMAIL PROTECTED]> wrote in message
>
news:[EMAIL PROTECTED]
> > pls,
> > If the form exists in session scope, then you need
> to
> > remove it from session using the
> > request.getSession.removeAttribute()
> method
> > call. Otherwise, when the JSP page is executed,
> struts
> > will use the form from the session.
> >
> > Regards,
> >
> > Richard
> >
> > --- pls <[EMAIL PROTECTED]> wrote:
> > > that won't change the form as it exists in
> session
> > > scope, only temporarily
> > > in the action.. thanks anyways
> > >
> > > "Kiran Kumar" <[EMAIL PROTECTED]> wrote in
> message
> > >
> >
>
news:[EMAIL PROTECTED]
> > > > just a guess in ur execute method try this
> > > >
> > > > form = null;
> > > >
> > > >
> > > >
> > > > --- pls <[EMAIL PROTECTED]> wrote:
> > > > > thanks for the suggestion Amol, but that
> returns
> > > an
> > > > > IllegalStateException..
> > > > > thanks for trying anyways.
> > > > >
> > > > >
> > > > > "Amol Yadwadkar" <[EMAIL PROTECTED]> wrote
> in
> > > > > message
> > > > >
> > > >
> > >
> >
>
news:[EMAIL PROTECTED]
> > > > > > Hi,
> > > > > > I havn't tried this but just try this in
> the
> > > > > execute method :--
> > > > > > public ActionForward execute(ActionMapping
> > > > > mapping, ActionForm form,
> > > > > > HttpServletRequest req,
> HttpServletResponse
> > > res) {
> > > > > > 
> > > > > > ...
> > > > > > ...
> > > > > > mapping.setAttribute(null);
> > > > > >
> > > > > > }
> > > > > >
> > > > > > Hope this may help you!!!
> > > > > > --Amol
> > > > > >
> > > > > > -Original Message-
> > > > > > From: pls [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Friday, May 14, 2004 10:03 AM
> > > > > > To: [EMAIL PROTECTED]
> > > > > > Subject: How to set an ActionForm to null
> > > > > >
> > > > > >
> > > > > > hi there,
> > > > > >
> > > > > > i am trying to set an actionform to null
> after
> > > > > inserting it's properties
> > > > > > into a DB.
> > > > > > then, control is forwarded to a different
> > > action
> > > > > and the info is read from
> > > > > > the DB back into the actionform for
> display by
> > > a
> > > > > JSP.
> > > > > >
> > > > > > the only part that is giving me trouble is
> > > with
> > > > > explicitly setting my
> > > > > > actionform "MBForm" to null.  After
> several
> > > form
> > > > > submissions and a DB
> > > > > > update, the first Action attempts to clear
> the
> > > > > values in MBForm:
> > > > > >
> > > > > >
> > > request.getSession().setAttribute("MBForm",
> > > > > null);
> > > > > >
> > > > > > after this, control is forwarded to the
> second
> > > > > Action which handles the
> > > > > > display.  it checks to see if MBForm is
> null
> > > and,
> > > > > if it is, it fills
> > > > > MBForm
> > > > > > from a DB.   in between these two actions,
> the
> > > > > controller servlet is
> > > > > > automatically refilling the MBForm with
> the
> > > values
> > > > > that I just nullified..
> > > > > > the only bean property that stays empty is
> > > myHash
> > > > > which represents several
> > > > > > groups of multiboxes.  i believe this is a
> > > result
> > > > > of the MBForm reset()
> > > > > > method which contains the following:
> > > > > >
> > > > > >  myHash.put(multiBoxCategories, new
> > > > > Integer[0]);  //resets several
> > > > > > groups of multiboxes
> > > > > >
> > > > > > setting other properties to null in the
> > > reset()
> > > > > method is not the solution
> > > > > > as it wipes the value out after every (but
> > > somehow
> > > > > it doesn't do the same
> > > > > > thing to the multiboxes?!?)
> > > > > >
> > > > > > let me know if this enough background for
> you
> > > to
> > > > > help me diagnose the
> > > > > > problem..  any discussion of reset() or is
> > > > > welcome..  thanks
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
-
> > > > > > 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!?
> > > > Yahoo! Movies - 

RE: getting non-struts form elements

2004-05-14 Thread Joe Hertz
If you want to submit it to a struts action, then presumably you can
control the action element of the form tag.

If so, why can't you associate the action with a struts form too?

It would help to have more information.

-Joe

> -Original Message-
> From: Matt Bathje [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 14, 2004 5:45 PM
> To: Struts Users Mailing List
> Subject: getting non-struts form elements
> 
> 
> Hi all.
> 
> I have a form that is not a struts form bean (no actionform, 
> no dynaform,
> nothing...)
> 
> Is it possible to have this submit to a struts action, and 
> read the form elements somehow? I need to be able to read 
> simple (String) elements as well as multi-part (formfile) 
> elements from the form.
> 
> Any way to do it in struts, or do I just need to give up and 
> make something non-struts to do it?
> 
> 
> 
> Thanks,
> Matt Bathje
> 
> 
> -
> 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]



getting non-struts form elements

2004-05-14 Thread Matt Bathje
Hi all.

I have a form that is not a struts form bean (no actionform, no dynaform,
nothing...)

Is it possible to have this submit to a struts action, and read the form
elements somehow? I need to be able to read simple (String) elements as well
as multi-part (formfile) elements from the form.

Any way to do it in struts, or do I just need to give up and make something
non-struts to do it?



Thanks,
Matt Bathje


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



Re: How to set an ActionForm to null

2004-05-14 Thread pls
Hi Richard,

   I thought this one would work for sure..  but no dice..  the values still
reappear (except for the multiboxes whcih are cleared in the reset() method)
after request.getSession().removeAttribute("MBForm");  and a forward to the
next action.


"Richard Yee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> pls,
> If the form exists in session scope, then you need to
> remove it from session using the
> request.getSession.removeAttribute() method
> call. Otherwise, when the JSP page is executed, struts
> will use the form from the session.
>
> Regards,
>
> Richard
>
> --- pls <[EMAIL PROTECTED]> wrote:
> > that won't change the form as it exists in session
> > scope, only temporarily
> > in the action.. thanks anyways
> >
> > "Kiran Kumar" <[EMAIL PROTECTED]> wrote in message
> >
> news:[EMAIL PROTECTED]
> > > just a guess in ur execute method try this
> > >
> > > form = null;
> > >
> > >
> > >
> > > --- pls <[EMAIL PROTECTED]> wrote:
> > > > thanks for the suggestion Amol, but that returns
> > an
> > > > IllegalStateException..
> > > > thanks for trying anyways.
> > > >
> > > >
> > > > "Amol Yadwadkar" <[EMAIL PROTECTED]> wrote in
> > > > message
> > > >
> > >
> >
> news:[EMAIL PROTECTED]
> > > > > Hi,
> > > > > I havn't tried this but just try this in the
> > > > execute method :--
> > > > > public ActionForward execute(ActionMapping
> > > > mapping, ActionForm form,
> > > > > HttpServletRequest req, HttpServletResponse
> > res) {
> > > > > 
> > > > > ...
> > > > > ...
> > > > > mapping.setAttribute(null);
> > > > >
> > > > > }
> > > > >
> > > > > Hope this may help you!!!
> > > > > --Amol
> > > > >
> > > > > -Original Message-
> > > > > From: pls [mailto:[EMAIL PROTECTED]
> > > > > Sent: Friday, May 14, 2004 10:03 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: How to set an ActionForm to null
> > > > >
> > > > >
> > > > > hi there,
> > > > >
> > > > > i am trying to set an actionform to null after
> > > > inserting it's properties
> > > > > into a DB.
> > > > > then, control is forwarded to a different
> > action
> > > > and the info is read from
> > > > > the DB back into the actionform for display by
> > a
> > > > JSP.
> > > > >
> > > > > the only part that is giving me trouble is
> > with
> > > > explicitly setting my
> > > > > actionform "MBForm" to null.  After several
> > form
> > > > submissions and a DB
> > > > > update, the first Action attempts to clear the
> > > > values in MBForm:
> > > > >
> > > > >
> > request.getSession().setAttribute("MBForm",
> > > > null);
> > > > >
> > > > > after this, control is forwarded to the second
> > > > Action which handles the
> > > > > display.  it checks to see if MBForm is null
> > and,
> > > > if it is, it fills
> > > > MBForm
> > > > > from a DB.   in between these two actions, the
> > > > controller servlet is
> > > > > automatically refilling the MBForm with the
> > values
> > > > that I just nullified..
> > > > > the only bean property that stays empty is
> > myHash
> > > > which represents several
> > > > > groups of multiboxes.  i believe this is a
> > result
> > > > of the MBForm reset()
> > > > > method which contains the following:
> > > > >
> > > > >  myHash.put(multiBoxCategories, new
> > > > Integer[0]);  //resets several
> > > > > groups of multiboxes
> > > > >
> > > > > setting other properties to null in the
> > reset()
> > > > method is not the solution
> > > > > as it wipes the value out after every (but
> > somehow
> > > > it doesn't do the same
> > > > > thing to the multiboxes?!?)
> > > > >
> > > > > let me know if this enough background for you
> > to
> > > > help me diagnose the
> > > > > problem..  any discussion of reset() or is
> > > > welcome..  thanks
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> -
> > > > > 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!?
> > > Yahoo! Movies - Buy advance tickets for 'Shrek 2'
> > >
> >
> http://movies.yahoo.com/showtimes/movie?mid=1808405861
> >
> >
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
>
>
>
> __
> Do you Yahoo!?
> SBC Yahoo! - Internet access at a great low price.
> http://promo.yahoo.com/sbc/




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

Re: XML stream input to Struts Action class

2004-05-14 Thread Martin Cooper

"Ashish Goswami, Noida" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi ,
> i am facing a problem where i am getting xml input from another server
over
> http to my servlet.i use request.getInputStream() to get the xml file
parse
> it and use JAXB to marashall into java objects.My question is can i use
> struts in this case  as a framework.does struts supports population of
form
> bean from xml input rather than form based post input.

You can use Struts, yes, but Struts will not populate a form bean from XML
input. You'll need to do that yourself.

--
Martin Cooper


>
> any help will be appreciable.
>
> thanks in advance
>
> Ashish
>
>
> Disclaimer:
>
> This message and any attachment(s) contained here are information that is
> confidential,proprietary to HCL Technologies and its customers, privileged
> or otherwise protected by law.The information is solely intended for the
> individual or the entity it is addressed to. If you are not the intended
> recipient of this message, you are not authorized to read, forward,
> print,retain, copy or disseminate this message or any part of it. If you
> have received this e-mail in error, please notify the sender immediately
by
> return e-mail and delete it from your computer.




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



Re: How to set an ActionForm to null

2004-05-14 Thread Richard Yee
pls,
If the form exists in session scope, then you need to
remove it from session using the
request.getSession.removeAttribute() method
call. Otherwise, when the JSP page is executed, struts
will use the form from the session.

Regards,

Richard

--- pls <[EMAIL PROTECTED]> wrote:
> that won't change the form as it exists in session
> scope, only temporarily
> in the action.. thanks anyways
> 
> "Kiran Kumar" <[EMAIL PROTECTED]> wrote in message
>
news:[EMAIL PROTECTED]
> > just a guess in ur execute method try this
> >
> > form = null;
> >
> >
> >
> > --- pls <[EMAIL PROTECTED]> wrote:
> > > thanks for the suggestion Amol, but that returns
> an
> > > IllegalStateException..
> > > thanks for trying anyways.
> > >
> > >
> > > "Amol Yadwadkar" <[EMAIL PROTECTED]> wrote in
> > > message
> > >
> >
>
news:[EMAIL PROTECTED]
> > > > Hi,
> > > > I havn't tried this but just try this in the
> > > execute method :--
> > > > public ActionForward execute(ActionMapping
> > > mapping, ActionForm form,
> > > > HttpServletRequest req, HttpServletResponse
> res) {
> > > > 
> > > > ...
> > > > ...
> > > > mapping.setAttribute(null);
> > > >
> > > > }
> > > >
> > > > Hope this may help you!!!
> > > > --Amol
> > > >
> > > > -Original Message-
> > > > From: pls [mailto:[EMAIL PROTECTED]
> > > > Sent: Friday, May 14, 2004 10:03 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: How to set an ActionForm to null
> > > >
> > > >
> > > > hi there,
> > > >
> > > > i am trying to set an actionform to null after
> > > inserting it's properties
> > > > into a DB.
> > > > then, control is forwarded to a different
> action
> > > and the info is read from
> > > > the DB back into the actionform for display by
> a
> > > JSP.
> > > >
> > > > the only part that is giving me trouble is
> with
> > > explicitly setting my
> > > > actionform "MBForm" to null.  After several
> form
> > > submissions and a DB
> > > > update, the first Action attempts to clear the
> > > values in MBForm:
> > > >
> > > >  
> request.getSession().setAttribute("MBForm",
> > > null);
> > > >
> > > > after this, control is forwarded to the second
> > > Action which handles the
> > > > display.  it checks to see if MBForm is null
> and,
> > > if it is, it fills
> > > MBForm
> > > > from a DB.   in between these two actions, the
> > > controller servlet is
> > > > automatically refilling the MBForm with the
> values
> > > that I just nullified..
> > > > the only bean property that stays empty is
> myHash
> > > which represents several
> > > > groups of multiboxes.  i believe this is a
> result
> > > of the MBForm reset()
> > > > method which contains the following:
> > > >
> > > >  myHash.put(multiBoxCategories, new
> > > Integer[0]);  //resets several
> > > > groups of multiboxes
> > > >
> > > > setting other properties to null in the
> reset()
> > > method is not the solution
> > > > as it wipes the value out after every (but
> somehow
> > > it doesn't do the same
> > > > thing to the multiboxes?!?)
> > > >
> > > > let me know if this enough background for you
> to
> > > help me diagnose the
> > > > problem..  any discussion of reset() or is
> > > welcome..  thanks
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
-
> > > > 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!?
> > Yahoo! Movies - Buy advance tickets for 'Shrek 2'
> >
>
http://movies.yahoo.com/showtimes/movie?mid=1808405861
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 





__
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

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



Re: NullPointerException - findSuccess(Unknown Source)

2004-05-14 Thread Caroline Jen
I have double checked that the signin/Welcome.jsp is
at the application root.  Therefore, the forward
statement should not cause the NullPointerException
problem.

  

What confuses me is that I have done something similar
before; i.e. I have other java class extends Action. 
And upon completion of all tasks of the class, I
successfully forward the application to my welcome
page.  

Only this ListThread.java class fails to work. 

--- Martin Gainty <[EMAIL PROTECTED]> wrote:
> Where is signin/Welcome.jsp?
> if located under WEB-INF/signin then modify forward
> statement to
>   path="/WEB-INF/signin/Welcome.jsp"/>
> Martin
> - Original Message -
> From: "Caroline Jen" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 14, 2004 10:54 AM
> Subject: NullPointerException - findSuccess(Unknown
> Source)
> 
> 
> > Need your expertise to diagnose the problem.
> >
> > I have a java class ListThread.java that extends
> > Action. This java class simply calls a couple of
> > helper classes to access my database. In the end
> of
> > the ListThread.java, it is a standard statement:
> >
> > return ( mapping.findForward( "success" ) );
> >
> >
> > I have not yet prepared a JSP to be displayed in
> the
> > browser after ListThread.java completes its tasks;
> > therefore, upon completion, I temporarily wants
> the
> > application to be forwarded to my welcome page.
> (My
> > welcome page works fine.)
> >
> > Because the ListThread.java does not really submit
> a
> > form, I simply put name="articleForm" in the
> > struts-config.xml file.  I have substituted with
> other
> > forms for testing purpose.  Nonetheless, I always
> got
> > Status 500 error:
> >
> > - Root Cause -
> > java.lang.NullPointerException
> > at
> >
>
org.apache.struts.scaffold.ParameterAction.findSuccess(Unknown
> > Source)
> > at
> >
>
org.apache.struts.scaffold.BaseAction.execute(Unknown
> > Source)
> > at
> >
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
> sor.java:484)
> > at
> >
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> > .
> > .
> >
> > My struts-config.xml looks like:
> >
> >  > roles="administrator,editor,contributor"
> > path="/message/ListThreads"
> >
> type="org.apache.artimus.message.ListThread"
> > name="articleForm"
> > scope="request"
> > validate="false">
> > > name="success"
> > path="/signin/Welcome.jsp"/>
> > 
> >
> > And here is my ListThread.java:
> >
> > import LOTS OF PACKAGES AND CLASSES;
> >
> > public final class ListThread extends Action
> > {
> >public ActionForward execute(ActionMapping
> mapping,
> > ActionForm form,
> > HttpServletRequest
> > request,
> >
> HttpServletResponse
> > response)
> > throws Exception
> >{
> >
> >   String memberName = request.getRemoteUser();
> >
> >   // for sort and order stuff
> >   String sort  = request.getParameter( "sort"
> );
> >   String order = request.getParameter( "order"
> );
> >
> >   if ( sort.length() == 0 ) sort =
> > "ThreadLastPostDate";
> >   if ( order.length()== 0 ) order = "DESC";
> >
> >   int offset  = 0;
> >   int rows=
> > MessageInboxConfig.ROWS_IN_THREADS;
> >   offset = Integer.parseInt(
> request.getParameter(
> > "offset" ) );
> >   rows = Integer.parseInt(
> request.getParameter(
> > "rows" ) );
> >
> >   ListThreadHandler lthandler = new
> > ListThreadHandler();
> >   ListPostHandler lphandler = new
> > ListPostHandler();
> >
> >   int totalThreads =
> > lthandler.getNumberOfThreads_forReceiver(
> memberName
> > );
> >   if ( offset > totalThreads )
> >   {
> >  throw new BadInputException( "The offset
> is
> > not allowed to be greater than total rows." );
> >   }
> >
> >   Collection beans =
> >
>
lthandler.getThreads_forReceiver_withSortSupport_limit(
> > memberName, offset, rows, sort, order );
> >
> >   SiteUtil.prepareNavigate( request, offset,
> > beans.size(), totalThreads,
> > MessageInboxConfig.ROWS_IN_THREADS );
> >   int totalPosts =
> > lphandler.getNumberOfPosts_forReceiver( memberName
> );
> >
> >   request.setAttribute( "ThreadBeans", beans
> );
> >   request.setAttribute( "TotalThreads", new
> > Integer( totalThreads ) );
> >   request.setAttribute( "TotalPosts", new
> Integer(
> > totalPosts ) );
> >
> >   return ( mapping.findForward( "success" ) );
> >
> >}
> > }
> >
> >
> >
> >
> >
> > __
> > Do you Yahoo!?
> > SBC Yahoo! - Internet access at a great low price.
> > http://promo.yahoo.com/sbc/
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-

Re: BeanUtils.copyProperties IllegalArument Excpetion?

2004-05-14 Thread Colin Kilburn
In my experience this works fine.
Colin
Nathan Maves wrote:
That was it!
What is the best way to set a date field as a hidden property?
Will is just work if I use 
Nathan
On May 14, 2004, at 2:10 PM, Colin Kilburn wrote:
Hi Nathan,
I had this (or a similar) problem when I tried to populate a date  
field.   It seems that a null or empty String is not a valid value 
for  conversion to a Date.   I remember the issue having something to 
do  with BeanUtils' converter not having a default value for 
Date.Any chance this is the case?

Colin
Nathan Maves wrote:
I am getting this error...
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j 
av a:39)
at   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess 
or Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at   
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyU 
ti ls.java:1789)
at   
org.apache.commons.beanutils.BeanUtils.copyProperty(BeanUtils.java: 
450)
at   
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:  
239)
at   
reporting.viewer.presentation.actions.ReportDispatch.update(ReportDisp 
at ch.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j 
av a:39)
...

When I copy a DynaActionForm to my class.  Strange thing is that I  
just  did the reverse and it worked.

Code that works ...
Report report = (Report) tree.findNode(node);
DynaActionForm dForm = (DynaActionForm)form;
BeanUtils.copyProperties(dForm, report);
Code that breaks ...
DynaActionForm dForm = (DynaActionForm) form;
Report report = new Report();
BeanUtils.copyProperties(report, dForm);
Here is the form bean ...











-
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: BeanUtils.copyProperties IllegalArument Excpetion?

2004-05-14 Thread Nathan Maves
That was it!
What is the best way to set a date field as a hidden property?
Will is just work if I use 
Nathan
On May 14, 2004, at 2:10 PM, Colin Kilburn wrote:
Hi Nathan,
I had this (or a similar) problem when I tried to populate a date  
field.   It seems that a null or empty String is not a valid value for  
conversion to a Date.   I remember the issue having something to do  
with BeanUtils' converter not having a default value for Date.
Any chance this is the case?

Colin
Nathan Maves wrote:
I am getting this error...
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j 
av a:39)
at   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess 
or Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at   
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyU 
ti ls.java:1789)
at   
org.apache.commons.beanutils.BeanUtils.copyProperty(BeanUtils.java: 
450)
at   
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:  
239)
at   
reporting.viewer.presentation.actions.ReportDispatch.update(ReportDisp 
at ch.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j 
av a:39)
...

When I copy a DynaActionForm to my class.  Strange thing is that I  
just  did the reverse and it worked.

Code that works ...
Report report = (Report) tree.findNode(node);
DynaActionForm dForm = (DynaActionForm)form;
BeanUtils.copyProperties(dForm, report);
Code that breaks ...
DynaActionForm dForm = (DynaActionForm) form;
Report report = new Report();
BeanUtils.copyProperties(report, dForm);
Here is the form bean ...











-
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: BeanUtils.copyProperties IllegalArument Excpetion?

2004-05-14 Thread Colin Kilburn
Hi Nathan,
I had this (or a similar) problem when I tried to populate a date 
field.   It seems that a null or empty String is not a valid value for 
conversion to a Date.   I remember the issue having something to do with 
BeanUtils' converter not having a default value for Date.   Any 
chance this is the case?

Colin
Nathan Maves wrote:
I am getting this error...
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at  
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUti 
ls.java:1789)
at  
org.apache.commons.beanutils.BeanUtils.copyProperty(BeanUtils.java:450)
at  
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java: 
239)
at  
reporting.viewer.presentation.actions.ReportDispatch.update(ReportDispat 
ch.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
...

When I copy a DynaActionForm to my class.  Strange thing is that I 
just  did the reverse and it worked.

Code that works ...
Report report = (Report) tree.findNode(node);
DynaActionForm dForm = (DynaActionForm)form;
BeanUtils.copyProperties(dForm, report);
Code that breaks ...
DynaActionForm dForm = (DynaActionForm) form;
Report report = new Report();
BeanUtils.copyProperties(report, dForm);
Here is the form bean ...











-
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: Using DispatchActions with validation

2004-05-14 Thread Wang, Yuanbo
Correct me if I am wrong, I don't know if this is ever possible. If the
validation method in ActionForm class returns a not null ActionErrors
obj, the flow will direct to "input" page, so if you really want to
invoke something in this case, my bet is that you have to put that logic
inside your ActionForm.validate method?

Any idea?

Thanks,
Yuanbo


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of GMaine
Sent: Friday, May 14, 2004 12:31 PM
To: [EMAIL PROTECTED]
Subject: Using DispatchActions with validation


I have a DispatchAction with two methods. I pass a hidden field "method"
in my form, to determine which method should be called. But I want to
override this and call a specific method if the form's validation fails.

Is it legitimate to put this in the action mapping?
input="/myAction.do?method=myMethod"

Or could this conflict with the "method" hidden field?

Jacob




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



BeanUtils.copyProperties IllegalArument Excpetion?

2004-05-14 Thread Nathan Maves
I am getting this error...
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at  
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUti 
ls.java:1789)
at  
org.apache.commons.beanutils.BeanUtils.copyProperty(BeanUtils.java:450)
at  
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java: 
239)
at  
reporting.viewer.presentation.actions.ReportDispatch.update(ReportDispat 
ch.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
	...

When I copy a DynaActionForm to my class.  Strange thing is that I just  
did the reverse and it worked.

Code that works ...
Report report = (Report) tree.findNode(node);
DynaActionForm dForm = (DynaActionForm)form;
BeanUtils.copyProperties(dForm, report);
Code that breaks ...
DynaActionForm dForm = (DynaActionForm) form;
Report report = new Report();
BeanUtils.copyProperties(report, dForm);
Here is the form bean ...











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


Re: How to set an ActionForm to null

2004-05-14 Thread pls
that won't change the form as it exists in session scope, only temporarily
in the action.. thanks anyways

"Kiran Kumar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> just a guess in ur execute method try this
>
> form = null;
>
>
>
> --- pls <[EMAIL PROTECTED]> wrote:
> > thanks for the suggestion Amol, but that returns an
> > IllegalStateException..
> > thanks for trying anyways.
> >
> >
> > "Amol Yadwadkar" <[EMAIL PROTECTED]> wrote in
> > message
> >
> news:[EMAIL PROTECTED]
> > > Hi,
> > > I havn't tried this but just try this in the
> > execute method :--
> > > public ActionForward execute(ActionMapping
> > mapping, ActionForm form,
> > > HttpServletRequest req, HttpServletResponse res) {
> > > 
> > > ...
> > > ...
> > > mapping.setAttribute(null);
> > >
> > > }
> > >
> > > Hope this may help you!!!
> > > --Amol
> > >
> > > -Original Message-
> > > From: pls [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, May 14, 2004 10:03 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: How to set an ActionForm to null
> > >
> > >
> > > hi there,
> > >
> > > i am trying to set an actionform to null after
> > inserting it's properties
> > > into a DB.
> > > then, control is forwarded to a different action
> > and the info is read from
> > > the DB back into the actionform for display by a
> > JSP.
> > >
> > > the only part that is giving me trouble is with
> > explicitly setting my
> > > actionform "MBForm" to null.  After several form
> > submissions and a DB
> > > update, the first Action attempts to clear the
> > values in MBForm:
> > >
> > >   request.getSession().setAttribute("MBForm",
> > null);
> > >
> > > after this, control is forwarded to the second
> > Action which handles the
> > > display.  it checks to see if MBForm is null and,
> > if it is, it fills
> > MBForm
> > > from a DB.   in between these two actions, the
> > controller servlet is
> > > automatically refilling the MBForm with the values
> > that I just nullified..
> > > the only bean property that stays empty is myHash
> > which represents several
> > > groups of multiboxes.  i believe this is a result
> > of the MBForm reset()
> > > method which contains the following:
> > >
> > >  myHash.put(multiBoxCategories, new
> > Integer[0]);  //resets several
> > > groups of multiboxes
> > >
> > > setting other properties to null in the reset()
> > method is not the solution
> > > as it wipes the value out after every (but somehow
> > it doesn't do the same
> > > thing to the multiboxes?!?)
> > >
> > > let me know if this enough background for you to
> > help me diagnose the
> > > problem..  any discussion of reset() or is
> > welcome..  thanks
> > >
> > >
> > >
> > >
> > >
> >
> -
> > > 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!?
> Yahoo! Movies - Buy advance tickets for 'Shrek 2'
> http://movies.yahoo.com/showtimes/movie?mid=1808405861




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



Indexed Properties and multiple Beans in JSP

2004-05-14 Thread Oliver
Hi,

In my JSP I get an Vector with VehicleTO-objects (which was set into the
request
from an action). Now I want to Submit the generated form to another action
with
an associated ActionForm (VehicleForm). The VehicleForm has an indexed
property
(locationScheduleEntry) of type ArrayList.
locationScheduleEntry holds references to very simple Bean-Objects with
just two attributes (vehicleId and habitationStart).
In my form, the checkbox and textfield have to be indexed.

First I did it with a little trick and set the id of the VehicleTO to the
name of
of the indexed attribute in the VehicleForm:

---SNIP--

  


 <% String
vehicleId=Integer.toString(locationScheduleEntry.getVehicleId());%>

   
  
  
---END SNIP--


The result was exactly what I want and the locationScheduleEntry in the
VehicleForm
was filled proper after submitting the form:
---SNIP--

VW
Golf

  
  
---END SNIP--


But now how can I do this without the "trick", if I got 2 or more beans
(VehicleForm and vehicles)?
The problem is, that the indexed Properties have to be indexed in the JSP
(for example with [0])
although the ArrayList from the VehicleForm is empty anyway and just needed
for submitting the
page and not for creating the content of the page.



  


<% String vehicleId=Integer.toString(vehicle.getVehicleId());%>

   





  


Now the result looks like this:






I hope you can give me some hints, how to solve this problem.

Thanks
Oliver


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



RE: Struts 1.0 --> 1.1 on iPlanet

2004-05-14 Thread Adolfo Miguelez
Well, I run in similar issues deploying in iplanetAS 6.0 SP5. I was able to 
make it start the application by patching the class loading in struts and 
digester jars, but I rejected in patching the custom tags, so I decided to 
use plain HTML instead.

WHY this happends? Maybe because iPlanet 6.0 is not a fully J2EE 1.2 
compliant appserver? I suspects that core APIs as servlets and JSPs behaves 
differently.

Any more opinions?
Regards,
Adolfo.



From: [EMAIL PROTECTED]
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Struts 1.0 --> 1.1 on iPlanet
Date: Fri, 14 May 2004 14:34:43 -0400 (EDT)
All-
In an attempt to find the limits of iWS6.0SP5, I created a simple "Hello
World" Struts app using 1.0 and have it successfully deployed and running.
To take it to the next level, I made the same app Struts 1.1 compliant by
changing the struts-config.xml to 1.1 format, upgrading stuts.jar and
including the required commons libs (digester, beanutils, etc).  Deploying
this newer version of the app causes the server to bomb with the stack
trace below.
Looking into the Stuts 1.1 source, if you trace back the line in
ActionServlet that seems to be causing the NPE, it's based on it
loading/finding the config file and then being able to find the mapping
for the incoming request.
I can't understand why iWS would be able to find the struts-config.xml
when using Struts 1.0, but not with Struts 1.1.
Has anyone run into this before?  Offer any thoughts on how to debug?  I'd
really like to get Struts 1.1 running on this baby.
-Billy
[14/May/2004:11:04:30] failure (  678): Internal error: exception thrown
from the servlet service function (uri=/hello-world/SampleAction.do):
java.la
ng.NullPointerException, Stack: java.lang.NullPointerException
at
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:854)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919)
at
com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1061)
at
com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:981)
at
com.iplanet.server.http.servlet.NSServletSession.internalRedirect(Native
Method)
at
com.iplanet.server.http.servlet.NSRequestDispatcher.forward(NSRequestDispatcher.java:48)
at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:415)
at _jsps._index_jsp._jspService(_index_jsp.java:61)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:248)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$6(JspServlet.java:238)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:519)
at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:588)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919)
at
com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1061)
at
com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:981)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

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


RE: Sharing what I've learned: locale switching

2004-05-14 Thread None None
That's good to know too, thanks very much Larry!
From: "Zhang, Larry (L.)" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Sharing what I've learned: locale switching
Date: Fri, 14 May 2004 14:53:06 -0400
Additionally, if you want other key(other than 
org.apache.struts.action.LOCALE =Globals.LOCALE_KEY) to store your locale,

you can do this:
session.setAttribute("myNewMeaningfulKey",myLocaleObject), then in your JSP 
you would use this:
. This is 
the way the locale attribute in message tag is used in struts.

Thanks.
Larry Zhang
-Original Message-
From: Wang, Yuanbo [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:40 PM
To: Struts Users Mailing List
Subject: RE: Sharing what I've learned: locale switching
Thanks for sharing the information. Basically struts using the following
method to decide which Locale is in the session, then load the
corresponding resource bundle:
protected Locale getLocale(HttpServletRequest request)
{
HttpSession session = request.getSession();
Locale locale =
(Locale)session.getAttribute("org.apache.struts.action.LOCALE");
if(locale == null)
locale = defaultLocale;
return locale;
}
So to switch the Locale dynamically, update the Locale object saved in
the session.
Thanks,
Yuanbo
-Original Message-
From: None None [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: Sharing what I've learned: locale switching
Because this might be helpful to others, and because I probably would
have
spent another couple of hours figuring it out on my own without the help
of
some people on this lsit, I wanted to give back as much as I could.  So,
here's a consolidated bit of info I've learned about switching language
in
your Struts apps...
What I have is a file manager application, more or less just for me to
learn
Struts.  I wanted to have the ability to switch languages on-the-fly.
To do
this, I've done the following:
(1) I created two files and placed them in WEB-INF/classes.  They are
ofmResources_en.properties and ofmResources_de.properties (en for
English,
de for German).  These files contain various text strings in both
language.
For instance, there is a lable on the screen for file uploads which is
defined as follows:
labels.uploadFile=Upload a file:
and for the German version:
labels.uploadFile=hochladen Sie eine Datei:
(2) I added the following entry to web.xml, as an init parameter of the
ActionServlet:

application
ofmResources

As near as I can tell, NO entries are required in struts-config.xml.
You
also do NOT need to do anything for each version of the resource file.
As
long as they are named x_ll.properties, where x is the value of
the
application parameter above, and ll is a valid country code, that's all
there is to it.
(3) Next, I added some flag graphics to my web pages, one an American
flag,
one a German flag.  Here is the HTML for them:







Pretty trivial stuff there.
(4) Next, I created an ActionForm called ChangeLocaleActionForm as
follows:
package com.mycompany.ofm.actionforms;
import org.apache.struts.action.*;
public class ChangeLocaleActionForm extends ActionForm {
private String languageCode = null;
public ChangeLocaleActionForm() {
languageCode = null;
}
public void setLanguageCode(String inLanguageCode) {
languageCode = inLanguageCode;
}
public String getLsnguageCode() {
return languageCode;
}
}
(5) Next, I created an accompanying Action:
package com.mycompany.ofm.actions;
import java.util.*;
import javax.servlet.http.*;
import com.omnytex.ofm.actionforms.*;
import org.apache.struts.*;
import org.apache.struts.action.*;
public class ChangeLocaleAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm
form,
HttpServletRequest request, HttpServletResponse response) throws
Exception {
ChangeLocaleActionForm claf = (ChangeLocaleActionForm)form;
String languageCode = claf.getLsnguageCode();
request.getSession().setAttribute(Globals.LOCALE_KEY,
new
Locale(languageCode));
return mapping.findForward("showPathContents");
}
}
As it turns out as someone here informed me, there is "automagically" a
Locale in session, created based on what is sent by the browser.  So, by
default on my system the value en_US is stored in session under the name
Globals.LOCALE_KEY.  By the way, as near as I can tell, the _US portion
of
the language code doesn't matter (I'm sure it MATTERS, but for what I'm
describing it doesn't).  So, this allows one to switch the locale (read:
language) of the app by clicking a flag.  No big deal.
(6) To make use of this all, ther

RE: Sharing what I've learned: locale switching

2004-05-14 Thread Zhang, Larry \(L.\)
Additionally, if you want other key(other than org.apache.struts.action.LOCALE 
=Globals.LOCALE_KEY) to store your locale,

you can do this:

session.setAttribute("myNewMeaningfulKey",myLocaleObject), then in your JSP you would 
use this:
. This is the way the 
locale attribute in message tag is used in struts. 

Thanks.

Larry Zhang

-Original Message-
From: Wang, Yuanbo [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:40 PM
To: Struts Users Mailing List
Subject: RE: Sharing what I've learned: locale switching


Thanks for sharing the information. Basically struts using the following
method to decide which Locale is in the session, then load the
corresponding resource bundle:

protected Locale getLocale(HttpServletRequest request)
{
HttpSession session = request.getSession();
Locale locale =
(Locale)session.getAttribute("org.apache.struts.action.LOCALE");
if(locale == null)
locale = defaultLocale;
return locale;
}

So to switch the Locale dynamically, update the Locale object saved in
the session. 

Thanks,
Yuanbo


-Original Message-
From: None None [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: Sharing what I've learned: locale switching


Because this might be helpful to others, and because I probably would
have 
spent another couple of hours figuring it out on my own without the help
of 
some people on this lsit, I wanted to give back as much as I could.  So,

here's a consolidated bit of info I've learned about switching language
in 
your Struts apps...

What I have is a file manager application, more or less just for me to
learn 
Struts.  I wanted to have the ability to switch languages on-the-fly.
To do 
this, I've done the following:

(1) I created two files and placed them in WEB-INF/classes.  They are 
ofmResources_en.properties and ofmResources_de.properties (en for
English, 
de for German).  These files contain various text strings in both
language.  
For instance, there is a lable on the screen for file uploads which is 
defined as follows:

labels.uploadFile=Upload a file:

and for the German version:

labels.uploadFile=hochladen Sie eine Datei:

(2) I added the following entry to web.xml, as an init parameter of the 
ActionServlet:


application
ofmResources


As near as I can tell, NO entries are required in struts-config.xml.
You 
also do NOT need to do anything for each version of the resource file.
As 
long as they are named x_ll.properties, where x is the value of
the 
application parameter above, and ll is a valid country code, that's all 
there is to it.

(3) Next, I added some flag graphics to my web pages, one an American
flag, 
one a German flag.  Here is the HTML for them:









Pretty trivial stuff there.

(4) Next, I created an ActionForm called ChangeLocaleActionForm as
follows:

package com.mycompany.ofm.actionforms;
import org.apache.struts.action.*;
public class ChangeLocaleActionForm extends ActionForm {
private String languageCode = null;
public ChangeLocaleActionForm() {
languageCode = null;
}
public void setLanguageCode(String inLanguageCode) {
languageCode = inLanguageCode;
}
public String getLsnguageCode() {
return languageCode;
}
}

(5) Next, I created an accompanying Action:

package com.mycompany.ofm.actions;
import java.util.*;
import javax.servlet.http.*;
import com.omnytex.ofm.actionforms.*;
import org.apache.struts.*;
import org.apache.struts.action.*;
public class ChangeLocaleAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm
form, 
HttpServletRequest request, HttpServletResponse response) throws
Exception {
ChangeLocaleActionForm claf = (ChangeLocaleActionForm)form;
String languageCode = claf.getLsnguageCode();
request.getSession().setAttribute(Globals.LOCALE_KEY,
new 
Locale(languageCode));
return mapping.findForward("showPathContents");
}
}

As it turns out as someone here informed me, there is "automagically" a 
Locale in session, created based on what is sent by the browser.  So, by

default on my system the value en_US is stored in session under the name

Globals.LOCALE_KEY.  By the way, as near as I can tell, the _US portion
of 
the language code doesn't matter (I'm sure it MATTERS, but for what I'm 
describing it doesn't).  So, this allows one to switch the locale (read:

language) of the app by clicking a flag.  No big deal.

(6) To make use of this all, there are two concerns... One is messages
in a 
JSP rendered with the  tag, the other is messages returned

from an Action that you want to display to the user.

For the JSP side of things, it's simple... you just do this...



Struts uses the

RE: Sharing what I've learned: locale switching

2004-05-14 Thread None None
Ah, thank you Yuanbo, I didn't see the getLocale() method of the Action 
class.  Excellent, so the code in the Action I posted can be reduced 
somewhat... when you want to get a Locale-sensitive string to return to the 
view, you can do:

lpcaf.setMessage(getResources(request).getMessage(getLocale(request), 
"messages.deleteFailed"));

A bit shorter than what I had.  Excellent, thank you!

From: "Wang, Yuanbo" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Sharing what I've learned: locale switching
Date: Fri, 14 May 2004 13:40:09 -0500
Thanks for sharing the information. Basically struts using the following
method to decide which Locale is in the session, then load the
corresponding resource bundle:
protected Locale getLocale(HttpServletRequest request)
{
HttpSession session = request.getSession();
Locale locale =
(Locale)session.getAttribute("org.apache.struts.action.LOCALE");
if(locale == null)
locale = defaultLocale;
return locale;
}
So to switch the Locale dynamically, update the Locale object saved in
the session.
Thanks,
Yuanbo
-Original Message-
From: None None [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: Sharing what I've learned: locale switching
Because this might be helpful to others, and because I probably would
have
spent another couple of hours figuring it out on my own without the help
of
some people on this lsit, I wanted to give back as much as I could.  So,
here's a consolidated bit of info I've learned about switching language
in
your Struts apps...
What I have is a file manager application, more or less just for me to
learn
Struts.  I wanted to have the ability to switch languages on-the-fly.
To do
this, I've done the following:
(1) I created two files and placed them in WEB-INF/classes.  They are
ofmResources_en.properties and ofmResources_de.properties (en for
English,
de for German).  These files contain various text strings in both
language.
For instance, there is a lable on the screen for file uploads which is
defined as follows:
labels.uploadFile=Upload a file:
and for the German version:
labels.uploadFile=hochladen Sie eine Datei:
(2) I added the following entry to web.xml, as an init parameter of the
ActionServlet:

application
ofmResources

As near as I can tell, NO entries are required in struts-config.xml.
You
also do NOT need to do anything for each version of the resource file.
As
long as they are named x_ll.properties, where x is the value of
the
application parameter above, and ll is a valid country code, that's all
there is to it.
(3) Next, I added some flag graphics to my web pages, one an American
flag,
one a German flag.  Here is the HTML for them:







Pretty trivial stuff there.
(4) Next, I created an ActionForm called ChangeLocaleActionForm as
follows:
package com.mycompany.ofm.actionforms;
import org.apache.struts.action.*;
public class ChangeLocaleActionForm extends ActionForm {
private String languageCode = null;
public ChangeLocaleActionForm() {
languageCode = null;
}
public void setLanguageCode(String inLanguageCode) {
languageCode = inLanguageCode;
}
public String getLsnguageCode() {
return languageCode;
}
}
(5) Next, I created an accompanying Action:
package com.mycompany.ofm.actions;
import java.util.*;
import javax.servlet.http.*;
import com.omnytex.ofm.actionforms.*;
import org.apache.struts.*;
import org.apache.struts.action.*;
public class ChangeLocaleAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm
form,
HttpServletRequest request, HttpServletResponse response) throws
Exception {
ChangeLocaleActionForm claf = (ChangeLocaleActionForm)form;
String languageCode = claf.getLsnguageCode();
request.getSession().setAttribute(Globals.LOCALE_KEY,
new
Locale(languageCode));
return mapping.findForward("showPathContents");
}
}
As it turns out as someone here informed me, there is "automagically" a
Locale in session, created based on what is sent by the browser.  So, by
default on my system the value en_US is stored in session under the name
Globals.LOCALE_KEY.  By the way, as near as I can tell, the _US portion
of
the language code doesn't matter (I'm sure it MATTERS, but for what I'm
describing it doesn't).  So, this allows one to switch the locale (read:
language) of the app by clicking a flag.  No big deal.
(6) To make use of this all, there are two concerns... One is messages
in a
JSP rendered with the  tag, the other is messages returned
from an Action that you want to display to the user.
For the JSP side of things, it's 

RE: Sharing what I've learned: locale switching

2004-05-14 Thread Wang, Yuanbo
Thanks for sharing the information. Basically struts using the following
method to decide which Locale is in the session, then load the
corresponding resource bundle:

protected Locale getLocale(HttpServletRequest request)
{
HttpSession session = request.getSession();
Locale locale =
(Locale)session.getAttribute("org.apache.struts.action.LOCALE");
if(locale == null)
locale = defaultLocale;
return locale;
}

So to switch the Locale dynamically, update the Locale object saved in
the session. 

Thanks,
Yuanbo


-Original Message-
From: None None [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: Sharing what I've learned: locale switching


Because this might be helpful to others, and because I probably would
have 
spent another couple of hours figuring it out on my own without the help
of 
some people on this lsit, I wanted to give back as much as I could.  So,

here's a consolidated bit of info I've learned about switching language
in 
your Struts apps...

What I have is a file manager application, more or less just for me to
learn 
Struts.  I wanted to have the ability to switch languages on-the-fly.
To do 
this, I've done the following:

(1) I created two files and placed them in WEB-INF/classes.  They are 
ofmResources_en.properties and ofmResources_de.properties (en for
English, 
de for German).  These files contain various text strings in both
language.  
For instance, there is a lable on the screen for file uploads which is 
defined as follows:

labels.uploadFile=Upload a file:

and for the German version:

labels.uploadFile=hochladen Sie eine Datei:

(2) I added the following entry to web.xml, as an init parameter of the 
ActionServlet:


application
ofmResources


As near as I can tell, NO entries are required in struts-config.xml.
You 
also do NOT need to do anything for each version of the resource file.
As 
long as they are named x_ll.properties, where x is the value of
the 
application parameter above, and ll is a valid country code, that's all 
there is to it.

(3) Next, I added some flag graphics to my web pages, one an American
flag, 
one a German flag.  Here is the HTML for them:









Pretty trivial stuff there.

(4) Next, I created an ActionForm called ChangeLocaleActionForm as
follows:

package com.mycompany.ofm.actionforms;
import org.apache.struts.action.*;
public class ChangeLocaleActionForm extends ActionForm {
private String languageCode = null;
public ChangeLocaleActionForm() {
languageCode = null;
}
public void setLanguageCode(String inLanguageCode) {
languageCode = inLanguageCode;
}
public String getLsnguageCode() {
return languageCode;
}
}

(5) Next, I created an accompanying Action:

package com.mycompany.ofm.actions;
import java.util.*;
import javax.servlet.http.*;
import com.omnytex.ofm.actionforms.*;
import org.apache.struts.*;
import org.apache.struts.action.*;
public class ChangeLocaleAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm
form, 
HttpServletRequest request, HttpServletResponse response) throws
Exception {
ChangeLocaleActionForm claf = (ChangeLocaleActionForm)form;
String languageCode = claf.getLsnguageCode();
request.getSession().setAttribute(Globals.LOCALE_KEY,
new 
Locale(languageCode));
return mapping.findForward("showPathContents");
}
}

As it turns out as someone here informed me, there is "automagically" a 
Locale in session, created based on what is sent by the browser.  So, by

default on my system the value en_US is stored in session under the name

Globals.LOCALE_KEY.  By the way, as near as I can tell, the _US portion
of 
the language code doesn't matter (I'm sure it MATTERS, but for what I'm 
describing it doesn't).  So, this allows one to switch the locale (read:

language) of the app by clicking a flag.  No big deal.

(6) To make use of this all, there are two concerns... One is messages
in a 
JSP rendered with the  tag, the other is messages returned

from an Action that you want to display to the user.

For the JSP side of things, it's simple... you just do this...



Struts uses the Locale stored in session to pull the key from the
correct 
resource file.  Yeah, it's that easy!  As I said previously, the fact
that 
to start my Locale contains en_US doesn't seem to matter... Struts looks
to 
be smart enough to look for a properties file with just _en in the
name... I 
presume that if I named the file ofmResources_en_US.properties it would
work 
as well, but I haven't verified that.

For messages returned from an Action, I have found that this code does
what 
I want:

lpcaf.setMessage(getResources(reque

Struts 1.0 --> 1.1 on iPlanet

2004-05-14 Thread brutledg
All-

In an attempt to find the limits of iWS6.0SP5, I created a simple "Hello
World" Struts app using 1.0 and have it successfully deployed and running.

To take it to the next level, I made the same app Struts 1.1 compliant by
changing the struts-config.xml to 1.1 format, upgrading stuts.jar and
including the required commons libs (digester, beanutils, etc).  Deploying
this newer version of the app causes the server to bomb with the stack
trace below.

Looking into the Stuts 1.1 source, if you trace back the line in
ActionServlet that seems to be causing the NPE, it's based on it
loading/finding the config file and then being able to find the mapping
for the incoming request.

I can't understand why iWS would be able to find the struts-config.xml
when using Struts 1.0, but not with Struts 1.1.

Has anyone run into this before?  Offer any thoughts on how to debug?  I'd
really like to get Struts 1.1 running on this baby.

-Billy

[14/May/2004:11:04:30] failure (  678): Internal error: exception thrown
from the servlet service function (uri=/hello-world/SampleAction.do):
java.la
ng.NullPointerException, Stack: java.lang.NullPointerException
at
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:854)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919)
at
com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1061)
at
com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:981)
at
com.iplanet.server.http.servlet.NSServletSession.internalRedirect(Native
Method)
at
com.iplanet.server.http.servlet.NSRequestDispatcher.forward(NSRequestDispatcher.java:48)
at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:415)
at _jsps._index_jsp._jspService(_index_jsp.java:61)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:248)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$6(JspServlet.java:238)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:519)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:588)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919)
at
com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1061)
at
com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:981)

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



Sharing what I've learned: locale switching

2004-05-14 Thread None None
Because this might be helpful to others, and because I probably would have 
spent another couple of hours figuring it out on my own without the help of 
some people on this lsit, I wanted to give back as much as I could.  So, 
here's a consolidated bit of info I've learned about switching language in 
your Struts apps...

What I have is a file manager application, more or less just for me to learn 
Struts.  I wanted to have the ability to switch languages on-the-fly.  To do 
this, I've done the following:

(1) I created two files and placed them in WEB-INF/classes.  They are 
ofmResources_en.properties and ofmResources_de.properties (en for English, 
de for German).  These files contain various text strings in both language.  
For instance, there is a lable on the screen for file uploads which is 
defined as follows:

labels.uploadFile=Upload a file:
and for the German version:
labels.uploadFile=hochladen Sie eine Datei:
(2) I added the following entry to web.xml, as an init parameter of the 
ActionServlet:

   
   application
   ofmResources
   
As near as I can tell, NO entries are required in struts-config.xml.  You 
also do NOT need to do anything for each version of the resource file.  As 
long as they are named x_ll.properties, where x is the value of the 
application parameter above, and ll is a valid country code, that's all 
there is to it.

(3) Next, I added some flag graphics to my web pages, one an American flag, 
one a German flag.  Here is the HTML for them:

   
   
   
   
   
   
   

Pretty trivial stuff there.
(4) Next, I created an ActionForm called ChangeLocaleActionForm as follows:
   package com.mycompany.ofm.actionforms;
   import org.apache.struts.action.*;
   public class ChangeLocaleActionForm extends ActionForm {
   private String languageCode = null;
   public ChangeLocaleActionForm() {
   languageCode = null;
   }
   public void setLanguageCode(String inLanguageCode) {
   languageCode = inLanguageCode;
   }
   public String getLsnguageCode() {
   return languageCode;
   }
   }
(5) Next, I created an accompanying Action:
   package com.mycompany.ofm.actions;
   import java.util.*;
   import javax.servlet.http.*;
   import com.omnytex.ofm.actionforms.*;
   import org.apache.struts.*;
   import org.apache.struts.action.*;
   public class ChangeLocaleAction extends Action {
   public ActionForward execute(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) throws Exception {
   ChangeLocaleActionForm claf = (ChangeLocaleActionForm)form;
   String languageCode = claf.getLsnguageCode();
   request.getSession().setAttribute(Globals.LOCALE_KEY, new 
Locale(languageCode));
   return mapping.findForward("showPathContents");
   }
   }

As it turns out as someone here informed me, there is "automagically" a 
Locale in session, created based on what is sent by the browser.  So, by 
default on my system the value en_US is stored in session under the name 
Globals.LOCALE_KEY.  By the way, as near as I can tell, the _US portion of 
the language code doesn't matter (I'm sure it MATTERS, but for what I'm 
describing it doesn't).  So, this allows one to switch the locale (read: 
language) of the app by clicking a flag.  No big deal.

(6) To make use of this all, there are two concerns... One is messages in a 
JSP rendered with the  tag, the other is messages returned 
from an Action that you want to display to the user.

For the JSP side of things, it's simple... you just do this...
   
Struts uses the Locale stored in session to pull the key from the correct 
resource file.  Yeah, it's that easy!  As I said previously, the fact that 
to start my Locale contains en_US doesn't seem to matter... Struts looks to 
be smart enough to look for a properties file with just _en in the name... I 
presume that if I named the file ofmResources_en_US.properties it would work 
as well, but I haven't verified that.

For messages returned from an Action, I have found that this code does what 
I want:

   lpcaf.setMessage(getResources(request).getMessage(

(Locale)request.getSession().getAttribute(Globals.LOCALE_KEY),
"messages.deleteFailed"));

This is just setting a message in an ActionForm that is returned to the 
view.  In the view I do:

   onLoad="alert('');">

This just pops up a JavaScript alert with the message I returned from the 
Action, in the correct language associated with the current Locale.  Cool!

So, hopefully that helps someone somewhere along the way.  It really is 
pretty cool to be able to switch the language of this app just by clicking a 
flag!

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

-

Re: NullPointerException - findSuccess(Unknown Source)

2004-05-14 Thread Martin Gainty
Where is signin/Welcome.jsp?
if located under WEB-INF/signin then modify forward statement to

Martin
- Original Message -
From: "Caroline Jen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 14, 2004 10:54 AM
Subject: NullPointerException - findSuccess(Unknown Source)


> Need your expertise to diagnose the problem.
>
> I have a java class ListThread.java that extends
> Action. This java class simply calls a couple of
> helper classes to access my database. In the end of
> the ListThread.java, it is a standard statement:
>
> return ( mapping.findForward( "success" ) );
>
>
> I have not yet prepared a JSP to be displayed in the
> browser after ListThread.java completes its tasks;
> therefore, upon completion, I temporarily wants the
> application to be forwarded to my welcome page. (My
> welcome page works fine.)
>
> Because the ListThread.java does not really submit a
> form, I simply put name="articleForm" in the
> struts-config.xml file.  I have substituted with other
> forms for testing purpose.  Nonetheless, I always got
> Status 500 error:
>
> - Root Cause -
> java.lang.NullPointerException
> at
> org.apache.struts.scaffold.ParameterAction.findSuccess(Unknown
> Source)
> at
> org.apache.struts.scaffold.BaseAction.execute(Unknown
> Source)
> at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
> at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> .
> .
>
> My struts-config.xml looks like:
>
>  roles="administrator,editor,contributor"
> path="/message/ListThreads"
> type="org.apache.artimus.message.ListThread"
> name="articleForm"
> scope="request"
> validate="false">
> name="success"
> path="/signin/Welcome.jsp"/>
> 
>
> And here is my ListThread.java:
>
> import LOTS OF PACKAGES AND CLASSES;
>
> public final class ListThread extends Action
> {
>public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest
> request,
> HttpServletResponse
> response)
> throws Exception
>{
>
>   String memberName = request.getRemoteUser();
>
>   // for sort and order stuff
>   String sort  = request.getParameter( "sort" );
>   String order = request.getParameter( "order" );
>
>   if ( sort.length() == 0 ) sort =
> "ThreadLastPostDate";
>   if ( order.length()== 0 ) order = "DESC";
>
>   int offset  = 0;
>   int rows=
> MessageInboxConfig.ROWS_IN_THREADS;
>   offset = Integer.parseInt( request.getParameter(
> "offset" ) );
>   rows = Integer.parseInt( request.getParameter(
> "rows" ) );
>
>   ListThreadHandler lthandler = new
> ListThreadHandler();
>   ListPostHandler lphandler = new
> ListPostHandler();
>
>   int totalThreads =
> lthandler.getNumberOfThreads_forReceiver( memberName
> );
>   if ( offset > totalThreads )
>   {
>  throw new BadInputException( "The offset is
> not allowed to be greater than total rows." );
>   }
>
>   Collection beans =
> lthandler.getThreads_forReceiver_withSortSupport_limit(
> memberName, offset, rows, sort, order );
>
>   SiteUtil.prepareNavigate( request, offset,
> beans.size(), totalThreads,
> MessageInboxConfig.ROWS_IN_THREADS );
>   int totalPosts =
> lphandler.getNumberOfPosts_forReceiver( memberName );
>
>   request.setAttribute( "ThreadBeans", beans );
>   request.setAttribute( "TotalThreads", new
> Integer( totalThreads ) );
>   request.setAttribute( "TotalPosts", new Integer(
> totalPosts ) );
>
>   return ( mapping.findForward( "success" ) );
>
>}
> }
>
>
>
>
>
> __
> Do you Yahoo!?
> SBC Yahoo! - Internet access at a great low price.
> http://promo.yahoo.com/sbc/
>
> -
> 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 access a variable message resource bundle from JSP

2004-05-14 Thread None None
Thanks Larry, I wasn't sure the order that the JSP processor would interpret 
things, whether it would do the scriplets before the tags.  Either way, I 
think the second point you make is really the "right" answer, especially 
since Paul indicates the same thing, so I'm going to go do that.  Should 
just be a matter of replacing my countryCode session attribute with a Locale 
object under the Globals.LOCALE_KEY name as you say, then the tag should do 
the work for me.


From: "Zhang, Larry (L.)" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: How to access a variable message resource bundle from JSP
Date: Fri, 14 May 2004 12:01:42 -0400
Suppose you have

<% String countryCode = "en"; %>

I think  will 
do your work.

Another way is that you save your Locale object to session in jsp something 
like

session.setAttribute(Globals.LOCALE_KEY, yourLocaleObject);

then Struts can just find out the correct resource for different locale
when you use the following in the jsp

Hope this helps.

Larry Zhang

-Original Message-
From: None None [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 11:40 AM
To: [EMAIL PROTECTED]
Subject: How to access a variable message resource bundle from JSP
Hi again everyone... yesterday, with assistance from some of you folks, I
was able to get multiple message resource bundles working to return a
Locale-specific error message from one of my Action classes.  Very cool.
Now I'm trying to do the same thing in a JSP.

Here's my question... in my JSP's, when using , I know that I
can specify bundle="en" or bundle="de" and that works, since I have a
properties file set up for English and German.  But how can I set the 
bundle
attribute to a variable value?

In other words, at present I have String in session called countryCode, and
it's literally the value EN, DE, or whatever else.  So, is there a way I 
can
plug that string into the  tag's bundle attribute?

Or, is there another method of specifying which of a number of message
resource bundle to look in for a specific key that can be varied
programmatically?  Or further still, is there specifically a special method
to get locale-specific string in a JSP tag, as I am now able to do in my
Action classes?
Thanks all!

_
MSN Toolbar provides one-click access to Hotmail from any Web page - FREE
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
-
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]
_
Express yourself with the new version of MSN Messenger! Download today - 
it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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


RE: How to access a variable message resource bundle from JSP

2004-05-14 Thread None None
I have to admint I haven't looked at and of the samples, but I'm going to 
right after I hit send here :)


From: Paul McCulloch <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: How to access a variable message resource bundle from JSP
Date: Fri, 14 May 2004 16:54:22 +0100
 works without any further help, assuming the struts session
scope locale attribute is set.
I'm pretty sure that one of the struts example apps is specifically there 
to
demonstrate the i18n faculties. Have you looked at that?

Paul

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 4:40 PM
> To: [EMAIL PROTECTED]
> Subject: How to access a variable message resource bundle from JSP
>
>
> Hi again everyone... yesterday, with assistance from some of
> you folks, I
> was able to get multiple message resource bundles working to return a
> Locale-specific error message from one of my Action classes.
> Very cool.
>
> Now I'm trying to do the same thing in a JSP.
>
> Here's my question... in my JSP's, when using ,
> I know that I
> can specify bundle="en" or bundle="de" and that works, since I have a
> properties file set up for English and German.  But how can I
> set the bundle
> attribute to a variable value?
>
> In other words, at present I have String in session called
> countryCode, and
> it's literally the value EN, DE, or whatever else.  So, is
> there a way I can
> plug that string into the  tag's bundle attribute?
>
> Or, is there another method of specifying which of a number
> of message
> resource bundle to look in for a specific key that can be varied
> programmatically?  Or further still, is there specifically a
> special method
> to get locale-specific string in a JSP tag, as I am now able
> to do in my
> Action classes?
>
> Thanks all!
>
> _
> MSN Toolbar provides one-click access to Hotmail from any Web
> page - FREE
> download!
> http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
>
>
> -
> 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]
_
Getting married? Find tips, tools and the latest trends at MSN Life Events. 
http://lifeevents.msn.com/category.aspx?cid=married

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


Using DispatchActions with validation

2004-05-14 Thread GMaine
I have a DispatchAction with two methods. I pass a hidden field "method" in
my form, to determine which method should be called. But I want to override
this and call a specific method if the form's validation fails.

Is it legitimate to put this in the action mapping?
input="/myAction.do?method=myMethod"

Or could this conflict with the "method" hidden field?

Jacob




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



user@struts.apache.org

2004-05-14 Thread Robert Taylor
You can try using doSomething.do?p1=BU&p2=BR&M&p3=bu2

That is, replace '&' in your paramter value with '&' . 

robert

> -Original Message-
> From: bojke [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 11:51 AM
> To: Struts Users Mailing List
> Subject: The request parameter value contains & 
> 
> 
> Hi,
> 
> I have the request parameter and that one has value par example BR&M.
> par example:
> 
> doSomething.do?p1=BU&p2=BR&M&p3=bu2
> 
> I must use GET method for the as methodt. (I am launching the popup 
> using window.open(url)).
> 
> So, in the action, on the server side I am getting BR as the parameter 
> value instead of BR&M.
> 
> Does anybody has idea?
> 
> Thanks in advance,
> Bojan.
> 
> -
> 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: bean:write removes double spaces

2004-05-14 Thread Riyad Kalla
You'll have to intercept the spaces and covert them to  's, atleast 
this is what I have had to do.

Brad Balmer wrote:

This isn't a struts issue as it seems to be an issue with how browsers 
(IE) don't display two spaces in a row.

I'm using bean:write to display a variable to the page.  The problem 
is that the value sometimes contains double-spaces which are being 
displayed as a single-space.

Does anybody know of a way to defeat this WITHOUT wrapping the value 
in a  tag?

Thanks.

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


bean:write removes double spaces

2004-05-14 Thread Brad Balmer
This isn't a struts issue as it seems to be an issue with how browsers 
(IE) don't display two spaces in a row.

I'm using bean:write to display a variable to the page.  The problem is 
that the value sometimes contains double-spaces which are being 
displayed as a single-space.

Does anybody know of a way to defeat this WITHOUT wrapping the value in 
a  tag?

Thanks.

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


user@struts.apache.org

2004-05-14 Thread bojke
Thanks dude,
Bojan.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


user@struts.apache.org

2004-05-14 Thread Wang, Yuanbo
Try:

String url = "oSomething.do?p1=BU&p2=" +
java.net.URLEncoder.encode("BR&M) + "&p3=bu2"

Thanks,
Yuanbo


-Original Message-
From: bojke [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 11:51 AM
To: Struts Users Mailing List
Subject: The request parameter value contains & 


Hi,

I have the request parameter and that one has value par example BR&M.
par example:

doSomething.do?p1=BU&p2=BR&M&p3=bu2

I must use GET method for the as methodt. (I am launching the popup 
using window.open(url)).

So, in the action, on the server side I am getting BR as the parameter 
value instead of BR&M.

Does anybody has idea?

Thanks in advance,
Bojan.

-
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 access a variable message resource bundle from JSP

2004-05-14 Thread Zhang, Larry \(L.\)
Suppose you have

<% String countryCode = "en"; %>

I think  will do your 
work.

Another way is that you save your Locale object to session in jsp something like

session.setAttribute(Globals.LOCALE_KEY, yourLocaleObject); 

then Struts can just find out the correct resource for different locale
when you use the following in the jsp


Hope this helps.

Larry Zhang


-Original Message-
From: None None [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 11:40 AM
To: [EMAIL PROTECTED]
Subject: How to access a variable message resource bundle from JSP


Hi again everyone... yesterday, with assistance from some of you folks, I 
was able to get multiple message resource bundles working to return a 
Locale-specific error message from one of my Action classes.  Very cool.

Now I'm trying to do the same thing in a JSP.

Here's my question... in my JSP's, when using , I know that I 
can specify bundle="en" or bundle="de" and that works, since I have a 
properties file set up for English and German.  But how can I set the bundle 
attribute to a variable value?

In other words, at present I have String in session called countryCode, and 
it's literally the value EN, DE, or whatever else.  So, is there a way I can 
plug that string into the  tag's bundle attribute?

Or, is there another method of specifying which of a number of message 
resource bundle to look in for a specific key that can be varied 
programmatically?  Or further still, is there specifically a special method 
to get locale-specific string in a JSP tag, as I am now able to do in my 
Action classes?

Thanks all!

_
MSN Toolbar provides one-click access to Hotmail from any Web page - FREE 
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/


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



user@struts.apache.org

2004-05-14 Thread Olivier Citeau
An Idea of the cause or an idea of a workaround ?
As of the cause, i wish you know it.

As of a solution, here is from another list :

Any value that is passed that is not A-Za-z0-9_- should to
be url encoded. That is all spaces are turned into + signs
and other characters are changed into this format %XX.
Where XX is the 
hexidecimal value of the character so since the hex value
for & is 26 
you should replace & with %26 to make a long story short. 


 --- bojke <[EMAIL PROTECTED]> a écrit : > Hi,
> 
> I have the request parameter and that one has value par
> example BR&M.
> par example:
> 
> doSomething.do?p1=BU&p2=BR&M&p3=bu2
> 
> I must use GET method for the as methodt. (I am launching
> the popup 
> using window.open(url)).
> 
> So, in the action, on the server side I am getting BR as
> the parameter 
> value instead of BR&M.
> 
> Does anybody has idea?
> 
> Thanks in advance,
> Bojan.


=

Olivier Citeau

Paris, France







Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! 
Messenger sur http://fr.messenger.yahoo.com

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



RE: How to access a variable message resource bundle from JSP

2004-05-14 Thread Paul McCulloch
 works without any further help, assuming the struts session
scope locale attribute is set. 

I'm pretty sure that one of the struts example apps is specifically there to
demonstrate the i18n faculties. Have you looked at that?

Paul

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 4:40 PM
> To: [EMAIL PROTECTED]
> Subject: How to access a variable message resource bundle from JSP
> 
> 
> Hi again everyone... yesterday, with assistance from some of 
> you folks, I 
> was able to get multiple message resource bundles working to return a 
> Locale-specific error message from one of my Action classes.  
> Very cool.
> 
> Now I'm trying to do the same thing in a JSP.
> 
> Here's my question... in my JSP's, when using , 
> I know that I 
> can specify bundle="en" or bundle="de" and that works, since I have a 
> properties file set up for English and German.  But how can I 
> set the bundle 
> attribute to a variable value?
> 
> In other words, at present I have String in session called 
> countryCode, and 
> it's literally the value EN, DE, or whatever else.  So, is 
> there a way I can 
> plug that string into the  tag's bundle attribute?
> 
> Or, is there another method of specifying which of a number 
> of message 
> resource bundle to look in for a specific key that can be varied 
> programmatically?  Or further still, is there specifically a 
> special method 
> to get locale-specific string in a JSP tag, as I am now able 
> to do in my 
> Action classes?
> 
> Thanks all!
> 
> _
> MSN Toolbar provides one-click access to Hotmail from any Web 
> page - FREE 
> download! 
> http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
> 
> 
> -
> 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]



user@struts.apache.org

2004-05-14 Thread bojke
Hi,

I have the request parameter and that one has value par example BR&M.
par example:
doSomething.do?p1=BU&p2=BR&M&p3=bu2

I must use GET method for the as methodt. (I am launching the popup 
using window.open(url)).

So, in the action, on the server side I am getting BR as the parameter 
value instead of BR&M.

Does anybody has idea?

Thanks in advance,
Bojan.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


How to access a variable message resource bundle from JSP

2004-05-14 Thread None None
Hi again everyone... yesterday, with assistance from some of you folks, I 
was able to get multiple message resource bundles working to return a 
Locale-specific error message from one of my Action classes.  Very cool.

Now I'm trying to do the same thing in a JSP.

Here's my question... in my JSP's, when using , I know that I 
can specify bundle="en" or bundle="de" and that works, since I have a 
properties file set up for English and German.  But how can I set the bundle 
attribute to a variable value?

In other words, at present I have String in session called countryCode, and 
it's literally the value EN, DE, or whatever else.  So, is there a way I can 
plug that string into the  tag's bundle attribute?

Or, is there another method of specifying which of a number of message 
resource bundle to look in for a specific key that can be varied 
programmatically?  Or further still, is there specifically a special method 
to get locale-specific string in a JSP tag, as I am now able to do in my 
Action classes?

Thanks all!

_
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/

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


RE: NullPointerException - findSuccess(Unknown Source)

2004-05-14 Thread Paul McCulloch
The stack trace indicates that you are extending
org.apache.struts.scaffold.BaseAction rather than just Action. 

I'm not familiar with the scaffold package - perhaps the forward "success"
has a special meaning within scaffold?

Paul

> -Original Message-
> From: Caroline Jen [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: NullPointerException - findSuccess(Unknown Source)
> 
> 
> Need your expertise to diagnose the problem.
> 
> I have a java class ListThread.java that extends
> Action. This java class simply calls a couple of
> helper classes to access my database. In the end of
> the ListThread.java, it is a standard statement:
> 
> return ( mapping.findForward( "success" ) );
> 
> 
> I have not yet prepared a JSP to be displayed in the
> browser after ListThread.java completes its tasks;
> therefore, upon completion, I temporarily wants the
> application to be forwarded to my welcome page. (My
> welcome page works fine.)
> 
> Because the ListThread.java does not really submit a
> form, I simply put name="articleForm" in the
> struts-config.xml file.  I have substituted with other
> forms for testing purpose.  Nonetheless, I always got
> Status 500 error:
> 
> - Root Cause -
> java.lang.NullPointerException
> at
> org.apache.struts.scaffold.ParameterAction.findSuccess(Unknown
> Source)
> at
> org.apache.struts.scaffold.BaseAction.execute(Unknown
> Source)
> at
> org.apache.struts.action.RequestProcessor.processActionPerform
> (RequestProcessor.java:484)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProce
> ssor.java:274)
> .
> .
> 
> My struts-config.xml looks like:
> 
>  roles="administrator,editor,contributor"
> path="/message/ListThreads"
> type="org.apache.artimus.message.ListThread"
> name="articleForm"
> scope="request"
> validate="false">
> name="success"
> path="/signin/Welcome.jsp"/>
> 
> 
> And here is my ListThread.java:
> 
> import LOTS OF PACKAGES AND CLASSES;
> 
> public final class ListThread extends Action
> {
>public ActionForward execute(ActionMapping mapping,
> ActionForm form,
> HttpServletRequest
> request,
> HttpServletResponse
> response)
> throws Exception 
>{
> 
>   String memberName = request.getRemoteUser();
> 
>   // for sort and order stuff
>   String sort  = request.getParameter( "sort" );
>   String order = request.getParameter( "order" );
> 
>   if ( sort.length() == 0 ) sort =
> "ThreadLastPostDate";
>   if ( order.length()== 0 ) order = "DESC";
> 
>   int offset  = 0;
>   int rows=
> MessageInboxConfig.ROWS_IN_THREADS;
>   offset = Integer.parseInt( request.getParameter(
> "offset" ) );
>   rows = Integer.parseInt( request.getParameter(
> "rows" ) );
> 
>   ListThreadHandler lthandler = new
> ListThreadHandler();
>   ListPostHandler lphandler = new
> ListPostHandler();
> 
>   int totalThreads =
> lthandler.getNumberOfThreads_forReceiver( memberName
> );
>   if ( offset > totalThreads ) 
>   {
>  throw new BadInputException( "The offset is
> not allowed to be greater than total rows." );
>   }
> 
>   Collection beans =
> lthandler.getThreads_forReceiver_withSortSupport_limit(
> memberName, offset, rows, sort, order );
> 
>   SiteUtil.prepareNavigate( request, offset,
> beans.size(), totalThreads,
> MessageInboxConfig.ROWS_IN_THREADS );
>   int totalPosts =
> lphandler.getNumberOfPosts_forReceiver( memberName );
> 
>   request.setAttribute( "ThreadBeans", beans );
>   request.setAttribute( "TotalThreads", new
> Integer( totalThreads ) );
>   request.setAttribute( "TotalPosts", new Integer(
> totalPosts ) );
> 
>   return ( mapping.findForward( "success" ) );
> 
>}
> }
> 
> 
> 
>   
>   
> __
> Do you Yahoo!?
> SBC Yahoo! - Internet access at a great low price.
> http://promo.yahoo.com/sbc/
> 
> -
> 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 Comp

NullPointerException - findSuccess(Unknown Source)

2004-05-14 Thread Caroline Jen
Need your expertise to diagnose the problem.

I have a java class ListThread.java that extends
Action. This java class simply calls a couple of
helper classes to access my database. In the end of
the ListThread.java, it is a standard statement:

return ( mapping.findForward( "success" ) );


I have not yet prepared a JSP to be displayed in the
browser after ListThread.java completes its tasks;
therefore, upon completion, I temporarily wants the
application to be forwarded to my welcome page. (My
welcome page works fine.)

Because the ListThread.java does not really submit a
form, I simply put name="articleForm" in the
struts-config.xml file.  I have substituted with other
forms for testing purpose.  Nonetheless, I always got
Status 500 error:

- Root Cause -
java.lang.NullPointerException
at
org.apache.struts.scaffold.ParameterAction.findSuccess(Unknown
Source)
at
org.apache.struts.scaffold.BaseAction.execute(Unknown
Source)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
.
.

My struts-config.xml looks like:


   


And here is my ListThread.java:

import LOTS OF PACKAGES AND CLASSES;

public final class ListThread extends Action
{
   public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest
request,
HttpServletResponse
response)
throws Exception 
   {

  String memberName = request.getRemoteUser();

  // for sort and order stuff
  String sort  = request.getParameter( "sort" );
  String order = request.getParameter( "order" );

  if ( sort.length() == 0 ) sort =
"ThreadLastPostDate";
  if ( order.length()== 0 ) order = "DESC";

  int offset  = 0;
  int rows=
MessageInboxConfig.ROWS_IN_THREADS;
  offset = Integer.parseInt( request.getParameter(
"offset" ) );
  rows = Integer.parseInt( request.getParameter(
"rows" ) );

  ListThreadHandler lthandler = new
ListThreadHandler();
  ListPostHandler lphandler = new
ListPostHandler();

  int totalThreads =
lthandler.getNumberOfThreads_forReceiver( memberName
);
  if ( offset > totalThreads ) 
  {
 throw new BadInputException( "The offset is
not allowed to be greater than total rows." );
  }

  Collection beans =
lthandler.getThreads_forReceiver_withSortSupport_limit(
memberName, offset, rows, sort, order );

  SiteUtil.prepareNavigate( request, offset,
beans.size(), totalThreads,
MessageInboxConfig.ROWS_IN_THREADS );
  int totalPosts =
lphandler.getNumberOfPosts_forReceiver( memberName );

  request.setAttribute( "ThreadBeans", beans );
  request.setAttribute( "TotalThreads", new
Integer( totalThreads ) );
  request.setAttribute( "TotalPosts", new Integer(
totalPosts ) );

  return ( mapping.findForward( "success" ) );

   }
}





__
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

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



Re: Server side validation

2004-05-14 Thread Samuel Rochas
Good Morning Geeta,

Geeta Ramani wrote:
Hmm.. Ok, look at the source code of the page you get.. anything there?


No so much, right?

I used to work, then I probably change _something_ 

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Hi

2004-05-14 Thread Hubert Rabago
I ran into a problem like this before, and I suspected it was the PDF reader
which sent the second request.  It wasn't happening with earlier Acrobat
versions, though.  When our company rolled out a (then) newer Acrobat
version, we started seeing these double requests.
The solution I used then was to set the response headers on the output PDF so
it doesn't expire immediately.  This way, the browser/reader uses the PDF
cache from the first request, and doesn't ask that the PDF be generated
again.  I think we set ours to expire after 3 mins.  Just make sure you don't
expire it before you're done generating your PDF, or else you won't see any
difference.

hth,
Hubert

--- Vetrichelvam Malaichamy <[EMAIL PROTECTED]> wrote:
> Hi
> I am Vetri Chelvam. I am using struts 1.1. I am getting a problem.
> The problem is like this.
> There is a button on a Page. And on click of this button, the Action
> servelet is called and the database updations are done and the request is
> served with the response of opening a PDF template. Once the PDF  is
> opened,
> the request is submitted again and the Action servlet is called and the
> database is updated again.  But we have only one PDF template is opened.
> For
> One request of opening the PDF template, there are two Database updations
> are done(since the request is submitted again). Can anyone please help me
> to
> solve this problem. I am little bit tied up with this problem.
> 
> Actually this problem occurs during my UAT of the application. But it does
> not able to be replicated, in the development environment.
> 
> Thanks
> Vetri
> 
> 
> 
> 
> 
>
==
> 
> Interleasing (UK) Limited
> Registered Office: Griffin House, Osborne Road, Luton, LU1 3YT
> Registered in England No. 274476
> Telephone: +44 (0) 870 732 
> Fax: +44(0) 870 732 4000
> 
> The above E-mail and any attached files ("E-mail") may contain confidential
> and/or privileged material and 
> is intended solely for the addressee(s). If you are not the intended
> recipient 
> or the person responsible for delivering to the intended recipient, please
> be advised 
> that you have received this E-mail in error and that any use,
> retransmission, dissemination  or copying is 
> strictly prohibited. 
> 
> If you have received this E-mail in error please delete the material from
> any computer and notify the Computer Helpdesk 
> by telephoning the above number.
>  
> The E-mail is for information only and should not be relied, acted upon,  
> copied or changed without our written authority. 
> 
> We make no representation, disclaim all responsibility and accept no
> liability 
> as to the completeness, accuracy and use of the E-mail prior to written 
> confirmation in the form of a letter or fax.
> 
> Any opinions expressed in this E-mail may be those of the individual(s) 
> and not necessarily of Interleasing (UK) Limited.
> 
>
=
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 





__
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

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



RE: Language resource bundles problem

2004-05-14 Thread None None
Ok, when I get back to work on this Monday I'll do a dump of session 
attributes and see if it's there.  If it is by default, then great, I'll 
just use that instead my own countryCode attribute like I've done.  In 
regard to your other post about using what the browser sends, that's a good 
idea, I frankly didn't know that was something it sent as a rule.  Certainly 
I'll use that as the default language, and just leave it switchable (this is 
more a play thing for me learning Struts rather than anything truly 
useful... I doubt very many users would ever switch languages in the middle 
of work, although the capability is nice to have).  Thanks again Paul!


From: Paul McCulloch <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: Language resource bundles problem
Date: Fri, 14 May 2004 09:49:44 +0100
I think the Locale should be magically in session for you.

Paul

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 6:48 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Language resource bundles problem
>
>
> Sorry Paul, I actually missed your reply (the inevitable
> result of having
> five different high-volume mailing lists filing into one
> eMail account).
> Indeed, what you state did the trick, thank you very much!
>
> Oh, actually, one other question... I've never had to think about
> internationalization before, so this question is out of my
> experience... is
> there a Local object in session by default, or do I need to
> put it there
> myself as the result of the first request of my app?  Thanks again!
>
> >From: Paul McCulloch <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: Language resource bundles problem
> >Date: Thu, 13 May 2004 16:47:00 +0100
> >
> >You are calling the getMessage(String, Object) method. The
> String is the
> >key
> >& the object is a substitution paramter (i.e. {0}).
> >
> >You want the getMessage(Locale, String) method. You can
> eaither create a
> >Locale from 'de' or get the users first requested locale with
> >"request.getSession().getAttribute(Globals.LOCALE_KEY);"
> >
> >HTH,
> >
> >Paul
> >
> > > MessageResources mr = getResources(request);
> > > myActionForm.setMessage(mr.getMessage("messages.deleteFailed"));
> > >
> > > Now, this works just fine.  My message is displayed as a
> > > result of the
> > > onLoad event of my page via a simple JavaScript alert
> box.  Very cool.
> > >
> > > However, if I want to display the message from the German
> > > resource file, I
> > > can't get it to work.  I thought all I had to do was this:
> > >
> > > myActionForm.setMessage(mr.getMessage("de",
> "messages.deleteFailed"));
> > >
> >
> >
> >
> >*
> *
> >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]
> >
>
> _
> Check out the coupons and bargains on MSN Offers!
http://youroffers.msn.com
-
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

RE: Hi

2004-05-14 Thread Geeta Ramani
Hi Vetri:

I don't know the solution to your problem, but I remember not too long ago somebody 
else had a similar problem with his/her page being submitting twice. I believe that 
problem was in fact solved. So maybe you could search the archives..?

Regards,
Geeta 

> -Original Message-
> From: Vetrichelvam Malaichamy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 4:22 AM
> To: [EMAIL PROTECTED]
> Subject: Hi
> 
> 
> Hi
> I am Vetri Chelvam. I am using struts 1.1. I am getting a problem.
> The problem is like this.
> There is a button on a Page. And on click of this button, the Action
> servelet is called and the database updations are done and 
> the request is
> served with the response of opening a PDF template. Once the 
> PDF  is opened,
> the request is submitted again and the Action servlet is 
> called and the
> database is updated again.  But we have only one PDF template 
> is opened. For
> One request of opening the PDF template, there are two 
> Database updations
> are done(since the request is submitted again). Can anyone 
> please help me to
> solve this problem. I am little bit tied up with this problem.
> 
> Actually this problem occurs during my UAT of the 
> application. But it does
> not able to be replicated, in the development environment.
> 
> Thanks
> Vetri
> 
> 
> > 

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



RE: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?

2004-05-14 Thread Hohlen, John C
Thanks for the reply.  

I also confirmed a few things myself.  I was able to rebuild the Struts
1.1 source against Commons-Lang 2.0 and did not encounter any errors.
Furthermore, it looks like the only "Commons-Lang" dependencies are in
the "test" classes which are part of the struts.jar release (hence, the
reason you and others are running fine).

JOHN

-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 14, 2004 1:43 AM
To: Struts Users Mailing List
Subject: Re: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?


I have been using version 2.0 with struts 1.1 since last September.  No
problem surface yet ;-)

Go for it.

-D
- Original Message - 
From: "Hohlen, John C" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 13, 2004 8:57 PM
Subject: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?


> We're trying to figure out how backwards compatible Commons-Lang 2.0 
> is
with it's predecessor (1.0.1).  Specifically, we'd like to use Commons
Lang 2.0 with Struts 1.1 (which is distributed with Commons-Lang 1.0.1).
Has
anyone ever attempted this?   I asked this question about a month ago
but
never received any replies:
>
> http://marc.theaimsgroup.com/?l=struts-user&m=108154032009627&w=2
>
> Thanks,
>
> JOHN
>

-
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: Selects

2004-05-14 Thread bOOyah
Jonathan Wright wrote:

Can anyone see anything wrong with the following select and option tags? I
cannot fathom out why I keep getting an exception thrown in the
BodyContent.clearBody method.
This does not work:
  Select One  Auckland  Christchurch   Dunedin  Gisborne   Hamilton  Hastings   Invercargill  Napier   Nelson  New Plymouth  Palmerston North   Rotorua  Tauranga   Wanganui  Wellington   Whangarei  Other
The only way I can get the page to work at runtime with the select tag
included is to do the following:

Even a single white space in the body causes the page to fail, e.g.
 
Any help would be most appreciated!
Hi Jonathan

I copied and pasted your non-working example into my JSP, and added a 
'location' property to my form bean (which I defaulted to "Christchurch" 
in struts-config.xml) and it worked a treat.  No exceptions.

I'm using vanilla Struts 1.1 and JBoss 3.2.3 + Tomcat 4.

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


RE: Server side validation

2004-05-14 Thread Geeta Ramani
Hmm.. Ok, look at the source code of the page you get.. anything there?
Geeta

> -Original Message-
> From: Samuel Rochas [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 6:42 PM
> To: Struts Users Mailing List
> Subject: Re: Server side validation
> 
> 
> Hello Geeta,
> 
> > "login" must have been defined as a global-forward ..?
> You are right, I am quite new here, I did no notice.
> 
> > No reason. So just take it out..:)
> Ok, it's gone.
> 
> But I still get an empty page when I make a validation error :-(
> 
> The validation code is going thru, maybe another hint?
> 
> Samuel
> 
> -
> 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: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread John Moore
Andrew Hill wrote:

That will destroy *everything* in the users session.

 

Yes, it is a bit brutal, but it is precisely what I wanted. The user has 
completed a purchase, having entered credit card details and all. This 
logs them out completely, which is what I needed. Adam's requirement may 
well be different, of course.

John

--
==
John Moore  -  Norwich, UK  -  [EMAIL PROTECTED]
==
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: java.lang.OutOfMemoryError after server app start/stop cyclin g

2004-05-14 Thread Kris Schneider
Haven't done it myself but I thought you had to edit the registry to modify VM
settings for a TC service. See if there's a TC entry at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

Quoting Daniel Perry <[EMAIL PROTECTED]>:

> eh?
> i thought ANT_OPTS was for ant, not tomcat.
> 
> I dont have any trouble with ant using default memory allowance.
> Its tomcat that is running out of memory, and is ignoring the CATALINA_OPTS.
> 
> Daniel.
> 
> -Original Message-
> From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 12:14
> To: Struts Users Mailing List; Daniel Perry
> Subject: Re: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
> 
> 
> Daniel,
> For your problem  3 you must have to set   ANT_OPTS=-Xmx512m in your dos 
> prompt as mentioned by Chris. 
> 
> -Jignesh
> On Friday 14 May 2004 15:49, Daniel Perry wrote:
> > I have JAVA_OPTS and CATALINA_OPTS set to -Xmx1024M as system environment
> > variables.
> >
> > If i start tomcat using startup.bat it uses these.
> >
> > If i start tomcat using as a windows service, it doesnt use these.
> >
> > Daniel.
> >
> > -Original Message-
> > From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> > Sent: 14 May 2004 11:09
> > To: Struts Users Mailing List
> > Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> > cyclin g
> >
> >
> > Type java -X in a windows shell and look at setting some of the below
> > options in your environment using JAVA_OPTS
> >
> >  -Xmsset initial Java heap size
> >  -Xmxset maximum Java heap size
> >  -Xssset java thread stack size
> >
> > I alse use this to allocate more memory to ant at build time for a large
> > application. 'set ANT_OPTS=-Xmx512m' (in a .bat) or pop it in your
> > environment profile.
> >
> > Chris McCormack
> >
> > -Original Message-
> > From: Daniel Perry [mailto:[EMAIL PROTECTED]
> > Sent: 14 May 2004 10:54
> > To: Struts Users Mailing List
> > Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> > cyclin g
> >
> >
> > I'm using jdk1.4.2_04, and it still happens!
> >
> > Here are some of my observations on the issue:
> >
> > 1. I did once develop some software using servlets/jsps. I never came
> > accross this problem.  However, as jsps are automatically releaded, and
> > this app was mainly jsp based, i dont remeber doing any restarting :)
> >
> > 2. running a memory intensive / complex app, it runs out of memory a lot
> > quicker :)
> >
> > 3. If i run the stopapp and startapp ant tasks in a loop it runs out of
> > memory with my struts app pretty quickly.  Doing the same thing to axis
> > takes a lot longer.
> >
> > So, i figure its not restricted to struts.
> >
> > Anyway, still cant figure out how to increase max memory if it's running
> as
> > a windows service?
> >
> > Daniel.
> >
> >
> >
> >
> > -Original Message-
> > From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> > Sent: 14 May 2004 04:45
> > To: Struts Users Mailing List; Heinle, Chuck
> > Subject: Re: java.lang.OutOfMemoryError after server app start/stop
> > cyclin g
> >
> >
> > As per my knowledge the bug of OutOfMemory is related to version less then
> > jdk1.4. It has been solved in the 1.4.
> >
> > -Jignesh
> >
> > On Thursday 13 May 2004 23:30, Heinle, Chuck wrote:
> > > We have a similar problem with WebLogic 8.1 SP2...I was told by an
> > > associate that there is a 1.4.2_02 bug related class loading that might
> > > associated with the OutOfMemory.
> > >
> > > -Original Message-
> > > From: Joe Germuska [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, May 13, 2004 1:52 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> > > cycling
> > >
> > > At 6:07 PM +0100 5/13/04, Daniel Perry wrote:
> > > >Putting up the maximum memory Xmx does help as it gives it more memory
> > > > to use up, but only delays the inevitable :)
> > > >
> > > >Is this a struts issue? or does it happen with all tomcat apps?
> > >
> > > It happens with every servlet container I've used.  My understanding
> > > is that to redeploy a webapp, app servers generally discard the
> > > classloader they have been using and make a new one.  For various
> > > reasons, this can leave orphan objects which are never garbage
> > > collected.  If enough of these accumulate, you run out of memory.
> > >
> > > Admittedly, I use Struts in all these cases, you might argue that
> > > it's a Struts issue, since that's the common feature, but I can't
> > > think of anyways Struts is being particularly careless in a way that
> > > would aggravate this problem.
> > >
> > > I may have a completely wrong understanding of the problem too, but
> > > this is how we explain it to ourselves around here!
> > >
> > > Joe
> 
> -- 
> Jignesh Patel
> Project Leader
> 
> Bang Software Technolgy Pvt. Ltd.
> 
>  
>  (E) [EMAIL PROTECTED]
> 
>  (T) 091 484 3942132
>

RE: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread Adam Lipscombe
That seems like the best bet. Many thanks



-Original Message-
From: Yves Sy [mailto:[EMAIL PROTECTED] 
Sent: 14 May 2004 11:42
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: Newbie question: Deleting an ActionForm that is in session
scope.


That doesn't seem lika a really a good idea especially if you're keeping
track of the user logged in! invalidate() is used only when a user clicks
log out or if you want something to that effect. 

Just remove the actionform from the session"

Session.removeAttribute("yourActionFormNameDeclaredInTheStrutsConfig")

Regards,
-Yves-


> -Original Message-
> From: John Moore [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 6:25 PM
> To: Struts Users Mailing List
> Subject: Re: Newbie question: Deleting an ActionForm that is in
session
> scope.
> 
> Adam Lipscombe wrote:
> 
> >Folks,
> >
> >
> >I have a wizard framework that uses the same ActionForm to collect
data
> as
> >the wizard progresses.
> >The scope of the ActionForm is session so that values are preserved
when
> the
> >user navigates back and forwards through the wizard.
> >
> >When I get to the end of the wizard, I don't want the same data to be 
> >displayed next time the user starts the same wizard. Do I just remove 
> >the ActionForm from the session attribute list? Or should I leave the 
> >Form in the session attribute list and clear
each
> of
> >its fields?
> >Or is either approach OK?
> >
> >
> >
> >
> I don't know what the canonical way of doing this is, but what I do to 
> achieve precisely the effect you are after is to invalidate the
session
> in the Action class, after everything's done:
> 
>  req.getSession().invalidate();
> 
> This works for me!
> 
> John
> --
> ==
> John Moore  -  Norwich, UK  -  [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: Refresh - Duplicate Records Issue.

2004-05-14 Thread Harjot Narula
Hi Tarun

Have a look at this 

(Search for 'token' on this page)
http://www.scioworks.net/camino_doc/manual/strutsIntro/struts1_0.html

Hope you find a solution.

Harjot

- Original Message - 
From: "Tarun Dewan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, May 14, 2004 4:17 PM
Subject: Refresh - Duplicate Records Issue.


> Dear All, 
> 
> I'm facing one problem in my application. If user clicks 'REFRESH'
> (through right click menu) duplicate records gets inserted in my
> application. 
> 
> Pls. Suggest best way to handle the same. 
> 
> Thanks & regards,
> 
> Tarun.
> 
> 
> 
> 
> 
> -
> 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: Refresh - Duplicate Records Issue.

2004-05-14 Thread Yves Sy
Use redirect = "true" in the forward property of your action mapping. As
a rule of thumb, you should redirect if you do any action that involves
writing in the persistence layer such as deleting, saving, updating,
etc...

HTH,
-Yves-


> -Original Message-
> From: Tarun Dewan [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 6:47 PM
> To: 'Struts Users Mailing List'
> Subject: Refresh - Duplicate Records Issue.
> 
> Dear All,
> 
> I'm facing one problem in my application. If user clicks 'REFRESH'
> (through right click menu) duplicate records gets inserted in my
> application.
> 
> Pls. Suggest best way to handle the same.
> 
> Thanks & regards,
> 
> Tarun.
> 
> 
> 
> 
> 
> -
> 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: java.lang.OutOfMemoryError after server app start/stop cyclin g

2004-05-14 Thread Daniel Perry
eh?
i thought ANT_OPTS was for ant, not tomcat.

I dont have any trouble with ant using default memory allowance.
Its tomcat that is running out of memory, and is ignoring the CATALINA_OPTS.

Daniel.

-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 12:14
To: Struts Users Mailing List; Daniel Perry
Subject: Re: java.lang.OutOfMemoryError after server app start/stop
cyclin g


Daniel,
For your problem  3 you must have to set   ANT_OPTS=-Xmx512m in your dos 
prompt as mentioned by Chris. 

-Jignesh
On Friday 14 May 2004 15:49, Daniel Perry wrote:
> I have JAVA_OPTS and CATALINA_OPTS set to -Xmx1024M as system environment
> variables.
>
> If i start tomcat using startup.bat it uses these.
>
> If i start tomcat using as a windows service, it doesnt use these.
>
> Daniel.
>
> -Original Message-
> From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 11:09
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
>
>
> Type java -X in a windows shell and look at setting some of the below
> options in your environment using JAVA_OPTS
>
>  -Xmsset initial Java heap size
>  -Xmxset maximum Java heap size
>  -Xssset java thread stack size
>
> I alse use this to allocate more memory to ant at build time for a large
> application. 'set ANT_OPTS=-Xmx512m' (in a .bat) or pop it in your
> environment profile.
>
> Chris McCormack
>
> -Original Message-
> From: Daniel Perry [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 10:54
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
>
>
> I'm using jdk1.4.2_04, and it still happens!
>
> Here are some of my observations on the issue:
>
> 1. I did once develop some software using servlets/jsps. I never came
> accross this problem.  However, as jsps are automatically releaded, and
> this app was mainly jsp based, i dont remeber doing any restarting :)
>
> 2. running a memory intensive / complex app, it runs out of memory a lot
> quicker :)
>
> 3. If i run the stopapp and startapp ant tasks in a loop it runs out of
> memory with my struts app pretty quickly.  Doing the same thing to axis
> takes a lot longer.
>
> So, i figure its not restricted to struts.
>
> Anyway, still cant figure out how to increase max memory if it's running as
> a windows service?
>
> Daniel.
>
>
>
>
> -Original Message-
> From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 04:45
> To: Struts Users Mailing List; Heinle, Chuck
> Subject: Re: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
>
>
> As per my knowledge the bug of OutOfMemory is related to version less then
> jdk1.4. It has been solved in the 1.4.
>
> -Jignesh
>
> On Thursday 13 May 2004 23:30, Heinle, Chuck wrote:
> > We have a similar problem with WebLogic 8.1 SP2...I was told by an
> > associate that there is a 1.4.2_02 bug related class loading that might
> > associated with the OutOfMemory.
> >
> > -Original Message-
> > From: Joe Germuska [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 13, 2004 1:52 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> > cycling
> >
> > At 6:07 PM +0100 5/13/04, Daniel Perry wrote:
> > >Putting up the maximum memory Xmx does help as it gives it more memory
> > > to use up, but only delays the inevitable :)
> > >
> > >Is this a struts issue? or does it happen with all tomcat apps?
> >
> > It happens with every servlet container I've used.  My understanding
> > is that to redeploy a webapp, app servers generally discard the
> > classloader they have been using and make a new one.  For various
> > reasons, this can leave orphan objects which are never garbage
> > collected.  If enough of these accumulate, you run out of memory.
> >
> > Admittedly, I use Struts in all these cases, you might argue that
> > it's a Struts issue, since that's the common feature, but I can't
> > think of anyways Struts is being particularly careless in a way that
> > would aggravate this problem.
> >
> > I may have a completely wrong understanding of the problem too, but
> > this is how we explain it to ourselves around here!
> >
> > Joe

-- 
Jignesh Patel
Project Leader

Bang Software Technolgy Pvt. Ltd.

 
 (E) [EMAIL PROTECTED]

 (T) 091 484 3942132


 B-4, Smart Business Centre,
 Infopark, SDF IT Building,
 Kusumagiri P.O.,Kakkanad,
 Kochi - 682030,
 Kerala,
 India.

 Information contained in this transmission to the named  addressee, including 
any attachments thereto, should be
 considered the proprietary and confidential information of the sender.  As a 
condition for viewing the information,
 the sender agrees to keep the information confidential, to  refrain from 
disclosing the information, directly or
 indirectly, and to refrain from any actions that wo

RE: Refresh - Duplicate Records Issue.

2004-05-14 Thread Pilgrim, Peter

> -Original Message-
> From: Tarun Dewan [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 11:47
> To: 'Struts Users Mailing List'
> Subject: Refresh - Duplicate Records Issue.
> 
> 
> Dear All, 
> 
> I'm facing one problem in my application. If user clicks 'REFRESH'
> (through right click menu) duplicate records gets inserted in my
> application. 
> 
> Pls. Suggest best way to handle the same. 
> 
> Thanks & regards,
> 
> Tarun.
>

You should investigate Struts Token tag action () and also

``Action.isTokenValid( HttpServletRequest request)''

etc

--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ
United Kingdom
Tel: +44 (0)207 883 4447
 

==
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==


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



RE: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?

2004-05-14 Thread Takhar, Sandeep
I believe we are using it no problem.

Let me check...

yep.

sandeep

-Original Message-
From: Joe Hertz [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 12:12 AM
To: 'Struts Users Mailing List'
Subject: RE: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?


You might want to ask this on commons-user.

As a datapoint, I'm looking at the Struts 1.2 Nightlies I have built
with, and I don't even see a Commons-Lang.jar packaged with it.

> -Original Message-
> From: Hohlen, John C [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 13, 2004 11:57 PM
> To: [EMAIL PROTECTED]
> Subject: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?
> 
> 
> We're trying to figure out how backwards compatible 
> Commons-Lang 2.0 is with it's predecessor (1.0.1).  
> Specifically, we'd like to use Commons Lang 2.0 with Struts 
> 1.1 (which is distributed with Commons-Lang 1.0.1).  Has 
> anyone ever attempted this?   I asked this question about a 
> month ago but never received any replies:
>  
http://marc.theaimsgroup.com/?l=struts-user&m=108154032009627&w=2
 
Thanks,

JOHN



-
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: java.lang.OutOfMemoryError after server app start/stop cyclin g

2004-05-14 Thread Jignesh Patel
Daniel,
For your problem  3 you must have to set   ANT_OPTS=-Xmx512m in your dos 
prompt as mentioned by Chris. 

-Jignesh
On Friday 14 May 2004 15:49, Daniel Perry wrote:
> I have JAVA_OPTS and CATALINA_OPTS set to -Xmx1024M as system environment
> variables.
>
> If i start tomcat using startup.bat it uses these.
>
> If i start tomcat using as a windows service, it doesnt use these.
>
> Daniel.
>
> -Original Message-
> From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 11:09
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
>
>
> Type java -X in a windows shell and look at setting some of the below
> options in your environment using JAVA_OPTS
>
>  -Xmsset initial Java heap size
>  -Xmxset maximum Java heap size
>  -Xssset java thread stack size
>
> I alse use this to allocate more memory to ant at build time for a large
> application. 'set ANT_OPTS=-Xmx512m' (in a .bat) or pop it in your
> environment profile.
>
> Chris McCormack
>
> -Original Message-
> From: Daniel Perry [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 10:54
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
>
>
> I'm using jdk1.4.2_04, and it still happens!
>
> Here are some of my observations on the issue:
>
> 1. I did once develop some software using servlets/jsps. I never came
> accross this problem.  However, as jsps are automatically releaded, and
> this app was mainly jsp based, i dont remeber doing any restarting :)
>
> 2. running a memory intensive / complex app, it runs out of memory a lot
> quicker :)
>
> 3. If i run the stopapp and startapp ant tasks in a loop it runs out of
> memory with my struts app pretty quickly.  Doing the same thing to axis
> takes a lot longer.
>
> So, i figure its not restricted to struts.
>
> Anyway, still cant figure out how to increase max memory if it's running as
> a windows service?
>
> Daniel.
>
>
>
>
> -Original Message-
> From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> Sent: 14 May 2004 04:45
> To: Struts Users Mailing List; Heinle, Chuck
> Subject: Re: java.lang.OutOfMemoryError after server app start/stop
> cyclin g
>
>
> As per my knowledge the bug of OutOfMemory is related to version less then
> jdk1.4. It has been solved in the 1.4.
>
> -Jignesh
>
> On Thursday 13 May 2004 23:30, Heinle, Chuck wrote:
> > We have a similar problem with WebLogic 8.1 SP2...I was told by an
> > associate that there is a 1.4.2_02 bug related class loading that might
> > associated with the OutOfMemory.
> >
> > -Original Message-
> > From: Joe Germuska [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 13, 2004 1:52 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.lang.OutOfMemoryError after server app start/stop
> > cycling
> >
> > At 6:07 PM +0100 5/13/04, Daniel Perry wrote:
> > >Putting up the maximum memory Xmx does help as it gives it more memory
> > > to use up, but only delays the inevitable :)
> > >
> > >Is this a struts issue? or does it happen with all tomcat apps?
> >
> > It happens with every servlet container I've used.  My understanding
> > is that to redeploy a webapp, app servers generally discard the
> > classloader they have been using and make a new one.  For various
> > reasons, this can leave orphan objects which are never garbage
> > collected.  If enough of these accumulate, you run out of memory.
> >
> > Admittedly, I use Struts in all these cases, you might argue that
> > it's a Struts issue, since that's the common feature, but I can't
> > think of anyways Struts is being particularly careless in a way that
> > would aggravate this problem.
> >
> > I may have a completely wrong understanding of the problem too, but
> > this is how we explain it to ourselves around here!
> >
> > Joe

-- 
Jignesh Patel
Project Leader

Bang Software Technolgy Pvt. Ltd.

 
 (E) [EMAIL PROTECTED]

 (T) 091 484 3942132


 B-4, Smart Business Centre,
 Infopark, SDF IT Building,
 Kusumagiri P.O.,Kakkanad,
 Kochi - 682030,
 Kerala,
 India.

 Information contained in this transmission to the named  addressee, including 
any attachments thereto, should be
 considered the proprietary and confidential information of the sender.  As a 
condition for viewing the information,
 the sender agrees to keep the information confidential, to  refrain from 
disclosing the information, directly or
 indirectly, and to refrain from any actions that would  constitute or 
facilitate unauthorized access to the 
 information without express permission from the sender. The recipient also 
acknowledges and agrees to respect
 sender's intellectual property rights in and to the  information.  If the 
recipient of this transmission is not
 the named addressee, the recipient should immediately notify the sender and 
destroy the information transmitted
 without making any co

RE: Refresh - Duplicate Records Issue.

2004-05-14 Thread rahul.chaudhary

Use JavaScript to avoid re-submitting the form, which in turn will prevent invoking 
the duplicate call to the database.


-Original Message-
From: Tarun Dewan [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 4:17 PM
To: 'Struts Users Mailing List'
Subject: Refresh - Duplicate Records Issue.


Dear All,

I'm facing one problem in my application. If user clicks 'REFRESH'
(through right click menu) duplicate records gets inserted in my
application.

Pls. Suggest best way to handle the same.

Thanks & regards,

Tarun.





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



RE: Refresh - Duplicate Records Issue.

2004-05-14 Thread Paul McCulloch
Struts provides 'tokens' (Action.saveToken(), Action.isTokenValid()) to
catch users doing this.

One way of making it more difficult for users to do this is to use a
redirecting forward to your save confirmation page. This way a rfresh will
just refress the confirmation, not the record creation.

Paul

> -Original Message-
> From: Tarun Dewan [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 11:47 AM
> To: 'Struts Users Mailing List'
> Subject: Refresh - Duplicate Records Issue.
> 
> 
> Dear All, 
> 
> I'm facing one problem in my application. If user clicks 'REFRESH'
> (through right click menu) duplicate records gets inserted in my
> application. 
> 
> Pls. Suggest best way to handle the same. 
> 
> Thanks & regards,
> 
> Tarun.
> 
> 
> 
> 
> 
> -
> 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]



Refresh - Duplicate Records Issue.

2004-05-14 Thread Tarun Dewan
Dear All, 

I'm facing one problem in my application. If user clicks 'REFRESH'
(through right click menu) duplicate records gets inserted in my
application. 

Pls. Suggest best way to handle the same. 

Thanks & regards,

Tarun.





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



RE: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread Yves Sy
That doesn't seem lika a really a good idea especially if you're keeping
track of the user logged in! invalidate() is used only when a user
clicks log out or if you want something to that effect. 

Just remove the actionform from the session"

Session.removeAttribute("yourActionFormNameDeclaredInTheStrutsConfig")

Regards,
-Yves-


> -Original Message-
> From: John Moore [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 6:25 PM
> To: Struts Users Mailing List
> Subject: Re: Newbie question: Deleting an ActionForm that is in
session
> scope.
> 
> Adam Lipscombe wrote:
> 
> >Folks,
> >
> >
> >I have a wizard framework that uses the same ActionForm to collect
data
> as
> >the wizard progresses.
> >The scope of the ActionForm is session so that values are preserved
when
> the
> >user navigates back and forwards through the wizard.
> >
> >When I get to the end of the wizard, I don't want the same data to be
> >displayed next time the user starts the same wizard.
> >Do I just remove the ActionForm from the session attribute list?
> >Or should I leave the Form in the session attribute list and clear
each
> of
> >its fields?
> >Or is either approach OK?
> >
> >
> >
> >
> I don't know what the canonical way of doing this is, but what I do to
> achieve precisely the effect you are after is to invalidate the
session
> in the Action class, after everything's done:
> 
>  req.getSession().invalidate();
> 
> This works for me!
> 
> John
> --
> ==
> John Moore  -  Norwich, UK  -  [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: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread Andrew Hill
That will destroy *everything* in the users session.

-Original Message-
From: John Moore [mailto:[EMAIL PROTECTED]
Sent: Friday, 14 May 2004 18:25
To: Struts Users Mailing List
Subject: Re: Newbie question: Deleting an ActionForm that is in session
scope.


Adam Lipscombe wrote:

>Folks,
>
>
>I have a wizard framework that uses the same ActionForm to collect data as
>the wizard progresses.
>The scope of the ActionForm is session so that values are preserved when
the
>user navigates back and forwards through the wizard.
>
>When I get to the end of the wizard, I don't want the same data to be
>displayed next time the user starts the same wizard.
>Do I just remove the ActionForm from the session attribute list?
>Or should I leave the Form in the session attribute list and clear each of
>its fields?
>Or is either approach OK?
>
>
>
>
I don't know what the canonical way of doing this is, but what I do to
achieve precisely the effect you are after is to invalidate the session
in the Action class, after everything's done:

 req.getSession().invalidate();

This works for me!

John
--
==
John Moore  -  Norwich, UK  -  [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]



R: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread Amleto Di Salle
Yes, you can remove the related ActionForm inside the session using the
following code inside the "last" Action of the wizard
HttpSession session = httpServletRequest.getSession( false );
if ( session != null ) {
session.removeAttribute( actionMapping.getName() );
}

But this solution is uncorrect, because if the user doesn't finish the
wizard you have the same problem.

So, the best way is to use the reset() method inside the ActionForm.

BR
/Amleto

-Messaggio originale-
Da: Andrew Hill [mailto:[EMAIL PROTECTED] 
Inviato: venerdì 14 maggio 2004 12.13
A: Struts Users Mailing List
Oggetto: RE: Newbie question: Deleting an ActionForm that is in session
scope.


Yes, you can just remove the form from the session.
Struts will create a new one when its needed. :-)

-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
Sent: Friday, 14 May 2004 18:15
To: [EMAIL PROTECTED]
Subject: Newbie question: Deleting an ActionForm that is in session
scope.


Folks,


I have a wizard framework that uses the same ActionForm to collect data
as the wizard progresses. The scope of the ActionForm is session so that
values are preserved when the user navigates back and forwards through
the wizard.

When I get to the end of the wizard, I don't want the same data to be
displayed next time the user starts the same wizard. Do I just remove
the ActionForm from the session attribute list? Or should I leave the
Form in the session attribute list and clear each of its fields? Or is
either approach OK?


TIA - Adam





-
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: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread John Moore
Adam Lipscombe wrote:

Folks,

I have a wizard framework that uses the same ActionForm to collect data as
the wizard progresses.
The scope of the ActionForm is session so that values are preserved when the
user navigates back and forwards through the wizard.
When I get to the end of the wizard, I don't want the same data to be
displayed next time the user starts the same wizard.
Do I just remove the ActionForm from the session attribute list?
Or should I leave the Form in the session attribute list and clear each of
its fields?
Or is either approach OK?
 

I don't know what the canonical way of doing this is, but what I do to 
achieve precisely the effect you are after is to invalidate the session 
in the Action class, after everything's done:

req.getSession().invalidate();

This works for me!

John
--
==
John Moore  -  Norwich, UK  -  [EMAIL PROTECTED]
==
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: java.lang.OutOfMemoryError after server app start/stop cyclin g

2004-05-14 Thread Daniel Perry
I have JAVA_OPTS and CATALINA_OPTS set to -Xmx1024M as system environment variables.

If i start tomcat using startup.bat it uses these.

If i start tomcat using as a windows service, it doesnt use these.

Daniel.

-Original Message-
From: McCormack, Chris [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 11:09
To: Struts Users Mailing List
Subject: RE: java.lang.OutOfMemoryError after server app start/stop
cyclin g


Type java -X in a windows shell and look at setting some of the below options in your 
environment using JAVA_OPTS

 -Xmsset initial Java heap size
 -Xmxset maximum Java heap size
 -Xssset java thread stack size

I alse use this to allocate more memory to ant at build time for a large application. 
'set ANT_OPTS=-Xmx512m' (in a .bat) or pop it in your environment profile.

Chris McCormack

-Original Message-
From: Daniel Perry [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 10:54
To: Struts Users Mailing List
Subject: RE: java.lang.OutOfMemoryError after server app start/stop
cyclin g


I'm using jdk1.4.2_04, and it still happens!

Here are some of my observations on the issue:

1. I did once develop some software using servlets/jsps. I never came accross this 
problem.  However, as jsps are automatically releaded, and this app was mainly jsp 
based, i dont remeber doing any restarting :)

2. running a memory intensive / complex app, it runs out of memory a lot quicker :)

3. If i run the stopapp and startapp ant tasks in a loop it runs out of memory with my 
struts app pretty quickly.  Doing the same thing to axis takes a lot longer.

So, i figure its not restricted to struts.

Anyway, still cant figure out how to increase max memory if it's running as a windows 
service?

Daniel.




-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 04:45
To: Struts Users Mailing List; Heinle, Chuck
Subject: Re: java.lang.OutOfMemoryError after server app start/stop
cyclin g


As per my knowledge the bug of OutOfMemory is related to version less then 
jdk1.4. It has been solved in the 1.4.

-Jignesh
On Thursday 13 May 2004 23:30, Heinle, Chuck wrote:
> We have a similar problem with WebLogic 8.1 SP2...I was told by an
> associate that there is a 1.4.2_02 bug related class loading that might
> associated with the OutOfMemory.
>
> -Original Message-
> From: Joe Germuska [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 1:52 PM
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop cycling
>
> At 6:07 PM +0100 5/13/04, Daniel Perry wrote:
> >Putting up the maximum memory Xmx does help as it gives it more memory to
> >use up, but only delays the inevitable :)
> >
> >Is this a struts issue? or does it happen with all tomcat apps?
>
> It happens with every servlet container I've used.  My understanding
> is that to redeploy a webapp, app servers generally discard the
> classloader they have been using and make a new one.  For various
> reasons, this can leave orphan objects which are never garbage
> collected.  If enough of these accumulate, you run out of memory.
>
> Admittedly, I use Struts in all these cases, you might argue that
> it's a Struts issue, since that's the common feature, but I can't
> think of anyways Struts is being particularly careless in a way that
> would aggravate this problem.
>
> I may have a completely wrong understanding of the problem too, but
> this is how we explain it to ourselves around here!
>
> Joe

-- 
Jignesh Patel
Project Leader

Bang Software Technolgy Pvt. Ltd.

 
 (E) [EMAIL PROTECTED]

 (T) 091 484 3942132


 B-4, Smart Business Centre,
 Infopark, SDF IT Building,
 Kusumagiri P.O.,Kakkanad,
 Kochi - 682030,
 Kerala,
 India.

 Information contained in this transmission to the named  addressee, including 
any attachments thereto, should be
 considered the proprietary and confidential information of the sender.  As a 
condition for viewing the information,
 the sender agrees to keep the information confidential, to  refrain from 
disclosing the information, directly or
 indirectly, and to refrain from any actions that would  constitute or 
facilitate unauthorized access to the 
 information without express permission from the sender. The recipient also 
acknowledges and agrees to respect
 sender's intellectual property rights in and to the  information.  If the 
recipient of this transmission is not
 the named addressee, the recipient should immediately notify the sender and 
destroy the information transmitted
 without making any copy or distribution thereof. 

-
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: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?

2004-05-14 Thread Joe Hertz
Yes, that's very interesting indeed. It rechecked and it wasn't in my
last nightly download (4/23). 

I suppose it could be an error in the notes, or a recent change. I
happen to be using common-lang for other reasons entirely.

> -Original Message-
> From: Hohlen, John C [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 14, 2004 12:49 AM
> To: Struts Users Mailing List; Struts Users Mailing List
> Subject: RE: Repost: Anybody Using Commons-Lang 2.0 With Struts 1.1?
> 
> 
> That's a good idea about the Commons-Lang User list.  I 
> actually searched the archive before posting to the Struts 
> mailing list, but didn't see anything. 
>  
> That's very interesting about the 1.2 nightlies.  I'm seeing 
> 2.0 is required for 1.2 (assuming the installation notes are 
> up to date):
>  
> http://jakarta.apache.org/struts/userGuide/installation.html
>  
> Thanks for the reply,
> 
> JOHN
> 
>   -Original Message- 
>   From: Joe Hertz [mailto:[EMAIL PROTECTED] 
>   Sent: Thu 5/13/2004 11:12 PM 
>   To: 'Struts Users Mailing List' 
>   Cc: 
>   Subject: RE: Repost: Anybody Using Commons-Lang 2.0 
> With Struts 1.1?
>   
>   
> 
>   You might want to ask this on commons-user.
>   
>   As a datapoint, I'm looking at the Struts 1.2 Nightlies 
> I have built
>   with, and I don't even see a Commons-Lang.jar packaged with it.
>   
>   > -Original Message-
>   > From: Hohlen, John C [mailto:[EMAIL PROTECTED]
>   > Sent: Thursday, May 13, 2004 11:57 PM
>   > To: [EMAIL PROTECTED]
>   > Subject: Repost: Anybody Using Commons-Lang 2.0 With 
> Struts 1.1?
>   >
>   >
>   > We're trying to figure out how backwards compatible
>   > Commons-Lang 2.0 is with it's predecessor (1.0.1). 
>   > Specifically, we'd like to use Commons Lang 2.0 with Struts
>   > 1.1 (which is distributed with Commons-Lang 1.0.1).  Has
>   > anyone ever attempted this?   I asked this question about a
>   > month ago but never received any replies:
>   > 
>   
> http://marc.theaimsgroup.com/?l=struts-user&m=> 108154032009627&w=2
>   
>   Thanks,
>   
>   JOHN
>   
>   
>   
>   
> -
>   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: Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread Andrew Hill
Yes, you can just remove the form from the session.
Struts will create a new one when its needed. :-)

-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
Sent: Friday, 14 May 2004 18:15
To: [EMAIL PROTECTED]
Subject: Newbie question: Deleting an ActionForm that is in session
scope.


Folks,


I have a wizard framework that uses the same ActionForm to collect data as
the wizard progresses.
The scope of the ActionForm is session so that values are preserved when the
user navigates back and forwards through the wizard.

When I get to the end of the wizard, I don't want the same data to be
displayed next time the user starts the same wizard.
Do I just remove the ActionForm from the session attribute list?
Or should I leave the Form in the session attribute list and clear each of
its fields?
Or is either approach OK?


TIA - Adam





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



Newbie question: Deleting an ActionForm that is in session scope.

2004-05-14 Thread Adam Lipscombe
Folks,
 
 
I have a wizard framework that uses the same ActionForm to collect data as
the wizard progresses.
The scope of the ActionForm is session so that values are preserved when the
user navigates back and forwards through the wizard.
 
When I get to the end of the wizard, I don't want the same data to be
displayed next time the user starts the same wizard.
Do I just remove the ActionForm from the session attribute list?
Or should I leave the Form in the session attribute list and clear each of
its fields?
Or is either approach OK?
 
 
TIA - Adam 
 
 
 


RE: java.lang.OutOfMemoryError after server app start/stop cyclin g

2004-05-14 Thread McCormack, Chris
Type java -X in a windows shell and look at setting some of the below options in your 
environment using JAVA_OPTS

 -Xmsset initial Java heap size
 -Xmxset maximum Java heap size
 -Xssset java thread stack size

I alse use this to allocate more memory to ant at build time for a large application. 
'set ANT_OPTS=-Xmx512m' (in a .bat) or pop it in your environment profile.

Chris McCormack

-Original Message-
From: Daniel Perry [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 10:54
To: Struts Users Mailing List
Subject: RE: java.lang.OutOfMemoryError after server app start/stop
cyclin g


I'm using jdk1.4.2_04, and it still happens!

Here are some of my observations on the issue:

1. I did once develop some software using servlets/jsps. I never came accross this 
problem.  However, as jsps are automatically releaded, and this app was mainly jsp 
based, i dont remeber doing any restarting :)

2. running a memory intensive / complex app, it runs out of memory a lot quicker :)

3. If i run the stopapp and startapp ant tasks in a loop it runs out of memory with my 
struts app pretty quickly.  Doing the same thing to axis takes a lot longer.

So, i figure its not restricted to struts.

Anyway, still cant figure out how to increase max memory if it's running as a windows 
service?

Daniel.




-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 04:45
To: Struts Users Mailing List; Heinle, Chuck
Subject: Re: java.lang.OutOfMemoryError after server app start/stop
cyclin g


As per my knowledge the bug of OutOfMemory is related to version less then 
jdk1.4. It has been solved in the 1.4.

-Jignesh
On Thursday 13 May 2004 23:30, Heinle, Chuck wrote:
> We have a similar problem with WebLogic 8.1 SP2...I was told by an
> associate that there is a 1.4.2_02 bug related class loading that might
> associated with the OutOfMemory.
>
> -Original Message-
> From: Joe Germuska [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 1:52 PM
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop cycling
>
> At 6:07 PM +0100 5/13/04, Daniel Perry wrote:
> >Putting up the maximum memory Xmx does help as it gives it more memory to
> >use up, but only delays the inevitable :)
> >
> >Is this a struts issue? or does it happen with all tomcat apps?
>
> It happens with every servlet container I've used.  My understanding
> is that to redeploy a webapp, app servers generally discard the
> classloader they have been using and make a new one.  For various
> reasons, this can leave orphan objects which are never garbage
> collected.  If enough of these accumulate, you run out of memory.
>
> Admittedly, I use Struts in all these cases, you might argue that
> it's a Struts issue, since that's the common feature, but I can't
> think of anyways Struts is being particularly careless in a way that
> would aggravate this problem.
>
> I may have a completely wrong understanding of the problem too, but
> this is how we explain it to ourselves around here!
>
> Joe

-- 
Jignesh Patel
Project Leader

Bang Software Technolgy Pvt. Ltd.

 
 (E) [EMAIL PROTECTED]

 (T) 091 484 3942132


 B-4, Smart Business Centre,
 Infopark, SDF IT Building,
 Kusumagiri P.O.,Kakkanad,
 Kochi - 682030,
 Kerala,
 India.

 Information contained in this transmission to the named  addressee, including 
any attachments thereto, should be
 considered the proprietary and confidential information of the sender.  As a 
condition for viewing the information,
 the sender agrees to keep the information confidential, to  refrain from 
disclosing the information, directly or
 indirectly, and to refrain from any actions that would  constitute or 
facilitate unauthorized access to the 
 information without express permission from the sender. The recipient also 
acknowledges and agrees to respect
 sender's intellectual property rights in and to the  information.  If the 
recipient of this transmission is not
 the named addressee, the recipient should immediately notify the sender and 
destroy the information transmitted
 without making any copy or distribution thereof. 

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


***
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions co

RE: java.lang.OutOfMemoryError after server app start/stop cyclin g

2004-05-14 Thread Daniel Perry
I'm using jdk1.4.2_04, and it still happens!

Here are some of my observations on the issue:

1. I did once develop some software using servlets/jsps. I never came accross this 
problem.  However, as jsps are automatically releaded, and this app was mainly jsp 
based, i dont remeber doing any restarting :)

2. running a memory intensive / complex app, it runs out of memory a lot quicker :)

3. If i run the stopapp and startapp ant tasks in a loop it runs out of memory with my 
struts app pretty quickly.  Doing the same thing to axis takes a lot longer.

So, i figure its not restricted to struts.

Anyway, still cant figure out how to increase max memory if it's running as a windows 
service?

Daniel.




-Original Message-
From: Jignesh Patel [mailto:[EMAIL PROTECTED]
Sent: 14 May 2004 04:45
To: Struts Users Mailing List; Heinle, Chuck
Subject: Re: java.lang.OutOfMemoryError after server app start/stop
cyclin g


As per my knowledge the bug of OutOfMemory is related to version less then 
jdk1.4. It has been solved in the 1.4.

-Jignesh
On Thursday 13 May 2004 23:30, Heinle, Chuck wrote:
> We have a similar problem with WebLogic 8.1 SP2...I was told by an
> associate that there is a 1.4.2_02 bug related class loading that might
> associated with the OutOfMemory.
>
> -Original Message-
> From: Joe Germuska [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 1:52 PM
> To: Struts Users Mailing List
> Subject: RE: java.lang.OutOfMemoryError after server app start/stop cycling
>
> At 6:07 PM +0100 5/13/04, Daniel Perry wrote:
> >Putting up the maximum memory Xmx does help as it gives it more memory to
> >use up, but only delays the inevitable :)
> >
> >Is this a struts issue? or does it happen with all tomcat apps?
>
> It happens with every servlet container I've used.  My understanding
> is that to redeploy a webapp, app servers generally discard the
> classloader they have been using and make a new one.  For various
> reasons, this can leave orphan objects which are never garbage
> collected.  If enough of these accumulate, you run out of memory.
>
> Admittedly, I use Struts in all these cases, you might argue that
> it's a Struts issue, since that's the common feature, but I can't
> think of anyways Struts is being particularly careless in a way that
> would aggravate this problem.
>
> I may have a completely wrong understanding of the problem too, but
> this is how we explain it to ourselves around here!
>
> Joe

-- 
Jignesh Patel
Project Leader

Bang Software Technolgy Pvt. Ltd.

 
 (E) [EMAIL PROTECTED]

 (T) 091 484 3942132


 B-4, Smart Business Centre,
 Infopark, SDF IT Building,
 Kusumagiri P.O.,Kakkanad,
 Kochi - 682030,
 Kerala,
 India.

 Information contained in this transmission to the named  addressee, including 
any attachments thereto, should be
 considered the proprietary and confidential information of the sender.  As a 
condition for viewing the information,
 the sender agrees to keep the information confidential, to  refrain from 
disclosing the information, directly or
 indirectly, and to refrain from any actions that would  constitute or 
facilitate unauthorized access to the 
 information without express permission from the sender. The recipient also 
acknowledges and agrees to respect
 sender's intellectual property rights in and to the  information.  If the 
recipient of this transmission is not
 the named addressee, the recipient should immediately notify the sender and 
destroy the information transmitted
 without making any copy or distribution thereof. 

-
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: Language resource bundles problem

2004-05-14 Thread Marcin Korszeń
W liście z pią, 14-05-2004, godz. 10:52, Paul McCulloch pisze: 
> I'd try overwriting the struts Locale in Globals.LOCALE_KEY when the user
> clicks on a flag. I don't know if that will work, but I'd try it.
> 
> I'd also give careful consideration to just using the browsers requested
> language, rather than making the user choose one explicitly.

Hi,

Globals.LOCALE_KEY in session scope isn't set in ma case. I'm useing
javax.servlet.Filter to set this
request.getSession().setAttribute(Globals.LOCALE_KEY, locale);
, where locale is locale what application should use.

Marcin


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



RE: Language resource bundles problem

2004-05-14 Thread Paul McCulloch
I'd try overwriting the struts Locale in Globals.LOCALE_KEY when the user
clicks on a flag. I don't know if that will work, but I'd try it.

I'd also give careful consideration to just using the browsers requested
language, rather than making the user choose one explicitly.
Paul

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 7:24 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Language resource bundles problem
> 
> 
> Another related problem...
> 
> I've gotten this working as you state fine now.  I have a 
> session attribute, 
> countryCode, that is literally just EN, DE, etc.  I have some 
> images of 
> flags, when you click one it calls an action that sets the 
> appropriate code 
> in session (I also do this in the first Action called in my 
> app, defaulting 
> to EN).
> 
> Here's my question... in my JSP's, when using , 
> I know that I 
> can specify bundle="en" or bundle="de" and that works, but 
> how can I set the 
> bundle attribute to a variable value, namely the value of the session 
> attribute countryCode?
> 
> Thanks again!
> 
> 
> >From: Paul McCulloch <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: Language resource bundles problem
> >Date: Thu, 13 May 2004 16:47:00 +0100
> >
> >You are calling the getMessage(String, Object) method. The 
> String is the 
> >key
> >& the object is a substitution paramter (i.e. {0}).
> >
> >You want the getMessage(Locale, String) method. You can 
> eaither create a
> >Locale from 'de' or get the users first requested locale with
> >"request.getSession().getAttribute(Globals.LOCALE_KEY);"
> >
> >HTH,
> >
> >Paul
> >
> > > MessageResources mr = getResources(request);
> > > myActionForm.setMessage(mr.getMessage("messages.deleteFailed"));
> > >
> > > Now, this works just fine.  My message is displayed as a
> > > result of the
> > > onLoad event of my page via a simple JavaScript alert 
> box.  Very cool.
> > >
> > > However, if I want to display the message from the German
> > > resource file, I
> > > can't get it to work.  I thought all I had to do was this:
> > >
> > > myActionForm.setMessage(mr.getMessage("de", 
> "messages.deleteFailed"));
> > >
> >
> >
> >
> >*
> *
> >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]
> >
> 
> _
> Express yourself with the new version of MSN Messenger! 
> Download today - 
> it's FREE! http://messenger.msn.com/go/onm00200471ave/direct/01/
> 
> 
> -
> 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 

RE: Language resource bundles problem

2004-05-14 Thread Paul McCulloch
I think the Locale should be magically in session for you.

Paul

> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 13, 2004 6:48 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Language resource bundles problem
> 
> 
> Sorry Paul, I actually missed your reply (the inevitable 
> result of having 
> five different high-volume mailing lists filing into one 
> eMail account).  
> Indeed, what you state did the trick, thank you very much!
> 
> Oh, actually, one other question... I've never had to think about 
> internationalization before, so this question is out of my 
> experience... is 
> there a Local object in session by default, or do I need to 
> put it there 
> myself as the result of the first request of my app?  Thanks again!
> 
> >From: Paul McCulloch <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> >Subject: RE: Language resource bundles problem
> >Date: Thu, 13 May 2004 16:47:00 +0100
> >
> >You are calling the getMessage(String, Object) method. The 
> String is the 
> >key
> >& the object is a substitution paramter (i.e. {0}).
> >
> >You want the getMessage(Locale, String) method. You can 
> eaither create a
> >Locale from 'de' or get the users first requested locale with
> >"request.getSession().getAttribute(Globals.LOCALE_KEY);"
> >
> >HTH,
> >
> >Paul
> >
> > > MessageResources mr = getResources(request);
> > > myActionForm.setMessage(mr.getMessage("messages.deleteFailed"));
> > >
> > > Now, this works just fine.  My message is displayed as a
> > > result of the
> > > onLoad event of my page via a simple JavaScript alert 
> box.  Very cool.
> > >
> > > However, if I want to display the message from the German
> > > resource file, I
> > > can't get it to work.  I thought all I had to do was this:
> > >
> > > myActionForm.setMessage(mr.getMessage("de", 
> "messages.deleteFailed"));
> > >
> >
> >
> >
> >*
> *
> >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]
> >
> 
> _
> Check out the coupons and bargains on MSN Offers! 
http://youroffers.msn.com


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

setting title-Attribute in with contents from a bean

2004-05-14 Thread PANTA-RHEI WOLF
Hi there,

i run in an problem when using  where some attributes should
be filled with dynamic content from a Bean.

my example:


  ">



  
  
  


  
  "/>



  

 
   
 



When i try to compile this, i run in an error saying: attribut
resultServices" isn't a valid attributname.
I tried several thinks without any success.

What i have to do to set the attribute title with the content of
resultServices.getDateCheckRemote() ???

Alternativ i tried: 
But this seemd not to be parsed et al.

Any help is very welcome.

Regards Mirko


Mit freundlichen Grüßen

Mirko Wolf

-
panta rhei systems gmbh
budapester straße 31
10787 berlin
tel +49.30.26 01-14 17
fax +49.30.26 01-414 13
[EMAIL PROTECTED] 
www.panta-rhei.de 

Diese Nachricht ist vertraulich und ausschliesslich für den Adressaten
bestimmt. Jeder Gebrauch durch Dritte ist verboten. Falls Sie die Daten
irrtuemlich erhalten haben, nehmen Sie bitte Kontakt mit dem Absender
auf und loeschen Sie die Daten auf jedem Computer und Datentraeger. Der
Absender ist nicht verantwortlich für die ordnungsgemaesse,
vollstaendige oder verzoegerungsfreie Übertragung dieser Nachricht.

This message is confidential and intended solely for the use by the
addressee. Any use of this message by a third party is prohibited. If
you received this message in error, please contact the sender and delete
the data from any computer and data carrier. The sender is neither
liable for the proper and complete transmission of the information in
the message nor for any delay in its receipt.


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



RE: submit form question

2004-05-14 Thread Yves Sy
Seems to me that the best way to go around it would be just to warn the
users before they unload the page (whether closing it or moving to
another page) that they haven't submitted the form yet and that all the
data they inputted will get lost if they continue their action...

Regards,
-Yves-


> -Original Message-
> From: Andrew Hill [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 14, 2004 2:03 PM
> To: Struts Users Mailing List
> Subject: RE: submit form question
> 
> Yes, its a difficult one this.
> 
> (Afaik) Your only hope is onBeforeUnload(), but in most browsers I
have
> tried, getting the browser to submit the form at this point in time
simply
> didnt work properly for me (ie: it didnt submit!). Does submit() work
for
> you from inside a beforeUnload handler? If so your halfway there.
> 
> In my case I needed it to merely hit a url (to tell server side code
to
> clean out a particluar object from the session), so I achieved this by
> having it open a popup window (ouch!) that submits itself and closes.
In
> order to differentiate between a window navigation and a window close
I
> had
> to have all the navigation links work via javascript and have them set
a
> variable which the beforeUnload handler could check. If the variable
was
> not
> set it would assume it was a window close rather than a navigation and
go
> ahead and do its thing.
> 
> In your case things will be a lot more difficult as you have to get
the
> form
> data submitted to the server, and coming up with something that will
work
> cross-browser ... well good luck, but if I were you Id try and get
your
> requirements changed so you dont have to go into this particluar
> minefield!
> 
> Its been a while since I did that code so I cant remember all the
other
> options I looked at at the time, so maybe there is a better way to
achieve
> it?
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, 14 May 2004 13:44
> To: Struts Users Mailing List
> Subject: submit form question
> 
> 
> 
> Hi experts,
> How to submit the form when the user closes the browser
window,
> before closing the browser window i want to submit the form.
> Which JavaScript event should i  use. i tried using onBeforeUnload(),
the
> problem is that this event gets fired even when the user goes to
> another page. Thanks in advance
> 
> Regards
> Subramaniam Olaganthan
> 
> 
> -
> 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: Html:link/html:select and submit

2004-05-14 Thread Heligon Sandra
Do you confirm that the submit erase all parameters ?

I will replace the html:link by a button, 
but I have the problem for the html:select onchange.
I should use a submit to display my form again.
Is there another way ?

I tried to use a JavaScript but the submit erase parameters.
At the end of the queryString (parameter of the HttpServletRequest) 
I don't have the string "typeUpdate=change".


var enableSubmit=false;
function updateForm(form) {
if(enableSubmit) {
   form.action ='/my.do?typeUpdate=change';
   form.submit();
}
}


If I remove the submit in the JavaScript the action is not called.



Has someone already use a submit for combo change ?
I don't know very well JavaScript there is perhaps a syntax error.
I read some example with return value (true) in the JavaScript.

Thanks in advane for your help
Sandra

-Original Message-
From: Nicolas De Loof [mailto:[EMAIL PROTECTED]
Sent: 13 May 2004 12:32
To: Struts Users Mailing List
Subject: Re: Html:link and save form



A link in HTML does not submit a form. Only submit inputs (buttons) an
images input does.
You can use javascript to do it (as you did), but then it overrides the href
set on the link (/myAction.do) and its
parameters.

Nico.


> I have a form with a htlm:link
>
>  paramName="address" onclick="document.forms[0].submit();">
>
> I need to add submit on the onclick to have changes of the form.
>
> If I don't make submit the state of the form is not saved.
>
> Is it a bug ?
>
> Sandra
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Our name has changed.  Please update your address book to the following
format: "[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient,  you are not
authorized to read, print, retain, copy, disseminate,  distribute, or use
this message or any part thereof. If you receive this  message in error,
please notify the sender immediately and delete all  copies of this message.


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