Re: LookupDispatchAction default

2004-03-25 Thread Brian Sayatovic/AMIG
Well, I tried overriding unspecified and I still get the following (mind 
you that I didn't change the parameter name yet) when I hit 
/admin/list.do:

Error 500: Request[/admin/list] does not contain handler parameter 
named submit 

My unspecified method I simply overrode from DispatchAction to call my 
normal refresh list method:

protected ActionForward unspecified(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
) {
return this.refreshList(mapping, form, request, response);
}

While the JavaDocs do imply this should work, when I looked in the Struts 
1.1 source, the execute method of LookupDispatchAction generates the erorr 
message I see as soon as request.getParameter(parameterName) returns null. 
 In fact, I can find no reference to 'unspecified' anywhere in 
LookupDispatchAction.

So I think there is a disconnect.  Maybe LookupDispatchAction is broken 
and should be fixed to also use 'unspecified', or maybe its JavaDocs 
should explicitly state that it does not utilize the 'unspecified' 
behavior of its parent class.  Or, maybe I missed something and didn't 
implement correctly?

Regards,
Brian.




Mark Lowe [EMAIL PROTECTED]
03/24/2004 09:21 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: LookupDispatchAction default



unspecified() is the method you want look at the javadoc.

you do need the method name though

/admin/list.do?method

I saw that using submit as the parameter name causes problems so i 
wouldn't use that.

On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote:

 I'd like to be able to have someone hit my action, /admin/list.do, 
 without
 having to specify a submit paramater.  However, the action is a 
 subclass
 of LookupDispatchAction whci requires that the request parameter be
 supplied.  Looking in the struts source code, it would be nice if the
 LookupDispatchAction could fall back to a default or not consider 
 'null'
 to be a bad value and just use 'null' as a key to the lookup Map.  For
 now, any link or redirect to the page must specify what I consider to 
 be
 the default action -- refresh -- on the URL:
 /admin/list/do?submit=Refresh.

 Is there another way to do this?  Is it worth suggesting that
 LookupDispatchAction support a default or null mapping?

 Regards,
 Brian.


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





Re: LookupDispatchAction default

2004-03-25 Thread Mark Shifman
Look at the sourc for LookupDispatchAction snippet below:
public ActionForward execute(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws Exception {
   // Identify the request parameter containing the method name
   String parameter = mapping.getParameter();
   if (parameter == null) {
   String message = messages.getMessage(dispatch.handler, 
mapping.getPath());
   throw new ServletException(message);
   }

   // Identify the string to lookup
   String name = request.getParameter(parameter);
   if (name == null) {
   String message =
   messages.getMessage(dispatch.parameter, 
mapping.getPath(), parameter);
   throw new ServletException(message);
   }

It looks for the parameter's value and throws if the name is null so it 
never gets a chance to get to unspecified in Dispatch action.

mas

Brian Sayatovic/AMIG wrote:

Well, I tried overriding unspecified and I still get the following (mind 
you that I didn't change the parameter name yet) when I hit 
/admin/list.do:

   Error 500: Request[/admin/list] does not contain handler parameter 
named submit 

My unspecified method I simply overrode from DispatchAction to call my 
normal refresh list method:

   protected ActionForward unspecified(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response
   ) {
   return this.refreshList(mapping, form, request, response);
   }
While the JavaDocs do imply this should work, when I looked in the Struts 
1.1 source, the execute method of LookupDispatchAction generates the erorr 
message I see as soon as request.getParameter(parameterName) returns null. 
In fact, I can find no reference to 'unspecified' anywhere in 
LookupDispatchAction.

So I think there is a disconnect.  Maybe LookupDispatchAction is broken 
and should be fixed to also use 'unspecified', or maybe its JavaDocs 
should explicitly state that it does not utilize the 'unspecified' 
behavior of its parent class.  Or, maybe I missed something and didn't 
implement correctly?

Regards,
Brian.


Mark Lowe [EMAIL PROTECTED]
03/24/2004 09:21 AM
Please respond to Struts Users Mailing List
   To: Struts Users Mailing List [EMAIL PROTECTED]
   cc: 
   Subject:Re: LookupDispatchAction default



unspecified() is the method you want look at the javadoc.

you do need the method name though

/admin/list.do?method

I saw that using submit as the parameter name causes problems so i 
wouldn't use that.

On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote:

 

I'd like to be able to have someone hit my action, /admin/list.do, 
without
having to specify a submit paramater.  However, the action is a 
subclass
of LookupDispatchAction whci requires that the request parameter be
supplied.  Looking in the struts source code, it would be nice if the
LookupDispatchAction could fall back to a default or not consider 
'null'
to be a bad value and just use 'null' as a key to the lookup Map.  For
now, any link or redirect to the page must specify what I consider to 
be
the default action -- refresh -- on the URL:
/admin/list/do?submit=Refresh.

Is there another way to do this?  Is it worth suggesting that
LookupDispatchAction support a default or null mapping?
Regards,
Brian.
   



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


 



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: LookupDispatchAction default

2004-03-25 Thread Brian Sayatovic/AMIG
That's exactly my point.

If there is no submit=xxx parameter/value to the action, then it throws 
a NullPointerException.  So my action works like this:

/admin/list.do?submit=Refresh

But not like this:

/admin/list.do

In the second case, there is no submit parameter.  For now, anything I 
want to go to the list for the firs titme, I have it going to the first 
representation.  But what I really want is for it to have a default 
behavior when no submit value is present so I can use the second form of 
the URL instead.  That was why I originally posted.  The initial wave of 
replies suggested I could use 'unspecified', but that didn't work.

So, is the answer:

(a) I should never use the second form because it is evil
(b) I could use the second form but its broken in LookupDispatchAction
(c) something else?

Regards,
Brian.




Mark Shifman [EMAIL PROTECTED]
03/25/2004 08:51 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: LookupDispatchAction default


Look at the sourc for LookupDispatchAction snippet below:
 public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

// Identify the request parameter containing the method name
String parameter = mapping.getParameter();
if (parameter == null) {
String message = messages.getMessage(dispatch.handler, 
mapping.getPath());
throw new ServletException(message);
}

// Identify the string to lookup
String name = request.getParameter(parameter);
if (name == null) {
String message =
messages.getMessage(dispatch.parameter, 
mapping.getPath(), parameter);
throw new ServletException(message);
}

It looks for the parameter's value and throws if the name is null so it 
never gets a chance to get to unspecified in Dispatch action.

mas

Brian Sayatovic/AMIG wrote:

Well, I tried overriding unspecified and I still get the following (mind 
you that I didn't change the parameter name yet) when I hit 
/admin/list.do:

Error 500: Request[/admin/list] does not contain handler 
parameter 
named submit 

My unspecified method I simply overrode from DispatchAction to call my 
normal refresh list method:

protected ActionForward unspecified(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
) {
return this.refreshList(mapping, form, request, 
response);
}

While the JavaDocs do imply this should work, when I looked in the Struts 

1.1 source, the execute method of LookupDispatchAction generates the 
erorr 
message I see as soon as request.getParameter(parameterName) returns 
null. 
 In fact, I can find no reference to 'unspecified' anywhere in 
LookupDispatchAction.

So I think there is a disconnect.  Maybe LookupDispatchAction is broken 
and should be fixed to also use 'unspecified', or maybe its JavaDocs 
should explicitly state that it does not utilize the 'unspecified' 
behavior of its parent class.  Or, maybe I missed something and didn't 
implement correctly?

Regards,
Brian.




Mark Lowe [EMAIL PROTECTED]
03/24/2004 09:21 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List 
[EMAIL PROTECTED]
cc: 
Subject:Re: LookupDispatchAction default



unspecified() is the method you want look at the javadoc.

you do need the method name though

/admin/list.do?method

I saw that using submit as the parameter name causes problems so i 
wouldn't use that.

On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote:

 

I'd like to be able to have someone hit my action, /admin/list.do, 
without
having to specify a submit paramater.  However, the action is a 
subclass
of LookupDispatchAction whci requires that the request parameter be
supplied.  Looking in the struts source code, it would be nice if the
LookupDispatchAction could fall back to a default or not consider 
'null'
to be a bad value and just use 'null' as a key to the lookup Map.  For
now, any link or redirect to the page must specify what I consider to 
be
the default action -- refresh -- on the URL:
/admin/list/do?submit=Refresh.

Is there another way to do this?  Is it worth suggesting that
LookupDispatchAction support a default or null mapping?

Regards,
Brian.
 



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




 



-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL

Re: LookupDispatchAction default

2004-03-25 Thread Mark Lowe
/admin/list.do?method

On 25 Mar 2004, at 14:02, Brian Sayatovic/AMIG wrote:

Well, I tried overriding unspecified and I still get the following 
(mind
you that I didn't change the parameter name yet) when I hit
/admin/list.do:

Error 500: Request[/admin/list] does not contain handler 
parameter
named submit

My unspecified method I simply overrode from DispatchAction to call my
normal refresh list method:
protected ActionForward unspecified(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response
) {
return this.refreshList(mapping, form, request, 
response);
}

While the JavaDocs do imply this should work, when I looked in the 
Struts
1.1 source, the execute method of LookupDispatchAction generates the 
erorr
message I see as soon as request.getParameter(parameterName) returns 
null.
 In fact, I can find no reference to 'unspecified' anywhere in
LookupDispatchAction.

So I think there is a disconnect.  Maybe LookupDispatchAction is broken
and should be fixed to also use 'unspecified', or maybe its JavaDocs
should explicitly state that it does not utilize the 'unspecified'
behavior of its parent class.  Or, maybe I missed something and didn't
implement correctly?
Regards,
Brian.


Mark Lowe [EMAIL PROTECTED]
03/24/2004 09:21 AM
Please respond to Struts Users Mailing List
To: Struts Users Mailing List 
[EMAIL PROTECTED]
cc:
Subject:Re: LookupDispatchAction default



unspecified() is the method you want look at the javadoc.

you do need the method name though

/admin/list.do?method

I saw that using submit as the parameter name causes problems so i
wouldn't use that.
On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote:

I'd like to be able to have someone hit my action, /admin/list.do,
without
having to specify a submit paramater.  However, the action is a
subclass
of LookupDispatchAction whci requires that the request parameter be
supplied.  Looking in the struts source code, it would be nice if the
LookupDispatchAction could fall back to a default or not consider
'null'
to be a bad value and just use 'null' as a key to the lookup Map.  For
now, any link or redirect to the page must specify what I consider to
be
the default action -- refresh -- on the URL:
/admin/list/do?submit=Refresh.
Is there another way to do this?  Is it worth suggesting that
LookupDispatchAction support a default or null mapping?
Regards,
Brian.


-
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: LookupDispatchAction default

2004-03-25 Thread Wendy Smoak
 From: Brian Sayatovic/AMIG [mailto:[EMAIL PROTECTED] 
 That's exactly my point.
 If there is no submit=xxx parameter/value to the action, 
 then it throws 
 a NullPointerException.  So my action works like this:
 /admin/list.do?submit=Refresh
 But not like this:
 /admin/list.do
 So, is the answer:
 (a) I should never use the second form because it is evil
 (b) I could use the second form but its broken in LookupDispatchAction
 (c) something else?

What version of Struts are you using?  I suspect you're on 1.1 or
something older than a nightly build.  The javadocs on the Struts site
go with the nightly builds.

The unspecified method is in DispatchAction, and is inherited by
LookupDispatchAction, so you won't find it in the LDA source code.  It's
actually the protected 'dispatchMethod' code that handles the null:
// Make sure we have a valid method name to call.
// This may be null if the user hacks the query string.
if (name == null) {
return this.unspecified(mapping, form, request, response);
}

If unspecified does not work for a missing parameter in your version of
struts, (it does in 1.2.0 and probably somewhat before that,) either
move to a newer version of Struts, or override 'execute' to provide
default behavior.  Check for the presence of the request parameter, if
it exists, call super.execute(), if not, do your default behavior,
probably by calling one of the methods in your LDA.

The reason you're getting conflicting answers is that some of us are
using new builds where unspecified works fine, and some are on other,
older versions.  The nightly builds are very stable, I recommend them
and have no problems using them in production.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: LookupDispatchAction default

2004-03-24 Thread Mark Lowe
unspecified() is the method you want look at the javadoc.

you do need the method name though

/admin/list.do?method

I saw that using submit as the parameter name causes problems so i 
wouldn't use that.

On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote:

I'd like to be able to have someone hit my action, /admin/list.do, 
without
having to specify a submit paramater.  However, the action is a 
subclass
of LookupDispatchAction whci requires that the request parameter be
supplied.  Looking in the struts source code, it would be nice if the
LookupDispatchAction could fall back to a default or not consider 
'null'
to be a bad value and just use 'null' as a key to the lookup Map.  For
now, any link or redirect to the page must specify what I consider to 
be
the default action -- refresh -- on the URL:
/admin/list/do?submit=Refresh.

Is there another way to do this?  Is it worth suggesting that
LookupDispatchAction support a default or null mapping?
Regards,
Brian.


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


RE: LookupDispatchAction default

2004-03-24 Thread Wendy Smoak
 From: Brian Sayatovic/AMIG [mailto:[EMAIL PROTECTED] 
 I'd like to be able to have someone hit my action, 
 /admin/list.do, without having to specify a submit paramater.
 Is there another way to do this?  Is it worth suggesting that 
 LookupDispatchAction support a default or null mapping?

I'm not sure what version you're on, but look for the 'unspecified'
method in DispatchAction, which is inherited by LookupDispatchAction.  

From the javadoc:
http://jakarta.apache.org/struts/api/org/apache/struts/actions/Dispatch
Action.html
Method which is dispatched to when there is no value for specified
request parameter included in the request. Subclasses of DispatchAction
should override this method if they wish to provide default behavior
different than throwing a ServletException.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 


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



RE: LookupDispatchAction default

2004-03-24 Thread Wendy Smoak
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 unspecified() is the method you want look at the javadoc.
 you do need the method name though
 /admin/list.do?method
 I saw that using submit as the parameter name causes problems so i 
 wouldn't use that.

I agree about not using submit, if you end up needing to use JavaScript
to change the value, you run into problems since submit() is already
function.  Calling either document.forms[0].submit.value=something or
document.forms[0].submit() gives an error, I can't remember which.  Bad
idea, avoid it. ;)  

However, I have plenty of /admin/list.do links with no request
parameters at all, and the unspecified method is called as described.
(I use nightly builds, so I don't know when it started working that
way...)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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



Re: LookupDispatchAction default

2004-03-24 Thread Mark Lowe
I agree about not using submit, if you end up needing to use JavaScript
to change the value, you run into problems since submit() is already
function.  Calling either document.forms[0].submit.value=something or
document.forms[0].submit() gives an error, I can't remember which.  Bad
idea, avoid it. ;)
It was you post on the thread last week where i pick it up.

However, I have plenty of /admin/list.do links with no request
parameters at all, and the unspecified method is called as described.
(I use nightly builds, so I don't know when it started working that
way...)
Good to know that its been addressed, but I'm on whatever the stable 
release of 1.1 is. I'd like to be taking the source of 1.2 from cvs and 
helping to test it but i just cant be arsed with all that maven stuf. 
But i think i'd still stick to the stable release rather then get 
caught up in all that unknown territory stuff.



On 24 Mar 2004, at 15:30, Wendy Smoak wrote:

From: Mark Lowe [mailto:[EMAIL PROTECTED]
unspecified() is the method you want look at the javadoc.
you do need the method name though
/admin/list.do?method
I saw that using submit as the parameter name causes problems so i
wouldn't use that.
I agree about not using submit, if you end up needing to use JavaScript
to change the value, you run into problems since submit() is already
function.  Calling either document.forms[0].submit.value=something or
document.forms[0].submit() gives an error, I can't remember which.  Bad
idea, avoid it. ;)
However, I have plenty of /admin/list.do links with no request
parameters at all, and the unspecified method is called as described.
(I use nightly builds, so I don't know when it started working that
way...)
--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management


-
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: LookupDispatchAction default

2004-03-24 Thread Wendy Smoak
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 

 It was you post on the thread last week where i pick it up.

Sorry, I'm apparently repeating myself!  I can't remember last week this
early in the morning.

 Good to know that its been addressed, but I'm on whatever the stable 
 release of 1.1 is. I'd like to be taking the source of 1.2 
 from cvs and 
 helping to test it but i just cant be arsed with all that maven stuf. 
 But i think i'd still stick to the stable release rather then get 
 caught up in all that unknown territory stuff.

I've been using nightly builds since forever, and I've never once built
it from source.  There's always a compiled version available along with
the source.  I do download the source and occasionally look at it or use
it with JSwat, but building it is definitely not a prerequisite for
using the latest and greatest.

I have an Ant task that copies the .jars over from where I download and
unzip the nightly builds.  If I were really clever, I could probably
convince Ant to figure out the filename and go get and expand the .zip
files, then copy the .jar files. ;)

The only weirdness with 1.2.0 I've found is that ActionError is
deprecated but there is no replacement, so you get a bunch of warnings
if you use it.  I don't think you'll have a big problem going from 1.1
to 1.2.  

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: LookupDispatchAction default

2004-03-24 Thread Mark Lowe
On 24 Mar 2004, at 16:13, Wendy Smoak wrote:

From: Mark Lowe [mailto:[EMAIL PROTECTED]

It was you post on the thread last week where i pick it up.
Sorry, I'm apparently repeating myself!  I can't remember last week 
this
early in the morning.

Good to know that its been addressed, but I'm on whatever the stable
release of 1.1 is. I'd like to be taking the source of 1.2
from cvs and
helping to test it but i just cant be arsed with all that maven stuf.
But i think i'd still stick to the stable release rather then get
caught up in all that unknown territory stuff.
I've been using nightly builds since forever, and I've never once built
it from source.  There's always a compiled version available along with
the source.  I do download the source and occasionally look at it or 
use
it with JSwat, but building it is definitely not a prerequisite for
using the latest and greatest.

I have an Ant task that copies the .jars over from where I download and
unzip the nightly builds.  If I were really clever, I could probably
convince Ant to figure out the filename and go get and expand the .zip
files, then copy the .jar files. ;)
The only weirdness with 1.2.0 I've found is that ActionError is
deprecated but there is no replacement, so you get a bunch of warnings
if you use it.  I don't think you'll have a big problem going from 1.1
to 1.2.
Yeah .. I tried to make my 1.1 apps forward compatible with this by 
using ActionMessages but to no avail, which is really quite a pain. I 
was using html:errors tag to display but this is supposed to be okay 
but wasn't.


--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management
-
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: LookupDispatchAction with html:image?

2004-03-18 Thread Dixit, Shashank (Cognizant)
Search for ImageButtonDispatchAction in struts previous messages. It is devoloped by 
somebody and have put it there. 

Shashank Dixit
jpmc ib , 
cognizant technology solutions pvt. ltd.

Tel: +91 20 2931100
Ext : 2354
Vnet : 22362
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.


-Original Message-
From: Stefan Burkard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 18 March 2004 8:19 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction with html:image?


hi struts-users

is it possible to use the LookupDispatchAction with image-submit-buttons 
(html:image) instead of normal submit-buttons?

thanks and greetings
stefan


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

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com

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

Re: LookupDispatchAction with html:image?

2004-03-18 Thread Mark Lowe
Will this not work then?

html:image
property=method
value=Save
page=/image/buttons/en/save.gif /
assuming the value is set by nesting bean:message

html:image
property=method
page=/image/buttons/en/save.gif
bean:message key=button.save /
/html:image


On 18 Mar 2004, at 10:36, Dixit, Shashank (Cognizant) wrote:

Search for ImageButtonDispatchAction in struts previous messages. It  
is devoloped by somebody and have put it there.

Shashank Dixit
jpmc ib ,
cognizant technology solutions pvt. ltd.
Tel: +91 20 2931100
Ext : 2354
Vnet : 22362
Mobile : 98904 25400
An Obstacle is something you see when you take your eyes off the goal.

-Original Message-
From: Stefan Burkard [mailto:[EMAIL PROTECTED]
Sent: Thursday, 18 March 2004 8:19 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction with html:image?
hi struts-users

is it possible to use the LookupDispatchAction with  
image-submit-buttons
(html:image) instead of normal submit-buttons?

thanks and greetings
stefan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
InterScan_Disclaimer.txt- 

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: LookupDispatchAction with html:image?

2004-03-18 Thread dilip
try ImageButtonBeanManager from Mitranosoft


- Original Message - 
From: Stefan Burkard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 2:48 PM
Subject: LookupDispatchAction with html:image?


 hi struts-users
 
 is it possible to use the LookupDispatchAction with image-submit-buttons 
 (html:image) instead of normal submit-buttons?
 
 thanks and greetings
 stefan
 
 
 -
 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: LookupDispatchAction problem

2004-03-18 Thread Wendy Smoak
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Request[/uploadDocument] does not contain handler parameter named
 submit
 i really don't know why this error appears.

[I'm currently trying to convince the spam filter to cough up all the
messages it quarantined since 3pm yesterday, so this may have already
been answered, but...]

It's saying that there is no request parameter named submit.  What
does the HTML generated by the JSP look like?  Can you list out all the
request parameters and examine them?

I wonder if the name is reserved?  I think you'll have trouble later if
you need to refer to the form element with JavaScript-- there is already
a document.forms[0].submit(); function (method?) and you'll get errors
if you ever try to say document.forms[0].submit.value=abc;

I suggest changing the name of the form element to 'method' as used in
the LookupDispatchAction javadocs.  Or, I've used 'mode' and
'userAction' with no problems.  Anything but 'submit' (or any other HTML
keyword).

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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



RE: LookupDispatchAction problem

2004-02-10 Thread Yee, Richard K,,DMDCWEST
Søren,
The error message indicates that you are missing a button.search entry in
your Application Resources file. 

-Richard

-Original Message-
From: Søren Hjarlvig [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 10, 2004 2:13 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction problem


I'm following Ted's tip (http://husted.com/struts/tips/003.html) but I 
can't get to work:

With the newest nightly build I'm getting the following error:

500 Servlet Exception
javax.servlet.ServletException: Action[/administrator] missing resource
'button.search' in key method map
at 
org.apache.struts.actions.LookupDispatchAction.getLookupMapName(LookupDispat
chAction.java:283)
at 
org.apache.struts.actions.LookupDispatchAction.getMethodName(LookupDispatchA
ction.java:324)
at 
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.
java:201)


The form:
...
html:form method=get action=/administrator
html:submit property=myactionbutton.search/html:submit
...
/html:form
...

The resulting request:
http://localhost:8080/fonde/administrator.do?myaction=button.search

struts-config.xml:
...
action
  path=/administrator
  type=fonde.webedit.AdministratorAction
  name=administratorForm
  scope=request
  input=/pages/administrator.jsp
  parameter=myaction
  forward name=admSearchDone path=/pages/administrator.jsp/ /action
...

AdministratorAction:

public class AdministratorAction extends LookupDispatchAction {

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(button.search, search);
System.out.println((String)map.get(button.search));
return map;
}

public ActionForward search(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest req,
 HttpServletResponse res) {
...
return mapping.findForward(admSearchDone);
}
}

The println() writes search on the console, so I know that the 
getKeyMethodMap()-method is invoked and the mapping should be ok.

So why can't it find my search-method?

The 1.1 release build also fails, but with another error message (this 
is probably due to bug 21226 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=21226)).


Best regards

Soeren Hjarlvig




-
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: LookupDispatchAction problem

2004-02-10 Thread Wendy Smoak
 From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
 The error message indicates that you are missing a 
 button.search entry in
 your Application Resources file. 

Earlier, Søren wrote:
  http://localhost:8080/fonde/administrator.do?myaction=button.search

In addition, the 'myaction' request parameter should be set to whatever the value of 
button.search is in ApplicationResources.properties.  

ApplicationResources.properties:
button.search=ClickHere

getKeyMethodMap:
map.put(button.search, search);

Then you have a button or a link that causes this:
?myaction=ClickHere

Now clicking on that button/link will cause the 'search' method to be executed.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: LookupDispatchAction problem

2004-02-10 Thread Søren Hjarlvig
Wendy Smoak wrote:
In addition, the 'myaction' request parameter should be set to whatever the value of button.search is in ApplicationResources.properties.  

ApplicationResources.properties:
button.search=ClickHere
Thank you. This solved my problem :-)
The entry was missing from my ApplicationResources.properties file 
(maybe the faq on the subject, should be more specific wrt. updating the 
properties file).

Regards

Soeren Hjarlvig



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


Re: LookupDispatchAction

2004-02-03 Thread Jason Lea
Well, LookUpDispatchAction doesn't call the unspecified action when it 
is no parameter is supplied.
One way would be to override the method that does the lookup and when no 
action parameter is supplied, call the unspecified() parameter.

Another way is to make your initial call to the action provide the 
parameter.  I have done this in some cases by defining some 
global-forwards eg
forward name=rolelist path=/admin/RoleAdmin.do?dispatch=list/

The other thing that needs to be looked at here is that 'list' will not 
be localised.  So in my default ApplicationResources.properties file I 
have a global.list=list, and have map.put(global.list,list); entry 
in the keyMethodMap.  Then make sure you don't localise the global.list 
in the other properties files.  I might have a localised list button eg 
map.put(button.list,list); too, so that the list button appears in 
the correct language.  There is no problem with more than 1 name linking 
to the list method.

Guilherme Barile wrote:

Hi
I have the following DispatchAction working here
public MyDispatchAction extends DispatchAction {
public unspecified(...) {
read_data_from_database();
populate_form();
return(mapping.findForward(renderForm);
}
}
renderForm renders the form (I don't access the jsp directly, just the
action, this way it calls unspecified, which reads data from a database
and populates the form).
I tried converting this to a LookupDispatchAction, making
MyDispatchAction extend LookupDispatchAction and adding
protected Map getKeyMethodMap() {
   Map map = new HashMap();
   map.put(button.save, save);
   return map;
}
To the code ... the parameter is called action it exists on
struts-config, the message button.save exists on
ApplicationResources.properties but everytime I run it, I get the error
Request[/myform] does not contain handler parameter named action
I *guess* it happens because the first time I accessed this form no
buttons were pressed, so action really doesn't exist (yet) ... problem
is this must happen this way, otherwise I won't be able to read data
from the database to populate the form.
With an ordinary DispatchAction it works fine, but I can't localize my
buttons. Any ideas ?
Thanks in advance

gui

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



--
Jason Lea


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


Re: LookupDispatchAction

2004-02-03 Thread Guilherme Barile
Hi
I just found out that unspecified() is called, but the parameter you
specified on struts-config must exist, so if you access something like
http://mysite/MyAction.do?action=
it will call unspecified(), because that action does not exist.

Interesting uh ?
On Tue, 2004-02-03 at 23:38, Jason Lea wrote:
 Well, LookUpDispatchAction doesn't call the unspecified action when it 
 is no parameter is supplied.
 One way would be to override the method that does the lookup and when no 
 action parameter is supplied, call the unspecified() parameter.
 
 Another way is to make your initial call to the action provide the 
 parameter.  I have done this in some cases by defining some 
 global-forwards eg
 forward name=rolelist path=/admin/RoleAdmin.do?dispatch=list/
 
 The other thing that needs to be looked at here is that 'list' will not 
 be localised.  So in my default ApplicationResources.properties file I 
 have a global.list=list, and have map.put(global.list,list); entry 
 in the keyMethodMap.  Then make sure you don't localise the global.list 
 in the other properties files.  I might have a localised list button eg 
 map.put(button.list,list); too, so that the list button appears in 
 the correct language.  There is no problem with more than 1 name linking 
 to the list method.
 
 Guilherme Barile wrote:
 
 Hi
  I have the following DispatchAction working here
 
 public MyDispatchAction extends DispatchAction {
  public unspecified(...) {
  read_data_from_database();
  populate_form();
  return(mapping.findForward(renderForm);
  }
 }
 
 renderForm renders the form (I don't access the jsp directly, just the
 action, this way it calls unspecified, which reads data from a database
 and populates the form).
 I tried converting this to a LookupDispatchAction, making
 MyDispatchAction extend LookupDispatchAction and adding
 
 protected Map getKeyMethodMap() {
 Map map = new HashMap();
 map.put(button.save, save);
 return map;
 }
 
 To the code ... the parameter is called action it exists on
 struts-config, the message button.save exists on
 ApplicationResources.properties but everytime I run it, I get the error
 Request[/myform] does not contain handler parameter named action
 
 I *guess* it happens because the first time I accessed this form no
 buttons were pressed, so action really doesn't exist (yet) ... problem
 is this must happen this way, otherwise I won't be able to read data
 from the database to populate the form.
 
 With an ordinary DispatchAction it works fine, but I can't localize my
 buttons. Any ideas ?
 
 Thanks in advance
 
 gui
 
 
 -
 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: LookupDispatchAction - ActionForward - ActionForm (after successfull insert not empty).

2003-12-22 Thread Wendy Smoak
 From: Ronald Rotteveel [mailto:[EMAIL PROTECTED] 
 I WOULD LOVE lose the name of the customer that I just inserted. 
 If I come back to the customer form now, the
 field where someone can type a name is already filled with 
 the name I just inserted. 

Sounds like your form bean is in session scope.  You may want to
implement the 'reset' method of ActionForm, as the default
implementation does nothing.  I have this in reset on one of my forms:



This is not good, I wanted to be empty aftert a successfull
 insert.
 
 It seems like the form stays in session/request or whatever 
 scope, but I
 can't make it empty or null it.
 
 Could somebody give me some pointers how to solve this? (e.g. 
 keywords to
 search on of maybe a link. I also have the Struts in Action 
 and Professional
 Jakarta Struts books, so page numbers are fine too ;-) )
 
 Or is the only way to solve this via a success page between 
 the action and
 the form? I would like to avoid this, because somebody who 
 has to do a lot
 of data entry doesn't want a confirmation page after each entry.
 
 I searched through this mail archive, but didn't find 
 anything usefull or
 maybe I'm searching on the wrong keywords!
 
 Thanks in advance!
 
 
 Regards,
 
 Ronald Rotteveel
 
 
 -
 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: LookupDispatchAction - ActionForward - ActionForm (after successfull insert not empty).

2003-12-22 Thread Ronald Rotteveel
Dear Wendy,

thanks for your submission, I also have a reset function in my and it looks
like this:

public void reset(ActionMapping mapping, HttpServletRequest request)
{
  customerId = null;
  name = null;
  resources = null;
}

I don't see any function in ActionForm that looks like initialize(mapping);
I presume you have written your own?

Anyway, it looks like the reset method isn't called. Could it be that my
LookupDispatchAction isn't implemented well?

Thanks for any submissions in advance!

Regards,

Ronald Rotteveel



- Original Message - 
From: Wendy Smoak [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, December 22, 2003 4:05 PM
Subject: FW: LookupDispatchAction - ActionForward - ActionForm (after
successfull insert not empty).


 Obviously, that was the wrong key...

  From: Ronald Rotteveel [mailto:[EMAIL PROTECTED]
  I WOULD LOVE lose the name of the customer that I just inserted.
  If I come back to the customer form now, the
  field where someone can type a name is already filled with
  the name I just inserted.

 Sounds like your form bean is in session scope.  You may want to
 implement the 'reset' method of ActionForm, as the default
 implementation does nothing.  I have this in reset on one of my forms:

  initialize( mapping );

 -- 
 Wendy Smoak
 Application Systems Analyst, Sr.
 ASU IA Information Resources Management


 -
 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: LookupDispatchAction - ActionForward - ActionForm (after successfull insert not empty).

2003-12-22 Thread Wendy Smoak
 From: Ronald Rotteveel [mailto:[EMAIL PROTECTED] 
 I don't see any function in ActionForm that looks like 
 initialize(mapping);
 I presume you have written your own?

Sorry... I use dynamic forms.  The initialize method comes from
DynaActionForm.  It just sets the values back to the initial values
specified in struts-config.  What you've done is fine.  (I'd probably
set the values to  if they're Strings to avoid NPE's though.)

 Anyway, it looks like the reset method isn't called. Could it 
 be that my LookupDispatchAction isn't implemented well?

Put a log statement at the top of your reset method and look to see when
it's called.  Even if there is something wrong with your LDA, that
shouldn't preclude Struts calling reset on the form.

Are you saying you have the reset method you posted and you *still* get
old values showing up in the HTML form?  Then I'd suspect a config
problem in struts-config.xml-- maybe it's not using the form bean you
think it is??

Post the relevant bits of Action/config/Form and see if another set of
eyes can spot the problem.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: LookupDispatchAction, theory behind it

2003-10-08 Thread Craig R. McClanahan
Adam Hardy wrote:

I thought I might just raise this here because I see struts has 
obviously no qualms about submit button functionality, but it bugs me.

I'm not using LookupDispatchAction, but I would like to if it wasn't 
for the annoying browser behaviour on submit of the HTML-input submit 
button values.

LookupDispatchAction is great for sorting out the appropriate action 
according to which submit button was clicked, even if those submit 
buttons have got localized text. But surely it's just pandering to the 
poor design of HTML? 
Yep.



Surely W3C is going to have to change that browser behaviour 
recommendation,
Whether they should or not isn't really the issue ... it's whether they 
will.  I'm betting that:

* They won't (especially not as an HTML/4.01 successor, since the focus 
there
 is on XHTML and modularization and such, not HTML.

* They won't (just for this issue) because it's not important enough by 
itself, and
 creating new standards is *expensive*.

* They won't (because existing workarounds are available -- it's not a 
dealbreaker bug

* Even if they did, it wouldn't matter to Struts ... we'd have to 
support the current
 mechanism anyway because 100% of the worlds browsers today don't 
support the
 new mechanism.


because submitting the button name-value pair as submit/labeltext is 
indisputably linking function and content, which these days should be 
frowned upon.

Shouldn't it?

I mean, it could use body text for the label, and submit its value, or 
it could have a caption attribute or similar.

Adam



Craig



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


Re: LookupDispatchAction, theory behind it

2003-10-08 Thread Jason Lea
The HTML/4.01 spec does have something that addresses this, the button 
tag.  The problem is browser support.

You can supply the 'type' (eg submit, reset, button), a 'value' that is 
returned as the name/value pair, and the button label is the body of the 
tag (meaning you can mix images, text, and other formatting tags into 
the label).  You can use it like this:

  button name=dispatch value=delete type=submit
IMG src=/icons/del.gif alt=delete bdelete/b item
  /button
Which is great, but as IE doesn't support it correctly it becomes 
useless.  Other browsers do support it, Mozilla for example.

IE's problems include defaulting all button tag 'types' to 'button' 
instead of 'submit', returning the label in the name/value pair and 
putting all button fields into the request instead of the submit button 
being activated.

So we are stuck with using input buttons and LookupDispatchAction.

Craig R. McClanahan wrote:
Adam Hardy wrote:

I thought I might just raise this here because I see struts has 
obviously no qualms about submit button functionality, but it bugs me.

I'm not using LookupDispatchAction, but I would like to if it wasn't 
for the annoying browser behaviour on submit of the HTML-input submit 
button values.

LookupDispatchAction is great for sorting out the appropriate action 
according to which submit button was clicked, even if those submit 
buttons have got localized text. But surely it's just pandering to the 
poor design of HTML? 


Yep.



Surely W3C is going to have to change that browser behaviour 
recommendation,


Whether they should or not isn't really the issue ... it's whether they 
will.  I'm betting that:

* They won't (especially not as an HTML/4.01 successor, since the focus 
there
 is on XHTML and modularization and such, not HTML.

* They won't (just for this issue) because it's not important enough by 
itself, and
 creating new standards is *expensive*.

* They won't (because existing workarounds are available -- it's not a 
dealbreaker bug

* Even if they did, it wouldn't matter to Struts ... we'd have to 
support the current
 mechanism anyway because 100% of the worlds browsers today don't 
support the
 new mechanism.


because submitting the button name-value pair as submit/labeltext is 
indisputably linking function and content, which these days should be 
frowned upon.

Shouldn't it?

I mean, it could use body text for the label, and submit its value, or 
it could have a caption attribute or similar.

Adam



Craig



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



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


Re: LookupDispatchAction, theory behind it

2003-10-08 Thread Adam Hardy
On 10/08/2003 11:01 PM Craig R. McClanahan wrote:
Adam Hardy wrote:
LookupDispatchAction is great for sorting out the appropriate action 
according to which submit button was clicked, even if those submit 
buttons have got localized text. But surely it's just pandering to the 
poor design of HTML? 


Yep.
Thanks for the agreement. The purist angel/devil on my shoulder says 
though, Struts shouldn't support features that are flawed. It's like 
writing HTML that takes makes use of browser presentation bugs.

Well, I guess I'm going to kill those extra submit buttons and put the 
functionality in a menu.

Adam

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


Re: LookupDispatchAction and submit

2003-09-26 Thread Jan Van Stalle
Hello,

did you try putting a hidden input in your form with the name actionType and
a default value (which would map to one of your methods).

Jan

Lars Bergström [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi everyone,

 I have a html:form in which i have several buttons like this:

 html:submit property=actionType
   bean:message key=button.add/
 /html:submit
 html:submit property=actionType
   bean:message key=button.delete/
 /html:submit
 html:submit property=actionType
   bean:message key=button.update/
 /html:submit

 With the help of this I use the LookupDispatchAction which my Action
 class extends. This works fine for my submit buttons.

 My action-mapping

 action path=/MyAction
 type=com.mycompany.MyAction
 name=myBean
 parameter=actionType
   forward name=input path=/pages/myPage.jsp/
 /action


 However, I also have a html:text property=propKey size=55/ in the
 same html:form. When the text field has focus and I press enter the
 LookupDispatchAction does not work.This because the execute method of
 LookupDispatchAction does not receive any value in the parameter
 actionType. Is this a trap, that LookupDispatchAction cannot handle this
 particular case?

 Best regards

 Lasse




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



Re: LookupDispatchAction vs Unicode-utf8

2003-08-28 Thread Jason Lea
Maurice Wijtten wrote:
I have a multilangual form handled by a LookupDispatchAction. When we 
recently
added a spanish language, our action throwed an exception because it 
could not find
the corresponding key of the submit button. It seemed that a non asci 
character was
handled as UTF8 and not Unicode. (Instead of 1 character, 2 are posted).
I've done my homework but found nothing covering this usue yet.
For your information, i have the page encoding set on utf-8  in the jsp.

Maurice Wijtten



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

The page is probably rendered as UTF-8, but when the servlet reads the 
request parameters it will assume they are the Latin encoding.  You need 
to set the encoding on the request before the parameters are read by struts.

I have a filter that does this:

  request.setCharacterEncoding(UTF-8);

on every request.

Look at 7 here:
http://www.anassina.com/struts/i18n/i18n.html
--
Jason Lea
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: LookupDispatchAction error

2003-08-14 Thread Wendy Smoak
Colm wrote:
 I am getting the following error on , which I can't figure out:
 HTTP ERROR: 500 Request[/test] does not contain handler parameter named
updateMethod RequestURI=/clientdb/test.do

If you're getting to that Action with a link, the link should include:
?updateMethod=something at the end.  (Plus whatever other parameters you
need, perhaps a record ID or something else.)  The 'something' should match
the value of one of the properties you defined in getKeyMethodMap() so that
the framework can figure out which method in the LDA to call.

I don't use html:link but I'm sure there's a way to add parameters to the
links.

LDA has an 'unspecified' method which gets called when the value of
'updateMethod' doesn't match anything in getKeyMethodMap().  I think
unspecified should also be called in this case, so you can provide a default
behavior if the parameter is missing.  I *thought* that was under discussion
on struts-dev at one point.  What version of Struts are you using?

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 


RE: LookupDispatchAction error

2003-08-14 Thread Bailey, Shane C.


Yes, you can do it without the .do and it is safer to do so.

You can even do this which is nice:

html:link action=/test?updateMethod=nameOfYourDispatchLookup
...
/html:link

Note the /test? instead of /test.do? 


I remember looking at the source code before and the URL comes in in pieces
so that the query string is separate from the path and so struts
automatically puts on the filter (.do or whatever it may be).




-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 12:07 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction error



Sorry, solution #1 should read:
html:link action=/test.do ... ... /html:link

Not sure if you need the .do part but I do and that can be bad if you change
the extension later.  So if you can do it with just action=/test then I
suggest to do it.  I will look at mine now to see if I can change it.




-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 12:01 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction error



I think you could do it a couple different ways...

1. 
JSP:
bean:define id=lookupName value=whateverLookupYouWantToGoto/
html:link forward=test paramId=updateMethod paramName=lookupName 
...
/html:link

2. 
JSP:
html:link forward=gtest .../html:link

struts config:
  global-forwards
  forward   name=gtest
  path=/test.do?updateMethod=whateverLookupYouWantToGoTo/
  /global-forwards


I've done similar so either way should work.



-Original Message-
From: OFlaherty, Colm [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 11:35 AM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction error

I am getting the following error on , which I can't figure out:

HTTP ERROR: 500 Request[/test] does not contain handler parameter named
updateMethod
RequestURI=/clientdb/test.do


I am following a couple of decent examples using the LookupDispatchAction
class (pages 128 -130 in Programming Jakarta Struts by Chuck Cavaness). My
config is basically the same as what he has, but I have a couple of minor
differences, which I don't think should be causing any issues, but maybe
someone can put me right: 

The JSP link that gives me the error is the following: 

trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr

My action mappings section has the following action:


action-mappings
action path=/test
type=com.kbcam.core.struts.action.TestUpdateAction 
name=testForm 
scope=request 
input=/pages/test.jsp 
parameter=updateMethod

/action
...
/action-mappings



I also have a section for the testForm: 


form-beans
form-bean  name=testForm
type=com.kbcam.core.struts.form.TestForm/
...
/form-beans


My /pages/test.jsp uses a template, which points at /pages/testcontent.jsp,
which contains the following: 


html:submit property=updateMethod
bean:message key=insert.label/
/html:submit


As u would expect, the insert.label key is contained in the properties
file (as well as the test.maintain.label  from the initial link)


insert.label=Insert
test.maintain.label=Maintain Tests



My TestUpdateAction class has the following hierarchy and methods



LookupDispatchAction
  |
BaseLookupDispatchAction
  |
BaseUpdateAction (methods: getKeyMethodMap (),getKeyMethodMap (params),
insert (params), update (params), delete ()
  (Maps insert.label to insert)
  |
TestUpdateAction


My TestForm was generated using Xdoclet from the Test.java source code, and
has a protected updateMethod string variable, with a getter and setter.
TestForm is inherited from ActionForm


The kind of thing that I'm thinking might be causing the issue include: 

1.  The hierarchy of TestUpdateAction
2.  The fact that /pages/testcontent.jsp is not referenced directly, but
via the following lines in /pages/test.jsp: 
template:insert template='/pages/template.jsp'
template:put name='content' content='/pages/testcontent.jsp'/ ...
3.  The calling link does NOT in a Form.  Its entire contents looks like
this: 

%@ include file=/tags/taglibs.jsp %
center
hr
table border=0 cellspacing=0 cellpadding=0
trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr
trtdlihtml:link forward=logoutbean:message
key=logout.label//html:link/li/td/tr
/table
/center


Can anyone see anything I'm missing, or anything that I'm just doing
incorrectly?  Any help is much appreciated.

Colm


**
This message is sent in confidence for the addressee
only.  The contents are not allowed to be disclosed to
anyone other than the addressee.  Unauthorised 
recipients must preserve this confidentiality and should 
please advise the sender immediately of any error

RE: LookupDispatchAction

2003-08-14 Thread Wendy Smoak
Nalini wrote:
 Alongside the 'school address' field I have a submit button, 'Find School'
that allows a user to enter part of the
 school name or address and hit this 'FindSchool' button which then goes
off to another page (selectSchool.jsp) 
 that displays a list of matching schools.  The user then clicks on their
chosen school on selectSchool.jsp and is 
 then returned to the RegisterForm with the 'school name' and 'school
address' fields populated. 
 
I have exactly this flow in my own webapp, with the added complication that
the Find School part is used from multiple other forms.
 
I use LDA for the editWhatever actions (Registration, in your case).  Then I
cheat by sticking the name of the editWhatever action into the session
or request so I can use it to construct the Go back where you came from
ActionForward.
 
My biggest problem was that there is no go back where you came from
inherent in the framework-- everything is forward-looking, do this, then go
forward to one of many places.
 
-- 
Wendy Smoak
Arizona State University

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

Re: LookupDispatchAction

2003-08-14 Thread Jing Zhou

- Original Message - 
From: Wendy Smoak [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, August 11, 2003 10:49 AM
Subject: RE: LookupDispatchAction


 Nalini wrote:
  Alongside the 'school address' field I have a submit button, 'Find
School'
 that allows a user to enter part of the
  school name or address and hit this 'FindSchool' button which then goes
 off to another page (selectSchool.jsp)
  that displays a list of matching schools.  The user then clicks on their
 chosen school on selectSchool.jsp and is
  then returned to the RegisterForm with the 'school name' and 'school
 address' fields populated.

 I have exactly this flow in my own webapp, with the added complication
that
 the Find School part is used from multiple other forms.

 I use LDA for the editWhatever actions (Registration, in your case).  Then
I
 cheat by sticking the name of the editWhatever action into the session
 or request so I can use it to construct the Go back where you came from
 ActionForward.

 My biggest problem was that there is no go back where you came from
 inherent in the framework-- everything is forward-looking, do this, then
go
 forward to one of many places.

Yes. That is a recognized issue in Struts. I have discussed this issue
sometime
ago. A *fix* to the problem is to use the *.do in the input attribute
of the action mapping, something like the following one:

 action
 path=/FooCRUDOperation
 type=com.myco.editors.FooAction
 name=FooForm
 scope=request
 input=/FooCRUDInput.do
 parameter=dispatchAction
 forward name=edit path=.editor.foo.Update/
 forward name=add   path=.editor.fooCreate/
 forward name=view   path=.editor.fooView/
 forward name=top   path=.editor.fooTop/
 /action

You have to write one additional class for the /FooCRUDInput.do
action mapping in which you forward according to the request
parameter dispatchAction.


 -- 
 Wendy Smoak
 Arizona State University



Jing
Netspread Carrier
http://www.netspread.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: LookupDispatchAction error

2003-08-14 Thread Bailey, Shane C.


I think you could do it a couple different ways...

1. 
JSP:
bean:define id=lookupName value=whateverLookupYouWantToGoto/
html:link forward=test paramId=updateMethod paramName=lookupName 
...
/html:link

2. 
JSP:
html:link forward=gtest .../html:link

struts config:
  global-forwards
  forward   name=gtest
  path=/test.do?updateMethod=whateverLookupYouWantToGoTo/
  /global-forwards


I've done similar so either way should work.



-Original Message-
From: OFlaherty, Colm [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 11:35 AM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction error

I am getting the following error on , which I can't figure out:

HTTP ERROR: 500 Request[/test] does not contain handler parameter named
updateMethod
RequestURI=/clientdb/test.do


I am following a couple of decent examples using the LookupDispatchAction
class (pages 128 -130 in Programming Jakarta Struts by Chuck Cavaness). My
config is basically the same as what he has, but I have a couple of minor
differences, which I don't think should be causing any issues, but maybe
someone can put me right: 

The JSP link that gives me the error is the following: 

trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr

My action mappings section has the following action:


action-mappings
action path=/test
type=com.kbcam.core.struts.action.TestUpdateAction 
name=testForm 
scope=request 
input=/pages/test.jsp 
parameter=updateMethod

/action
...
/action-mappings



I also have a section for the testForm: 


form-beans
form-bean  name=testForm
type=com.kbcam.core.struts.form.TestForm/
...
/form-beans


My /pages/test.jsp uses a template, which points at /pages/testcontent.jsp,
which contains the following: 


html:submit property=updateMethod
bean:message key=insert.label/
/html:submit


As u would expect, the insert.label key is contained in the properties
file (as well as the test.maintain.label  from the initial link)


insert.label=Insert
test.maintain.label=Maintain Tests



My TestUpdateAction class has the following hierarchy and methods



LookupDispatchAction
  |
BaseLookupDispatchAction
  |
BaseUpdateAction (methods: getKeyMethodMap (),getKeyMethodMap (params),
insert (params), update (params), delete ()
  (Maps insert.label to insert)
  |
TestUpdateAction


My TestForm was generated using Xdoclet from the Test.java source code, and
has a protected updateMethod string variable, with a getter and setter.
TestForm is inherited from ActionForm


The kind of thing that I'm thinking might be causing the issue include: 

1.  The hierarchy of TestUpdateAction
2.  The fact that /pages/testcontent.jsp is not referenced directly, but
via the following lines in /pages/test.jsp: 
template:insert template='/pages/template.jsp'
template:put name='content' content='/pages/testcontent.jsp'/ ...
3.  The calling link does NOT in a Form.  Its entire contents looks like
this: 

%@ include file=/tags/taglibs.jsp %
center
hr
table border=0 cellspacing=0 cellpadding=0
trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr
trtdlihtml:link forward=logoutbean:message
key=logout.label//html:link/li/td/tr
/table
/center


Can anyone see anything I'm missing, or anything that I'm just doing
incorrectly?  Any help is much appreciated.

Colm


**
This message is sent in confidence for the addressee
only.  The contents are not allowed to be disclosed to
anyone other than the addressee.  Unauthorised 
recipients must preserve this confidentiality and should 
please advise the sender immediately of any error in
transmission.
**


-
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: LookupDispatchAction error

2003-08-14 Thread Bailey, Shane C.


Sorry, solution #1 should read:
html:link action=/test.do ... ... /html:link

Not sure if you need the .do part but I do and that can be bad if you change
the extension later.  So if you can do it with just action=/test then I
suggest to do it.  I will look at mine now to see if I can change it.




-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 12:01 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction error



I think you could do it a couple different ways...

1. 
JSP:
bean:define id=lookupName value=whateverLookupYouWantToGoto/
html:link forward=test paramId=updateMethod paramName=lookupName 
...
/html:link

2. 
JSP:
html:link forward=gtest .../html:link

struts config:
  global-forwards
  forward   name=gtest
  path=/test.do?updateMethod=whateverLookupYouWantToGoTo/
  /global-forwards


I've done similar so either way should work.



-Original Message-
From: OFlaherty, Colm [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 11:35 AM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction error

I am getting the following error on , which I can't figure out:

HTTP ERROR: 500 Request[/test] does not contain handler parameter named
updateMethod
RequestURI=/clientdb/test.do


I am following a couple of decent examples using the LookupDispatchAction
class (pages 128 -130 in Programming Jakarta Struts by Chuck Cavaness). My
config is basically the same as what he has, but I have a couple of minor
differences, which I don't think should be causing any issues, but maybe
someone can put me right: 

The JSP link that gives me the error is the following: 

trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr

My action mappings section has the following action:


action-mappings
action path=/test
type=com.kbcam.core.struts.action.TestUpdateAction 
name=testForm 
scope=request 
input=/pages/test.jsp 
parameter=updateMethod

/action
...
/action-mappings



I also have a section for the testForm: 


form-beans
form-bean  name=testForm
type=com.kbcam.core.struts.form.TestForm/
...
/form-beans


My /pages/test.jsp uses a template, which points at /pages/testcontent.jsp,
which contains the following: 


html:submit property=updateMethod
bean:message key=insert.label/
/html:submit


As u would expect, the insert.label key is contained in the properties
file (as well as the test.maintain.label  from the initial link)


insert.label=Insert
test.maintain.label=Maintain Tests



My TestUpdateAction class has the following hierarchy and methods



LookupDispatchAction
  |
BaseLookupDispatchAction
  |
BaseUpdateAction (methods: getKeyMethodMap (),getKeyMethodMap (params),
insert (params), update (params), delete ()
  (Maps insert.label to insert)
  |
TestUpdateAction


My TestForm was generated using Xdoclet from the Test.java source code, and
has a protected updateMethod string variable, with a getter and setter.
TestForm is inherited from ActionForm


The kind of thing that I'm thinking might be causing the issue include: 

1.  The hierarchy of TestUpdateAction
2.  The fact that /pages/testcontent.jsp is not referenced directly, but
via the following lines in /pages/test.jsp: 
template:insert template='/pages/template.jsp'
template:put name='content' content='/pages/testcontent.jsp'/ ...
3.  The calling link does NOT in a Form.  Its entire contents looks like
this: 

%@ include file=/tags/taglibs.jsp %
center
hr
table border=0 cellspacing=0 cellpadding=0
trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr
trtdlihtml:link forward=logoutbean:message
key=logout.label//html:link/li/td/tr
/table
/center


Can anyone see anything I'm missing, or anything that I'm just doing
incorrectly?  Any help is much appreciated.

Colm


**
This message is sent in confidence for the addressee
only.  The contents are not allowed to be disclosed to
anyone other than the addressee.  Unauthorised 
recipients must preserve this confidentiality and should 
please advise the sender immediately of any error in
transmission.
**


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

2003-08-14 Thread Jing Zhou
The LookupDispatchAction allows you to specify several JSP pages or buttons
on
one page to use single action mapping to achieve CRUD operations. An example
of such action mapping would look like the following:

 action
 path=/FooCRUDOperation
 type=com.myco.editors.FooAction
 name=FooForm
 scope=request
 input=/FooCRUDInput.do
 parameter=dispatchAction
 forward name=edit path=.editor.foo.Update/
 forward name=add   path=.editor.fooCreate/
 forward name=view   path=.editor.fooView/
 forward name=top   path=.editor.fooTop/
 /action

If you need to find/add/delete/update schools for a system, it is worth
using the class. For
your case, a simple way would go like this:
1) Process the 'Find School' button in the first action and populate
the found schools into a form bean for the selectSchool.jsp. Then
forward to the selectSchool.jsp.
2) The form bean for the selectSchool.jsp should also hold user
selected school (name and address). In its action class, you copy the
selected school (name and address) to the first form bean's attributes.
Then you forward to the first JSP page (the first form bean should
be session scoped).

Would this work for you?

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


- Original Message - 
From: Nalini Pal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 11, 2003 9:15 AM
Subject: LookupDispatchAction


Not sure how best to set this up and indeed, if it is possible so any advice
would be appreciated.



I have a an ActionForm called RegisterForm where a new user to enter their
details (name, email, school name and school address) or an existing
registered user to edit these fields.



Alongside the 'school address' field I have a submit button, 'Find School'
that allows a user to enter part of the school name or address and hit this
'FindSchool' button which then goes off to another page (selectSchool.jsp)
that displays a list of matching schools.  The user then clicks on their
chosen school on selectSchool.jsp and is then returned to the RegisterForm
with the 'school name' and 'school address' fields populated.



I have been advised to use a LookupDispatchAction, as a JSP alternative to
Javascript. Has anyone used it and/ or have an example illustrating its use?



Many Thanks

Nalini


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



Re: LookupDispatchAction

2003-08-14 Thread Susan Bradeen
On 08/11/2003 10:15:14 AM Nalini Pal wrote:

 Not sure how best to set this up and indeed, if it is possible so any 
advice 
 would be appreciated.
 
 
 
 I have a an ActionForm called RegisterForm where a new user to enter 
their 
 details (name, email, school name and school address) or an existing 
registered 
 user to edit these fields.
 
 
 
 Alongside the 'school address' field I have a submit button, 'Find 
School' that 
 allows a user to enter part of the school name or address and hit this 
 'FindSchool' button which then goes off to another page 
(selectSchool.jsp) that 
 displays a list of matching schools.  The user then clicks on their 
chosen 
 school on selectSchool.jsp and is then returned to the RegisterForm with 
the 
 'school name' and 'school address' fields populated.
 
 
 
 I have been advised to use a LookupDispatchAction, as a JSP alternative 
to 
 Javascript. Has anyone used it and/ or have an example illustrating its 
use?
 
 

Ted Husted's Tip 3 helped me get started with LookupDispatchAction  ...
http://husted.com/struts/tips/index.html

Susan Bradeen

 
 Many Thanks
 
 Nalini

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



Re: LookupDispatchAction

2003-08-12 Thread Juan Alvarado
I would suggest you look at Ted Husted's tips on
http://www.husted.com

When you read the tip you should have an idea of how
to set your scenario up.


--- Nalini Pal [EMAIL PROTECTED] wrote:
 Not sure how best to set this up and indeed, if it
 is possible so any advice would be appreciated.
 
  
 
 I have a an ActionForm called RegisterForm where a
 new user to enter their details (name, email, school
 name and school address) or an existing registered
 user to edit these fields.
 
  
 
 Alongside the 'school address' field I have a submit
 button, 'Find School' that allows a user to enter
 part of the school name or address and hit this
 'FindSchool' button which then goes off to another
 page (selectSchool.jsp) that displays a list of
 matching schools.  The user then clicks on their
 chosen school on selectSchool.jsp and is then
 returned to the RegisterForm with the 'school name'
 and 'school address' fields populated. 
 
 
 
 I have been advised to use a LookupDispatchAction,
 as a JSP alternative to Javascript. Has anyone used
 it and/ or have an example illustrating its use? 
 
 
 
 Many Thanks 
 
 Nalini
 


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

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



Re: LookupDispatchAction

2003-08-11 Thread Pramod . P

The JSP

html:form action=/Add 

table width=100% border=0 cellspacing=0 cellpadding=2 class=graynoborder
tr
   td nowrap
 html:submit property=actionbean:message key=button.add//html:submit
 nbsp;nbsp;nbsp;
 html:submit property=actionbean:message key=button.cancel//html:submit
   /td
/tr
/table
/html:form

The Action

public class AddLookupAction extends LookupDispatchAction {

 /**
  * Constructor for AddLookupAction.
  */
 public AddLookupAction() {
  super();
 }


 protected Map getKeyMethodMap() {
  Map map = new HashMap();
  map.put(button.add, add);
  map.put(button.cancel, cancel);
  return map;
 }

 public ActionForward add(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {

  log.info(Enter AddLookupAction.add());

  /* your code */
  return mapping.findForward(add.success);
 }

 public ActionForward cancel(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {


  return mapping.findForward(cancel);
 }

}

Struts-config
 action
  path   = /Add
 type   = com.efunds.gov.admin.web.account.AddLookupAction
 name   = accountFormBean
 validate   = false
 parameter  = action
 scope  = session
   forward  name=add.success path=/success.do /
   forward  name=add.success path=/cancel.do /
  /action

Thanks,
Pramod




   
  
yan  
  
[EMAIL PROTECTED]   To: [EMAIL PROTECTED]   
   
rve.co.uk cc: 
  
   Subject: LookupDispatchAction   
  
08/11/2003 09:36 PM
  
Please respond to  
  
Struts Users  
  
Mailing List  
  
   
  
   
  




Has anyone got a working example of this so I can see the code and follow it through?  
if so, would
anyone be willing to post it to me direcly?

I have tried to locate resources online that take you through a worked example without 
any luck.

thanks in advance
yan

KickStartESolutions - Intelligent Web Services
[EMAIL PROTECTED]




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



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



RE: LookupDispatchAction

2003-08-11 Thread Shashank Dixit
HI Nalini

There is a fantastic example given in Programming Jakarta Struts from
Orielly.

Shashank S. Dixit
Software Analyst.
Datamatics Ltd.
Contact: 28291253 ext 146
Mobile: 9820930075

Be brave against all odds. Never give up.


-Original Message-
From: Nalini Pal [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 7:45 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction


Not sure how best to set this up and indeed, if it is possible so any advice
would be appreciated.



I have a an ActionForm called RegisterForm where a new user to enter their
details (name, email, school name and school address) or an existing
registered user to edit these fields.



Alongside the 'school address' field I have a submit button, 'Find School'
that allows a user to enter part of the school name or address and hit this
'FindSchool' button which then goes off to another page (selectSchool.jsp)
that displays a list of matching schools.  The user then clicks on their
chosen school on selectSchool.jsp and is then returned to the RegisterForm
with the 'school name' and 'school address' fields populated.



I have been advised to use a LookupDispatchAction, as a JSP alternative to
Javascript. Has anyone used it and/ or have an example illustrating its use?



Many Thanks

Nalini


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



Re: LookupDispatchAction error

2003-08-10 Thread OFlaherty, Colm
My thanks go to both Wendy and Shane on this one.  I found a third way to get around 
it, which is closest to my original intent: 

I pointed the global forward to the jsp page called test.jsp (instead of directly at 
the action!).  The jsp page then links correctly to the action using html:link, once 
I have something like the following in the jsp: 

html:submit property=updateMethod
bean:message key=delete.label/
/html:submit

et Voilà, it works!

Colm
-Original Message-
From:   Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent:   06 August 2003 17:26
To: 'Struts Users Mailing List'
Subject:RE: LookupDispatchAction error



Yes, you can do it without the .do and it is safer to do so.
You can even do this which is nice:
html:link action=/test?updateMethod=nameOfYourDispatchLookup
...
/html:link
Note the /test? instead of /test.do? 

I remember looking at the source code before and the URL comes in in pieces so that 
the query string is separate from the path and so struts automatically puts on the 
filter (.do or whatever it may be).



-Original Message-
From:   Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, August 06, 2003 12:07 PM
To: 'Struts Users Mailing List'
Subject:RE: LookupDispatchAction error



Sorry, solution #1 should read:
html:link action=/test.do ... ... /html:link
Not sure if you need the .do part but I do and that can be bad if you change the 
extension later.  So if you can do it with just action=/test then I suggest to do 
it.  I will look at mine now to see if I can change it.



-Original Message-
From:   Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, August 06, 2003 12:01 PM
To: 'Struts Users Mailing List'
Subject:RE: LookupDispatchAction error



I think you could do it a couple different ways...
1.  
JSP:
bean:define id=lookupName value=whateverLookupYouWantToGoto/
html:link forward=test paramId=updateMethod paramName=lookupName 
...
/html:link
2.  
JSP:
html:link forward=gtest .../html:link
struts config:
global-forwards
forward   name=gtest
path=/test.do?updateMethod=whateverLookupYouWantToGoTo/
/global-forwards

I've done similar so either way should work.


-Original Message-
From:   OFlaherty, Colm [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, August 06, 2003 11:35 AM
To: [EMAIL PROTECTED]
Subject:LookupDispatchAction error

I am getting the following error on , which I can't figure out:
HTTP ERROR: 500 Request[/test] does not contain handler parameter named
updateMethod
RequestURI=/clientdb/test.do


I am following a couple of decent examples using the LookupDispatchAction class (pages 
128 -130 in Programming Jakarta Struts by Chuck Cavaness). My config is basically 
the same as what he has, but I have a couple of minor differences, which I don't think 
should be causing any issues, but maybe someone can put me right: 
The JSP link that gives me the error is the following: 
trtdlihtml:link forward=testbean:message
key=test.maintain.label//html:link/li/td/tr
My action mappings section has the following action:

action-mappings
action path=/test
type=com.kbcam.core.struts.action.TestUpdateAction 
name=testForm 
scope=request 
input=/pages/test.jsp 
parameter=updateMethod

/action
...
/action-mappings


I also have a section for the testForm: 

form-beans
form-bean  name=testForm
type=com.kbcam.core.struts.form.TestForm/
...
/form-beans

My /pages/test.jsp uses a template, which points at /pages/testcontent.jsp, which 
contains the following: 

html:submit property=updateMethod
bean:message key=insert.label/
/html:submit


As u would expect, the insert.label key is contained in the properties file (as well 
as the test.maintain.label  from the initial link)

insert.label=Insert
test.maintain.label=Maintain Tests



My TestUpdateAction class has the following hierarchy and methods


LookupDispatchAction
  |
BaseLookupDispatchAction
  |
BaseUpdateAction (methods: getKeyMethodMap (),getKeyMethodMap (params), insert 
(params), update (params), delete ()
(Maps insert.label to insert)
  |
TestUpdateAction

My TestForm was generated using Xdoclet from the Test.java source code, and has a 
protected updateMethod string variable, with a getter and setter.
TestForm is inherited from ActionForm

The kind of thing that I'm thinking might be causing the issue include: 
1.  The hierarchy of TestUpdateAction
2.  The fact that /pages/testcontent.jsp is not referenced directly, but via the 
following lines in /pages/test.jsp: 
template:insert template='/pages/template.jsp'
template:put name='content' content='/pages/testcontent.jsp'/ ...
3.  The calling link does NOT in a Form.  Its entire contents looks like this: 

%@ include file=/tags/taglibs.jsp %
center
hr
table border=0 cellspacing=0 cellpadding=0
trtdlihtml:link forward

Re: LookupDispatchAction problem

2003-07-23 Thread Rick Reumann
On Wed, Jul 23,'03 (03:44 PM GMT-0400), Tim wrote: 

 I am getting the following exception:
 
 SupportOrgDispatchAction] does not contain handler parameter named
 method
 
 For this actionmapping:
 
 action path=/SupportOrgDispatchAction
  
 type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatc
 hAc tion
name=SupportOrgForm parameter=method
 forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
 /action
 
 against these tags in my jsp:
 
 html:submit property=method value=Query 
 bean:message key=button.selectOrgs
 /html:submit
 
 This is my first crack at subclassing the LookupDispatchAction. Any
 ideas as to what I am doing wrong are greatly appreciated. Thanks.


Are you sure you are passing in the form variable called method ? 
Make sure on the form that submits you have at the least a hidden
variable called method ie..

html:hidden property=method value=updateOrWhatever/

and then of course make sure the associated form has get/sets for
method

(side note: I like to use the parameter name dispatch instead of
method, although on my little tutorials I used the parameter
methodToCall thinking that would help give the idea of what's going
on, but that was probably more confusing).

-- 
Rick




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



Re: LookupDispatchAction problem

2003-07-23 Thread Aleksander . Matijara
Hi Tim,

I am not super-experienced in this, but it seems to me, that your line:

html:submit property=method value=Query 

should actualy be:

html:submit property=method value=some.key.value

and then, in your .properties file for internationalization etc.

some.key.value=   Query 


and then in your class that extends LookupDispatchAction extended class, 
you need to implement
the

 protected Map getKeyMethodMap() {
  Map map = new HashMap();
  map.put(some.key.value, doit);
  return map;
  }

  public ActionForward doit(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {
  // do add
  return mapping.findForward(success);
  }

Hope this helps... 

Regards, Aleksandar Matijaca





Tim Clotworthy [EMAIL PROTECTED]
23/07/2003 03:44 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:LookupDispatchAction problem


I am getting the following exception:

SupportOrgDispatchAction] does not contain handler parameter named
method

For this actionmapping:

action path=/SupportOrgDispatchAction
 
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion
   name=SupportOrgForm parameter=method
forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
/action

against these tags in my jsp:

html:submit property=method value=Query 
bean:message key=button.selectOrgs
/html:submit

This is my first crack at subclassing the LookupDispatchAction. Any
ideas as to what I am doing wrong are greatly appreciated. Thanks.




RE: LookupDispatchAction problem

2003-07-23 Thread Suzette Daniel
With LookupDispatch you don't have to use a hidden tag. I think the problem
might be in your action itself. Look at Ted's
tip(http://husted.com/struts/tips/003.html) and below is a working sample.

JSP:
html:submit property=method
titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit

Struts-config:
..
action path=/doOrderVerification name=monitorInfoForm
input=/pages/verifyorder.jsp parameter=method
type=com.waca.nec.consumer.actions.StoreProductDispatchAction
scope=session
  forward name=dontsaveproduct path=/pages/choosemonitor.jsp/
  forward name=add path=/pages/choosemonitor.jsp/
  forward name=checkout path=/pages/contactinfo.jsp/
/action


ACTION:
public class StoreProductDispatchAction extends LookupDispatchAction  {

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(button.add, AppConstants.ACTION_KEY_ADD);
map.put(button.checkout,
AppConstants.ACTION_KEY_CHECK_OUT);
map.put(button.continue.shopping,
AppConstants.ACTION_KEY_DONT_SAVE);
return map;
}

public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException {
//DO STUFF
return mapping.findForward(AppConstants.ACTION_KEY_ADD);
}

public ActionForward checkout(ActionMapping mapping, ActionForm
form, HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException {
//DO STUFF
return
mapping.findForward(AppConstants.ACTION_KEY_CHECK_OUT);
}

public ActionForward dontsaveproduct(ActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
//DO STUFF
return
mapping.findForward(AppConstants.ACTION_KEY_DONT_SAVE);
}

Suzette


-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 4:01 PM
To: Struts Users Mailing List
Subject: Re: LookupDispatchAction problem


On Wed, Jul 23,'03 (03:44 PM GMT-0400), Tim wrote: 

 I am getting the following exception:
 
 SupportOrgDispatchAction] does not contain handler parameter named 
 method
 
 For this actionmapping:
 
 action path=/SupportOrgDispatchAction
  
 type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatc
 hAc tion
name=SupportOrgForm parameter=method
 forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
 /action
 
 against these tags in my jsp:
 
 html:submit property=method value=Query 
 bean:message key=button.selectOrgs
 /html:submit
 
 This is my first crack at subclassing the LookupDispatchAction. Any 
 ideas as to what I am doing wrong are greatly appreciated. Thanks.


Are you sure you are passing in the form variable called method ? 
Make sure on the form that submits you have at the least a hidden variable
called method ie..

html:hidden property=method value=updateOrWhatever/

and then of course make sure the associated form has get/sets for method

(side note: I like to use the parameter name dispatch instead of method,
although on my little tutorials I used the parameter methodToCall thinking
that would help give the idea of what's going on, but that was probably more
confusing).

-- 
Rick




-
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: LookupDispatchAction problem

2003-07-23 Thread Rick Reumann
On Wed, Jul 23,'03 (04:03 PM GMT-0400), [EMAIL PROTECTED]
wrote: 
 
 I am not super-experienced in this, but it seems to me, that your
 line:
 
 html:submit property=method value=Query 

Oh sorry, I missed that... I doubt the above would ever work. The
method had to match an actual method in your DispatchAction. So
the value needs to be the name of the dispatch method. Even if the name
of your method was Query (not standard since methods should start with
capital letters), I'm not sure it would work with all those spaces
around it. (Personal preference is like to make my dispatch declaration
a hidden field vs using it as the property of the submit button, but it
will work as the submit button if labeled correctly).

-- 
Rick



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



Re: LookupDispatchAction problem

2003-07-23 Thread Rick Reumann
On Wed, Jul 23,'03 (04:19 PM GMT-0400), Suzette wrote: 

 With LookupDispatch you don't have to use a hidden tag. I think the
 problem might be in your action itself.  

Yea, I'll shut up now:) I forgot also Tim mentioned he wanted to use
LookupDispatchAction. I'm giving messed up advice answering too quickly.
Felt like avoiding work for a second by responding to an e-mail and now
I've made it all more confusing:) Sorry Tim.

-- 
Rick

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



RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
Thanks to all earnest responses. I still have a problem, but it has
evolved a little. I have simplified the syntax (using husted tip 003),
so that my jsp has:

html:submit
bean:message key=button.selectOrgs/
/html:submit

(as he suggested, using the default name of submit that corresponds to
the html:submit tag, and in my struts-config, I now have:

action path=/SupportOrgDispatchAction
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion name=SupportOrgForm parameter=submit
forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
/action

and in my action I have:

protected Map getKeyMethodMap() {

Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs); 
return map;
}


But alas, I am still getting an error (below). I wonder if my resource
bundled is not being read properly, because the button on the form
appears with the tag syntax bean:message key (obviously red flag
something is wrong), rather than the value from the properties file. How
can I check that the property button.selectOrgs is being found in the
resource bundle, or, for that matter, that the resource bundle is being
found at all?


Thanks so much to all.

javax.servlet.ServletException: Request[/SupportOrgDispatchAction] does
not contain handler parameter named submit
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:199)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:480)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)...blah...blah


 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:19 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 With LookupDispatch you don't have to use a hidden tag. I think the
 problem
 might be in your action itself. Look at Ted's
 tip(http://husted.com/struts/tips/003.html) and below is a working
sample.
 
 JSP:
   html:submit property=method
 titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit
 
 Struts-config:
   ..
 action path=/doOrderVerification name=monitorInfoForm
 input=/pages/verifyorder.jsp parameter=method
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
   forward name=dontsaveproduct
path=/pages/choosemonitor.jsp/
   forward name=add path=/pages/choosemonitor.jsp/
   forward name=checkout path=/pages/contactinfo.jsp/
 /action
   
 
 ACTION:
 public class StoreProductDispatchAction extends LookupDispatchAction
{
 
   protected Map getKeyMethodMap() {
   Map map = new HashMap();
   map.put(button.add, AppConstants.ACTION_KEY_ADD);
   map.put(button.checkout,
 AppConstants.ACTION_KEY_CHECK_OUT);
   map.put(button.continue.shopping,
 AppConstants.ACTION_KEY_DONT_SAVE);
   return map;
   }
 
   public ActionForward add(ActionMapping mapping, ActionForm form,
 HttpServletRequest request, HttpServletResponse response) throws
 IOException, ServletException {
   //DO STUFF
   return mapping.findForward(AppConstants.ACTION_KEY_ADD);
   }
 
   public ActionForward checkout(ActionMapping mapping, ActionForm
 form, HttpServletRequest request, HttpServletResponse response) throws
 IOException, ServletException {
   //DO STUFF
   return
 mapping.findForward(AppConstants.ACTION_KEY_CHECK_OUT);
   }
 
   public ActionForward dontsaveproduct(ActionMapping mapping,
 ActionForm form, HttpServletRequest request, HttpServletResponse
response)
 throws IOException, ServletException {
   //DO STUFF
   return
 mapping.findForward(AppConstants.ACTION_KEY_DONT_SAVE);
   }
 
 Suzette
 
 
 -Original Message-
 From: Rick Reumann [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:01 PM
 To: Struts Users Mailing List
 Subject: Re: LookupDispatchAction problem
 
 
 On Wed, Jul 23,'03 (03:44 PM GMT-0400), Tim wrote:
 
  I am getting the following exception:
 
  SupportOrgDispatchAction] does not contain handler parameter named
  method
 
  For this actionmapping:
 
  action path=/SupportOrgDispatchAction
 
 
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatc
  hAc tion
 name=SupportOrgForm parameter

RE: LookupDispatchAction problem

2003-07-23 Thread Suzette Daniel
I received the same error, so I switched to using my own property method
and if fixed that error.

JSP:
html:submit property=method 
 titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit

 Struts-config:
   ..
 action path=/doOrderVerification name=monitorInfoForm 
 input=/pages/verifyorder.jsp parameter=method 
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session

Suzette

-Original Message-
From: Tim Clotworthy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 4:40 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem


Thanks to all earnest responses. I still have a problem, but it has evolved
a little. I have simplified the syntax (using husted tip 003), so that my
jsp has:

html:submit
bean:message key=button.selectOrgs/
/html:submit

(as he suggested, using the default name of submit that corresponds to the
html:submit tag, and in my struts-config, I now have:

action path=/SupportOrgDispatchAction
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion name=SupportOrgForm parameter=submit
forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
/action

and in my action I have:

protected Map getKeyMethodMap() {

Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs); 
return map;
}


But alas, I am still getting an error (below). I wonder if my resource
bundled is not being read properly, because the button on the form appears
with the tag syntax bean:message key (obviously red flag something is
wrong), rather than the value from the properties file. How can I check that
the property button.selectOrgs is being found in the resource bundle, or,
for that matter, that the resource bundle is being found at all?


Thanks so much to all.

javax.servlet.ServletException: Request[/SupportOrgDispatchAction] does not
contain handler parameter named submit
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:199)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:480)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)...blah...blah


 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:19 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 With LookupDispatch you don't have to use a hidden tag. I think the 
 problem might be in your action itself. Look at Ted's
 tip(http://husted.com/struts/tips/003.html) and below is a working
sample.
 
 JSP:
   html:submit property=method 
 titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit
 
 Struts-config:
   ..
 action path=/doOrderVerification name=monitorInfoForm 
 input=/pages/verifyorder.jsp parameter=method 
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
   forward name=dontsaveproduct
path=/pages/choosemonitor.jsp/
   forward name=add path=/pages/choosemonitor.jsp/
   forward name=checkout path=/pages/contactinfo.jsp/
 /action
   
 
 ACTION:
 public class StoreProductDispatchAction extends LookupDispatchAction
{
 
   protected Map getKeyMethodMap() {
   Map map = new HashMap();
   map.put(button.add, AppConstants.ACTION_KEY_ADD);
   map.put(button.checkout,
AppConstants.ACTION_KEY_CHECK_OUT);
   map.put(button.continue.shopping,
 AppConstants.ACTION_KEY_DONT_SAVE);
   return map;
   }
 
   public ActionForward add(ActionMapping mapping, ActionForm form, 
 HttpServletRequest request, HttpServletResponse response) throws 
 IOException, ServletException {
   //DO STUFF
   return mapping.findForward(AppConstants.ACTION_KEY_ADD);
   }
 
   public ActionForward checkout(ActionMapping mapping, ActionForm
form, 
 HttpServletRequest request, HttpServletResponse response) throws 
 IOException, ServletException {
   //DO STUFF
   return
mapping.findForward(AppConstants.ACTION_KEY_CHECK_OUT);
   }
 
   public ActionForward dontsaveproduct(ActionMapping mapping, 
 ActionForm form, HttpServletRequest request, HttpServletResponse
response)
 throws IOException, ServletException

RE: LookupDispatchAction problem

2003-07-23 Thread Aleksander . Matijara
So, try creating a method called submit where the signature of the method 
would match the signature (parameters, return value etc) of

selectOrgs

Regards, Aleksandar.






Tim Clotworthy [EMAIL PROTECTED]
23/07/2003 04:39 PM
Please respond to Struts Users Mailing List

 
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
cc: 
Subject:RE: LookupDispatchAction problem


Thanks to all earnest responses. I still have a problem, but it has
evolved a little. I have simplified the syntax (using husted tip 003),
so that my jsp has:

html:submit
bean:message key=button.selectOrgs/
/html:submit

(as he suggested, using the default name of submit that corresponds to
the html:submit tag, and in my struts-config, I now have:

action path=/SupportOrgDispatchAction
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion name=SupportOrgForm parameter=submit
forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
/action

and in my action I have:

protected Map getKeyMethodMap() {
 
Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs); 
return map;
}


But alas, I am still getting an error (below). I wonder if my resource
bundled is not being read properly, because the button on the form
appears with the tag syntax bean:message key (obviously red flag
something is wrong), rather than the value from the properties file. How
can I check that the property button.selectOrgs is being found in the
resource bundle, or, for that matter, that the resource bundle is being
found at all?


Thanks so much to all.

javax.servlet.ServletException: Request[/SupportOrgDispatchAction] does
not contain handler parameter named submit
 at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:199)
 at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:480)
 at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
 at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)...blah...blah


 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:19 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 With LookupDispatch you don't have to use a hidden tag. I think the
 problem
 might be in your action itself. Look at Ted's
 tip(http://husted.com/struts/tips/003.html) and below is a working
sample.
 
 JSP:
html:submit property=method
 titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit
 
 Struts-config:
..
 action path=/doOrderVerification name=monitorInfoForm
 input=/pages/verifyorder.jsp parameter=method
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
   forward name=dontsaveproduct
path=/pages/choosemonitor.jsp/
   forward name=add path=/pages/choosemonitor.jsp/
   forward name=checkout path=/pages/contactinfo.jsp/
 /action

 
 ACTION:
 public class StoreProductDispatchAction extends LookupDispatchAction
{
 
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(button.add, 
AppConstants.ACTION_KEY_ADD);
map.put(button.checkout,
 AppConstants.ACTION_KEY_CHECK_OUT);
map.put(button.continue.shopping,
 AppConstants.ACTION_KEY_DONT_SAVE);
return map;
}
 
public ActionForward add(ActionMapping mapping, 
ActionForm form,
 HttpServletRequest request, HttpServletResponse response) throws
 IOException, ServletException {
//DO STUFF
return 
mapping.findForward(AppConstants.ACTION_KEY_ADD);
}
 
public ActionForward checkout(ActionMapping mapping, 
ActionForm
 form, HttpServletRequest request, HttpServletResponse response) throws
 IOException, ServletException {
//DO STUFF
return
 mapping.findForward(AppConstants.ACTION_KEY_CHECK_OUT);
}
 
public ActionForward dontsaveproduct(ActionMapping 
mapping,
 ActionForm form, HttpServletRequest request, HttpServletResponse

RE: LookupDispatchAction problem

2003-07-23 Thread Aleksander . Matijara
Yes, that makes sense,  the property should have the method (if method 
is a parameter passed in struts-config.xml action)
and the value of method should be the name of the method inside the 
action...

html:submit property=method value=myfunction/

and then

 public ActionForward myfunction(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {
  // do add

I think that's how it is supposed to work...

Regards, a.m.






Suzette Daniel [EMAIL PROTECTED]
23/07/2003 04:43 PM
Please respond to Struts Users Mailing List

 
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
cc: 
Subject:RE: LookupDispatchAction problem


I received the same error, so I switched to using my own property method
and if fixed that error.

JSP:
 html:submit property=method 
 titleKey=verify.order.add.another.button.title
 bean:message key=button.add /
 /html:submit

 Struts-config:
..
 action path=/doOrderVerification name=monitorInfoForm 
 input=/pages/verifyorder.jsp parameter=method 
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session

Suzette

-Original Message-
From: Tim Clotworthy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 4:40 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem


Thanks to all earnest responses. I still have a problem, but it has 
evolved
a little. I have simplified the syntax (using husted tip 003), so that my
jsp has:

html:submit
bean:message key=button.selectOrgs/
/html:submit

(as he suggested, using the default name of submit that corresponds to the
html:submit tag, and in my struts-config, I now have:

action path=/SupportOrgDispatchAction
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion name=SupportOrgForm parameter=submit
forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
/action

and in my action I have:

protected Map getKeyMethodMap() {
 
Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs); 
return map;
}


But alas, I am still getting an error (below). I wonder if my resource
bundled is not being read properly, because the button on the form appears
with the tag syntax bean:message key (obviously red flag something is
wrong), rather than the value from the properties file. How can I check 
that
the property button.selectOrgs is being found in the resource bundle, or,
for that matter, that the resource bundle is being found at all?


Thanks so much to all.

javax.servlet.ServletException: Request[/SupportOrgDispatchAction] does 
not
contain handler parameter named submit
 at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:199)
 at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:480)
 at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
 at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)...blah...blah


 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:19 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 With LookupDispatch you don't have to use a hidden tag. I think the 
 problem might be in your action itself. Look at Ted's
 tip(http://husted.com/struts/tips/003.html) and below is a working
sample.
 
 JSP:
html:submit property=method 
 titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit
 
 Struts-config:
..
 action path=/doOrderVerification name=monitorInfoForm 
 input=/pages/verifyorder.jsp parameter=method 
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
   forward name=dontsaveproduct
path=/pages/choosemonitor.jsp/
   forward name=add path=/pages/choosemonitor.jsp/
   forward name=checkout path=/pages/contactinfo.jsp/
 /action

 
 ACTION:
 public class StoreProductDispatchAction extends LookupDispatchAction
{
 
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(button.add

RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
Thanks, but I switch it to method, and same error occurs. 

Again, I wonder if my problem is related to my resource bundle, not
being able to find it, etc. How can I simply diagnose that the tag
bean:message key=button.add / is being processed properly by the
ActionServlet (value being found, etc.). thanks. Sorry for this going
on-and-on. Who knew...



 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:43 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 I received the same error, so I switched to using my own property
method
 and if fixed that error.
 
 JSP:
   html:submit property=method
  titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit
 
  Struts-config:
  ..
  action path=/doOrderVerification name=monitorInfoForm
  input=/pages/verifyorder.jsp parameter=method
  type=com.waca.nec.consumer.actions.StoreProductDispatchAction
  scope=session
 
 Suzette
 
 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:40 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 
 Thanks to all earnest responses. I still have a problem, but it has
 evolved
 a little. I have simplified the syntax (using husted tip 003), so that
my
 jsp has:
 
 html:submit
 bean:message key=button.selectOrgs/
 /html:submit
 
 (as he suggested, using the default name of submit that corresponds to
the
 html:submit tag, and in my struts-config, I now have:
 
 action path=/SupportOrgDispatchAction

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
 tion name=SupportOrgForm parameter=submit
 forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
 /action
 
 and in my action I have:
 
 protected Map getKeyMethodMap() {
 
 Map map = new HashMap();
 map.put(button.selectOrgs, selectOrgs);
 return map;
 }
 
 
 But alas, I am still getting an error (below). I wonder if my resource
 bundled is not being read properly, because the button on the form
appears
 with the tag syntax bean:message key (obviously red flag something
is
 wrong), rather than the value from the properties file. How can I
check
 that
 the property button.selectOrgs is being found in the resource bundle,
or,
 for that matter, that the resource bundle is being found at all?
 
 
 Thanks so much to all.
 
 javax.servlet.ServletException: Request[/SupportOrgDispatchAction]
does
 not
 contain handler parameter named submit
   at

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
 ion.java:199)
   at

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
 ocessor.java:480)
   at

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
 274)
   at

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
   at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
 tionFilterChain.java:247)
   at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
 erChain.java:193)...blah...blah
 
 
  -Original Message-
  From: Suzette Daniel [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 4:19 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
 
  With LookupDispatch you don't have to use a hidden tag. I think the
  problem might be in your action itself. Look at Ted's
  tip(http://husted.com/struts/tips/003.html) and below is a working
 sample.
 
  JSP:
  html:submit property=method
  titleKey=verify.order.add.another.button.title
  bean:message key=button.add /
  /html:submit
 
  Struts-config:
  ..
  action path=/doOrderVerification name=monitorInfoForm
  input=/pages/verifyorder.jsp parameter=method
  type=com.waca.nec.consumer.actions.StoreProductDispatchAction
  scope=session
forward name=dontsaveproduct
 path=/pages/choosemonitor.jsp/
forward name=add path=/pages/choosemonitor.jsp/
forward name=checkout path=/pages/contactinfo.jsp/
  /action
  
 
  ACTION:
  public class StoreProductDispatchAction extends LookupDispatchAction
 {
  
  protected Map getKeyMethodMap() {
  Map map = new HashMap();
  map.put(button.add, AppConstants.ACTION_KEY_ADD);
  map.put(button.checkout,
 AppConstants.ACTION_KEY_CHECK_OUT);
  map.put(button.continue.shopping,
  AppConstants.ACTION_KEY_DONT_SAVE);
  return map;
  }
 
  public ActionForward add(ActionMapping mapping, ActionForm form,
  HttpServletRequest request, HttpServletResponse response) throws
  IOException, ServletException

RE: LookupDispatchAction problem

2003-07-23 Thread Suzette Daniel
No prob, here you go:

logic:notPresent name=org.apache.struts.action.MESSAGE
scope=application
ERROR:  Application resources not loaded -- check servlet container
logs for error messages.
/logic:notPresent

Suzette

-Original Message-
From: Tim Clotworthy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 5:00 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem


Thanks, but I switch it to method, and same error occurs. 

Again, I wonder if my problem is related to my resource bundle, not being
able to find it, etc. How can I simply diagnose that the tag bean:message
key=button.add / is being processed properly by the ActionServlet (value
being found, etc.). thanks. Sorry for this going on-and-on. Who knew...



 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:43 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 I received the same error, so I switched to using my own property
method
 and if fixed that error.
 
 JSP:
   html:submit property=method  
 titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit
 
  Struts-config:
  ..
  action path=/doOrderVerification name=monitorInfoForm 
  input=/pages/verifyorder.jsp parameter=method 
  type=com.waca.nec.consumer.actions.StoreProductDispatchAction
  scope=session
 
 Suzette
 
 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:40 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 
 Thanks to all earnest responses. I still have a problem, but it has 
 evolved a little. I have simplified the syntax (using husted tip 003), 
 so that
my
 jsp has:
 
 html:submit
 bean:message key=button.selectOrgs/
 /html:submit
 
 (as he suggested, using the default name of submit that corresponds to
the
 html:submit tag, and in my struts-config, I now have:
 
 action path=/SupportOrgDispatchAction

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
 tion name=SupportOrgForm parameter=submit
 forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
 /action
 
 and in my action I have:
 
 protected Map getKeyMethodMap() {
 
 Map map = new HashMap();
 map.put(button.selectOrgs, selectOrgs);
 return map;
 }
 
 
 But alas, I am still getting an error (below). I wonder if my resource 
 bundled is not being read properly, because the button on the form
appears
 with the tag syntax bean:message key (obviously red flag something
is
 wrong), rather than the value from the properties file. How can I
check
 that
 the property button.selectOrgs is being found in the resource bundle,
or,
 for that matter, that the resource bundle is being found at all?
 
 
 Thanks so much to all.
 
 javax.servlet.ServletException: Request[/SupportOrgDispatchAction]
does
 not
 contain handler parameter named submit
   at

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
 ion.java:199)
   at

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
 ocessor.java:480)
   at

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
 274)
   at

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
   at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
 tionFilterChain.java:247)
   at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
 erChain.java:193)...blah...blah
 
 
  -Original Message-
  From: Suzette Daniel [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 4:19 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
 
  With LookupDispatch you don't have to use a hidden tag. I think the 
  problem might be in your action itself. Look at Ted's
  tip(http://husted.com/struts/tips/003.html) and below is a working
 sample.
 
  JSP:
  html:submit property=method 
  titleKey=verify.order.add.another.button.title
  bean:message key=button.add /
  /html:submit
 
  Struts-config:
  ..
  action path=/doOrderVerification name=monitorInfoForm 
  input=/pages/verifyorder.jsp parameter=method 
  type=com.waca.nec.consumer.actions.StoreProductDispatchAction
  scope=session
forward name=dontsaveproduct
 path=/pages/choosemonitor.jsp/
forward name=add path=/pages/choosemonitor.jsp/
forward name=checkout path=/pages/contactinfo.jsp/
  /action
  
 
  ACTION:
  public class StoreProductDispatchAction extends LookupDispatchAction
 {
  
  protected Map getKeyMethodMap() {
  Map map = new HashMap

RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
Thanks for all help. It is fixed now. God bless you, one and all.

 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:01 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 No prob, here you go:
 
 logic:notPresent name=org.apache.struts.action.MESSAGE
 scope=application
 ERROR:  Application resources not loaded -- check servlet
container
 logs for error messages.
 /logic:notPresent
 
 Suzette
 
 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:00 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 
 Thanks, but I switch it to method, and same error occurs.
 
 Again, I wonder if my problem is related to my resource bundle, not
being
 able to find it, etc. How can I simply diagnose that the tag
bean:message
 key=button.add / is being processed properly by the ActionServlet
 (value
 being found, etc.). thanks. Sorry for this going on-and-on. Who
knew...
 
 
 
  -Original Message-
  From: Suzette Daniel [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 4:43 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
 
  I received the same error, so I switched to using my own property
 method
  and if fixed that error.
 
  JSP:
  html:submit property=method
  titleKey=verify.order.add.another.button.title
  bean:message key=button.add /
  /html:submit
 
   Struts-config:
 ..
   action path=/doOrderVerification name=monitorInfoForm
   input=/pages/verifyorder.jsp parameter=method
   type=com.waca.nec.consumer.actions.StoreProductDispatchAction
   scope=session
 
  Suzette
 
  -Original Message-
  From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 4:40 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
 
 
  Thanks to all earnest responses. I still have a problem, but it has
  evolved a little. I have simplified the syntax (using husted tip
003),
  so that
 my
  jsp has:
 
  html:submit
  bean:message key=button.selectOrgs/
  /html:submit
 
  (as he suggested, using the default name of submit that corresponds
to
 the
  html:submit tag, and in my struts-config, I now have:
 
  action path=/SupportOrgDispatchAction
 

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
  tion name=SupportOrgForm parameter=submit
  forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
  /action
 
  and in my action I have:
 
  protected Map getKeyMethodMap() {
 
  Map map = new HashMap();
  map.put(button.selectOrgs, selectOrgs);
  return map;
  }
 
 
  But alas, I am still getting an error (below). I wonder if my
resource
  bundled is not being read properly, because the button on the form
 appears
  with the tag syntax bean:message key (obviously red flag
something
 is
  wrong), rather than the value from the properties file. How can I
 check
  that
  the property button.selectOrgs is being found in the resource
bundle,
 or,
  for that matter, that the resource bundle is being found at all?
 
 
  Thanks so much to all.
 
  javax.servlet.ServletException: Request[/SupportOrgDispatchAction]
 does
  not
  contain handler parameter named submit
  at
 

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
  ion.java:199)
  at
 

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
  ocessor.java:480)
  at
 

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
  274)
  at
 

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
  at
 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
 

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
  tionFilterChain.java:247)
  at
 

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
  erChain.java:193)...blah...blah
 
 
   -Original Message-
   From: Suzette Daniel [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 4:19 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
   With LookupDispatch you don't have to use a hidden tag. I think
the
   problem might be in your action itself. Look at Ted's
   tip(http://husted.com/struts/tips/003.html) and below is a working
  sample.
  
   JSP:
 html:submit property=method
   titleKey=verify.order.add.another.button.title
 bean:message key=button.add /
 /html:submit
  
   Struts-config:
 ..
   action path=/doOrderVerification name=monitorInfoForm
   input=/pages/verifyorder.jsp parameter=method
   type=com.waca.nec.consumer.actions.StoreProductDispatchAction
   scope=session
 forward name=dontsaveproduct
  path

RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
This is really a simple aside, but is there a way to have the text
(label) of the button appear different that the value of the submit, and
if so, how does one do it? Thanks.

 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:07 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 Thanks for all help. It is fixed now. God bless you, one and all.
 
  -Original Message-
  From: Suzette Daniel [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 5:01 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
 
  No prob, here you go:
 
  logic:notPresent name=org.apache.struts.action.MESSAGE
  scope=application
  ERROR:  Application resources not loaded -- check servlet
 container
  logs for error messages.
  /logic:notPresent
 
  Suzette
 
  -Original Message-
  From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 5:00 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
 
 
  Thanks, but I switch it to method, and same error occurs.
 
  Again, I wonder if my problem is related to my resource bundle, not
 being
  able to find it, etc. How can I simply diagnose that the tag
 bean:message
  key=button.add / is being processed properly by the ActionServlet
  (value
  being found, etc.). thanks. Sorry for this going on-and-on. Who
 knew...
 
 
 
   -Original Message-
   From: Suzette Daniel [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 4:43 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
   I received the same error, so I switched to using my own property
  method
   and if fixed that error.
  
   JSP:
 html:submit property=method
   titleKey=verify.order.add.another.button.title
 bean:message key=button.add /
 /html:submit
  
Struts-config:
..
action path=/doOrderVerification name=monitorInfoForm
input=/pages/verifyorder.jsp parameter=method
type=com.waca.nec.consumer.actions.StoreProductDispatchAction
scope=session
  
   Suzette
  
   -Original Message-
   From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 4:40 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
  
   Thanks to all earnest responses. I still have a problem, but it
has
   evolved a little. I have simplified the syntax (using husted tip
 003),
   so that
  my
   jsp has:
  
   html:submit
   bean:message key=button.selectOrgs/
   /html:submit
  
   (as he suggested, using the default name of submit that
corresponds
 to
  the
   html:submit tag, and in my struts-config, I now have:
  
   action path=/SupportOrgDispatchAction
  
 

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
   tion name=SupportOrgForm parameter=submit
   forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
   /action
  
   and in my action I have:
  
   protected Map getKeyMethodMap() {
  
   Map map = new HashMap();
   map.put(button.selectOrgs, selectOrgs);
   return map;
   }
  
  
   But alas, I am still getting an error (below). I wonder if my
 resource
   bundled is not being read properly, because the button on the form
  appears
   with the tag syntax bean:message key (obviously red flag
 something
  is
   wrong), rather than the value from the properties file. How can I
  check
   that
   the property button.selectOrgs is being found in the resource
 bundle,
  or,
   for that matter, that the resource bundle is being found at all?
  
  
   Thanks so much to all.
  
   javax.servlet.ServletException: Request[/SupportOrgDispatchAction]
  does
   not
   contain handler parameter named submit
 at
  
 

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
   ion.java:199)
 at
  
 

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
   ocessor.java:480)
 at
  
 

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
   274)
 at
  
 

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
 at
  
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
  
 

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
   tionFilterChain.java:247)
 at
  
 

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
   erChain.java:193)...blah...blah
  
  
-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:19 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
With LookupDispatch you don't have to use a hidden tag. I think
 the
problem might be in your action itself. Look

RE: LookupDispatchAction problem

2003-07-23 Thread Michael Ruppin
Great question.  You don't, which is why I did my own
dispatch Action which works off the existence of a
parameters in the request, not their value.  In other
words, I made a different form property for each type
of submission, and I check which are non-null. 
Otherwise, you can't have two buttons with the same
label on a page, and translation of your messages
could cause methods to be unreachable.

There are other alternatives, if JavaScript is an
option for you.  For me, it is not.  Another
possibility is to have many HTML forms, one for each
submission, and put the method=foo into a hidden. 
This is not always possible, if you need nesting.

m

--- Tim Clotworthy [EMAIL PROTECTED] wrote:
 This is really a simple aside, but is there a way to
 have the text
 (label) of the button appear different that the
 value of the submit, and
 if so, how does one do it? Thanks.
 
  -Original Message-
  From: Tim Clotworthy
 [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 5:07 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
  
  Thanks for all help. It is fixed now. God bless
 you, one and all.
  
   -Original Message-
   From: Suzette Daniel [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 5:01 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
   No prob, here you go:
  
   logic:notPresent
 name=org.apache.struts.action.MESSAGE
   scope=application
   ERROR:  Application resources not loaded --
 check servlet
  container
   logs for error messages.
   /logic:notPresent
  
   Suzette
  
   -Original Message-
   From: Tim Clotworthy
 [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 5:00 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
  
   Thanks, but I switch it to method, and same
 error occurs.
  
   Again, I wonder if my problem is related to my
 resource bundle, not
  being
   able to find it, etc. How can I simply diagnose
 that the tag
  bean:message
   key=button.add / is being processed properly
 by the ActionServlet
   (value
   being found, etc.). thanks. Sorry for this going
 on-and-on. Who
  knew...
  
  
  
-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:43 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
I received the same error, so I switched to
 using my own property
   method
and if fixed that error.
   
JSP:
html:submit property=method
   
 titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit
   
 Struts-config:
   ..
 action path=/doOrderVerification
 name=monitorInfoForm
 input=/pages/verifyorder.jsp
 parameter=method


type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
   
Suzette
   
-Original Message-
From: Tim Clotworthy
 [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:40 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
   
Thanks to all earnest responses. I still have
 a problem, but it
 has
evolved a little. I have simplified the syntax
 (using husted tip
  003),
so that
   my
jsp has:
   
html:submit
bean:message key=button.selectOrgs/
/html:submit
   
(as he suggested, using the default name of
 submit that
 corresponds
  to
   the
html:submit tag, and in my struts-config, I
 now have:
   
action path=/SupportOrgDispatchAction
   
  
 

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion name=SupportOrgForm
 parameter=submit
forward name=NextPage
 path=/fes/jsp/FESSupportOrgTable.jsp/
/action
   
and in my action I have:
   
protected Map getKeyMethodMap() {
   
Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs);
return map;
}
   
   
But alas, I am still getting an error (below).
 I wonder if my
  resource
bundled is not being read properly, because
 the button on the form
   appears
with the tag syntax bean:message key
 (obviously red flag
  something
   is
wrong), rather than the value from the
 properties file. How can I
   check
that
the property button.selectOrgs is being found
 in the resource
  bundle,
   or,
for that matter, that the resource bundle is
 being found at all?
   
   
Thanks so much to all.
   
javax.servlet.ServletException:
 Request[/SupportOrgDispatchAction]
   does
not
contain handler parameter named submit
at
   
  
 

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:199)
at
   
  
 

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:480

RE: LookupDispatchAction problem

2003-07-23 Thread Suzette Daniel
You could try using an image button:

html:image property=method pageKey=image.submit /

In props file:
image.submit=/images/submit.gif

Suzette H. Daniel
Java Developer/Web dept
770 416.9222 ex: 5041



-Original Message-
From: Michael Ruppin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 5:53 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: LookupDispatchAction problem


Great question.  You don't, which is why I did my own
dispatch Action which works off the existence of a
parameters in the request, not their value.  In other
words, I made a different form property for each type
of submission, and I check which are non-null. 
Otherwise, you can't have two buttons with the same
label on a page, and translation of your messages
could cause methods to be unreachable.

There are other alternatives, if JavaScript is an
option for you.  For me, it is not.  Another
possibility is to have many HTML forms, one for each submission, and put the
method=foo into a hidden. 
This is not always possible, if you need nesting.

m

--- Tim Clotworthy [EMAIL PROTECTED] wrote:
 This is really a simple aside, but is there a way to
 have the text
 (label) of the button appear different that the
 value of the submit, and
 if so, how does one do it? Thanks.
 
  -Original Message-
  From: Tim Clotworthy
 [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 23, 2003 5:07 PM
  To: 'Struts Users Mailing List'
  Subject: RE: LookupDispatchAction problem
  
  Thanks for all help. It is fixed now. God bless
 you, one and all.
  
   -Original Message-
   From: Suzette Daniel [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 5:01 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
   No prob, here you go:
  
   logic:notPresent
 name=org.apache.struts.action.MESSAGE
   scope=application
   ERROR:  Application resources not loaded --
 check servlet
  container
   logs for error messages.
   /logic:notPresent
  
   Suzette
  
   -Original Message-
   From: Tim Clotworthy
 [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 5:00 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
  
   Thanks, but I switch it to method, and same
 error occurs.
  
   Again, I wonder if my problem is related to my
 resource bundle, not
  being
   able to find it, etc. How can I simply diagnose
 that the tag
  bean:message
   key=button.add / is being processed properly
 by the ActionServlet
   (value
   being found, etc.). thanks. Sorry for this going
 on-and-on. Who
  knew...
  
  
  
-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:43 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
I received the same error, so I switched to
 using my own property
   method
and if fixed that error.
   
JSP:
html:submit property=method
   
 titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit
   
 Struts-config:
   ..
 action path=/doOrderVerification
 name=monitorInfoForm
 input=/pages/verifyorder.jsp
 parameter=method


type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
   
Suzette
   
-Original Message-
From: Tim Clotworthy
 [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:40 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
   
Thanks to all earnest responses. I still have
 a problem, but it
 has
evolved a little. I have simplified the syntax
 (using husted tip
  003),
so that
   my
jsp has:
   
html:submit
bean:message key=button.selectOrgs/
/html:submit
   
(as he suggested, using the default name of
 submit that
 corresponds
  to
   the
html:submit tag, and in my struts-config, I
 now have:
   
action path=/SupportOrgDispatchAction
   
  
 

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
tion name=SupportOrgForm
 parameter=submit
forward name=NextPage
 path=/fes/jsp/FESSupportOrgTable.jsp/
/action
   
and in my action I have:
   
protected Map getKeyMethodMap() {
   
Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs);
return map;
}
   
   
But alas, I am still getting an error (below).
 I wonder if my
  resource
bundled is not being read properly, because
 the button on the form
   appears
with the tag syntax bean:message key
 (obviously red flag
  something
   is
wrong), rather than the value from the
 properties file. How can I
   check
that
the property button.selectOrgs is being found
 in the resource
  bundle,
   or,
for that matter, that the resource bundle is
 being found at all?
   
   
Thanks so much to all

Re: LookupDispatchAction problem

2003-07-23 Thread Jason Lea
Tim Clotworthy wrote:
This is really a simple aside, but is there a way to have the text
(label) of the button appear different that the value of the submit, and
if so, how does one do it? Thanks.
Yes and no.

The HTML 4.0.1 standard allows you to specify a button tag which does 
this but IE doesn't support it properly.  Mozilla supports it correctly 
though.  I have only checked with IE6 and Mozilla 1.3/1.4.

The button tag can even include different styles and images on the button eg

button name=method value=myValue type=submitthis is a 
bbutton/b, click me/button

Problems I found with IE's support of the button tag:
1. The default type should be 'submit' from the standard, but IE treats 
it as 'button' so it doesn't cause the form to submit.  Fixed by adding 
the type=submit to the tag

2. (the problem that stops me using it) If you have more than 1 button 
tag in your form all the button values will be included when the form 
submits - which makes it useless.

Eg if i have the following buttons:

button name=method value=update type=submitupdate me/button
button name=method value=delete type=submitdelete me/button
I click the 'update me' button, IE will submit the following values 
method=updatemethod=delete, when it should only send method=update.

check out the spec here:
http://www.w3.org/TR/html401/interact/forms.html#edef-BUTTON
--Jason Lea



-Original Message-
From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:07 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
Thanks for all help. It is fixed now. God bless you, one and all.


-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:01 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
No prob, here you go:

logic:notPresent name=org.apache.struts.action.MESSAGE
scope=application
   ERROR:  Application resources not loaded -- check servlet
container

   logs for error messages.
/logic:notPresent
Suzette

-Original Message-
From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:00 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
Thanks, but I switch it to method, and same error occurs.

Again, I wonder if my problem is related to my resource bundle, not
being

able to find it, etc. How can I simply diagnose that the tag
bean:message

key=button.add / is being processed properly by the ActionServlet
(value
being found, etc.). thanks. Sorry for this going on-and-on. Who
knew...



-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:43 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
I received the same error, so I switched to using my own property
method

and if fixed that error.

JSP:
html:submit property=method
titleKey=verify.order.add.another.button.title
bean:message key=button.add /
/html:submit
Struts-config:
..
   action path=/doOrderVerification name=monitorInfoForm
input=/pages/verifyorder.jsp parameter=method
type=com.waca.nec.consumer.actions.StoreProductDispatchAction
scope=session
Suzette

-Original Message-
From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 4:40 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
Thanks to all earnest responses. I still have a problem, but it
has

evolved a little. I have simplified the syntax (using husted tip
003),

so that
my

jsp has:

html:submit
bean:message key=button.selectOrgs/
/html:submit
(as he suggested, using the default name of submit that
corresponds

to

the

html:submit tag, and in my struts-config, I now have:

action path=/SupportOrgDispatchAction


type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc

tion name=SupportOrgForm parameter=submit
forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
/action
and in my action I have:

protected Map getKeyMethodMap() {

Map map = new HashMap();
map.put(button.selectOrgs, selectOrgs);
return map;
}
But alas, I am still getting an error (below). I wonder if my
resource

bundled is not being read properly, because the button on the form
appears

with the tag syntax bean:message key (obviously red flag
something

is

wrong), rather than the value from the properties file. How can I
check

that
the property button.selectOrgs is being found in the resource
bundle,

or,

for that matter, that the resource bundle is being found at all?

Thanks so much to all.

javax.servlet.ServletException: Request[/SupportOrgDispatchAction]
does

not
contain handler parameter named submit
at

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct

ion.java:199)
at

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr

ocessor.java:480)
at

org.apache.struts.action.RequestProcessor.process

RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
Thanks. 

 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 6:07 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 You could try using an image button:
 
 html:image property=method pageKey=image.submit /
 
 In props file:
 image.submit=/images/submit.gif
 
 Suzette H. Daniel
 Java Developer/Web dept
 770 416.9222 ex: 5041
 
 
 
 -Original Message-
 From: Michael Ruppin [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:53 PM
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: RE: LookupDispatchAction problem
 
 
 Great question.  You don't, which is why I did my own
 dispatch Action which works off the existence of a
 parameters in the request, not their value.  In other
 words, I made a different form property for each type
 of submission, and I check which are non-null.
 Otherwise, you can't have two buttons with the same
 label on a page, and translation of your messages
 could cause methods to be unreachable.
 
 There are other alternatives, if JavaScript is an
 option for you.  For me, it is not.  Another
 possibility is to have many HTML forms, one for each submission, and
put
 the
 method=foo into a hidden.
 This is not always possible, if you need nesting.
 
 m
 
 --- Tim Clotworthy [EMAIL PROTECTED] wrote:
  This is really a simple aside, but is there a way to
  have the text
  (label) of the button appear different that the
  value of the submit, and
  if so, how does one do it? Thanks.
 
   -Original Message-
   From: Tim Clotworthy
  [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 5:07 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
   Thanks for all help. It is fixed now. God bless
  you, one and all.
  
-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:01 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
No prob, here you go:
   
logic:notPresent
  name=org.apache.struts.action.MESSAGE
scope=application
ERROR:  Application resources not loaded --
  check servlet
   container
logs for error messages.
/logic:notPresent
   
Suzette
   
-Original Message-
From: Tim Clotworthy
  [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:00 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
   
Thanks, but I switch it to method, and same
  error occurs.
   
Again, I wonder if my problem is related to my
  resource bundle, not
   being
able to find it, etc. How can I simply diagnose
  that the tag
   bean:message
key=button.add / is being processed properly
  by the ActionServlet
(value
being found, etc.). thanks. Sorry for this going
  on-and-on. Who
   knew...
   
   
   
 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:43 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem

 I received the same error, so I switched to
  using my own property
method
 and if fixed that error.

 JSP:
   html:submit property=method

  titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit

  Struts-config:
  ..
  action path=/doOrderVerification
  name=monitorInfoForm
  input=/pages/verifyorder.jsp
  parameter=method
 
 
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
  scope=session

 Suzette

 -Original Message-
 From: Tim Clotworthy
  [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:40 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem


 Thanks to all earnest responses. I still have
  a problem, but it
  has
 evolved a little. I have simplified the syntax
  (using husted tip
   003),
 so that
my
 jsp has:

 html:submit
 bean:message key=button.selectOrgs/
 /html:submit

 (as he suggested, using the default name of
  submit that
  corresponds
   to
the
 html:submit tag, and in my struts-config, I
  now have:

 action path=/SupportOrgDispatchAction

   
  
 

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
 tion name=SupportOrgForm
  parameter=submit
 forward name=NextPage
  path=/fes/jsp/FESSupportOrgTable.jsp/
 /action

 and in my action I have:

 protected Map getKeyMethodMap() {

 Map map = new HashMap();
 map.put(button.selectOrgs, selectOrgs);
 return map;
 }


 But alas, I am still getting an error (below).
  I wonder if my
   resource
 bundled is not being read properly, because
  the button on the form
appears

RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
Ok. Thanks.

 -Original Message-
 From: Michael Ruppin [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:53 PM
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: RE: LookupDispatchAction problem
 
 Great question.  You don't, which is why I did my own
 dispatch Action which works off the existence of a
 parameters in the request, not their value.  In other
 words, I made a different form property for each type
 of submission, and I check which are non-null.
 Otherwise, you can't have two buttons with the same
 label on a page, and translation of your messages
 could cause methods to be unreachable.
 
 There are other alternatives, if JavaScript is an
 option for you.  For me, it is not.  Another
 possibility is to have many HTML forms, one for each
 submission, and put the method=foo into a hidden.
 This is not always possible, if you need nesting.
 
 m
 
 --- Tim Clotworthy [EMAIL PROTECTED] wrote:
  This is really a simple aside, but is there a way to
  have the text
  (label) of the button appear different that the
  value of the submit, and
  if so, how does one do it? Thanks.
 
   -Original Message-
   From: Tim Clotworthy
  [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 23, 2003 5:07 PM
   To: 'Struts Users Mailing List'
   Subject: RE: LookupDispatchAction problem
  
   Thanks for all help. It is fixed now. God bless
  you, one and all.
  
-Original Message-
From: Suzette Daniel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:01 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
No prob, here you go:
   
logic:notPresent
  name=org.apache.struts.action.MESSAGE
scope=application
ERROR:  Application resources not loaded --
  check servlet
   container
logs for error messages.
/logic:notPresent
   
Suzette
   
-Original Message-
From: Tim Clotworthy
  [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 5:00 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction problem
   
   
Thanks, but I switch it to method, and same
  error occurs.
   
Again, I wonder if my problem is related to my
  resource bundle, not
   being
able to find it, etc. How can I simply diagnose
  that the tag
   bean:message
key=button.add / is being processed properly
  by the ActionServlet
(value
being found, etc.). thanks. Sorry for this going
  on-and-on. Who
   knew...
   
   
   
 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:43 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem

 I received the same error, so I switched to
  using my own property
method
 and if fixed that error.

 JSP:
   html:submit property=method

  titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit

  Struts-config:
  ..
  action path=/doOrderVerification
  name=monitorInfoForm
  input=/pages/verifyorder.jsp
  parameter=method
 
 
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
  scope=session

 Suzette

 -Original Message-
 From: Tim Clotworthy
  [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:40 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem


 Thanks to all earnest responses. I still have
  a problem, but it
  has
 evolved a little. I have simplified the syntax
  (using husted tip
   003),
 so that
my
 jsp has:

 html:submit
 bean:message key=button.selectOrgs/
 /html:submit

 (as he suggested, using the default name of
  submit that
  corresponds
   to
the
 html:submit tag, and in my struts-config, I
  now have:

 action path=/SupportOrgDispatchAction

   
  
 

type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
 tion name=SupportOrgForm
  parameter=submit
 forward name=NextPage
  path=/fes/jsp/FESSupportOrgTable.jsp/
 /action

 and in my action I have:

 protected Map getKeyMethodMap() {

 Map map = new HashMap();
 map.put(button.selectOrgs, selectOrgs);
 return map;
 }


 But alas, I am still getting an error (below).
  I wonder if my
   resource
 bundled is not being read properly, because
  the button on the form
appears
 with the tag syntax bean:message key
  (obviously red flag
   something
is
 wrong), rather than the value from the
  properties file. How can I
check
 that
 the property button.selectOrgs is being found
  in the resource
   bundle,
or,
 for that matter, that the resource bundle is
  being found at all?


 Thanks so much to all.

 javax.servlet.ServletException

RE: LookupDispatchAction problem

2003-07-23 Thread Tim Clotworthy
thanks

 -Original Message-
 From: Jason Lea [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 6:14 PM
 To: Struts Users Mailing List
 Subject: Re: LookupDispatchAction problem
 
 Tim Clotworthy wrote:
  This is really a simple aside, but is there a way to have the text
  (label) of the button appear different that the value of the submit,
and
  if so, how does one do it? Thanks.
 
 Yes and no.
 
 The HTML 4.0.1 standard allows you to specify a button tag which
does
 this but IE doesn't support it properly.  Mozilla supports it
correctly
 though.  I have only checked with IE6 and Mozilla 1.3/1.4.
 
 The button tag can even include different styles and images on the
button
 eg
 
 button name=method value=myValue type=submitthis is a
 bbutton/b, click me/button
 
 Problems I found with IE's support of the button tag:
 1. The default type should be 'submit' from the standard, but IE
treats
 it as 'button' so it doesn't cause the form to submit.  Fixed by
adding
 the type=submit to the tag
 
 2. (the problem that stops me using it) If you have more than 1 button
 tag in your form all the button values will be included when the form
 submits - which makes it useless.
 
 Eg if i have the following buttons:
 
 button name=method value=update type=submitupdate me/button
 button name=method value=delete type=submitdelete me/button
 
 I click the 'update me' button, IE will submit the following values
 method=updatemethod=delete, when it should only send method=update.
 
 check out the spec here:
 http://www.w3.org/TR/html401/interact/forms.html#edef-BUTTON
 
 --Jason Lea
 
 
 
 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:07 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 Thanks for all help. It is fixed now. God bless you, one and all.
 
 
 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:01 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 No prob, here you go:
 
 logic:notPresent name=org.apache.struts.action.MESSAGE
 scope=application
 ERROR:  Application resources not loaded -- check servlet
 
 container
 
 logs for error messages.
 /logic:notPresent
 
 Suzette
 
 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 5:00 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 
 Thanks, but I switch it to method, and same error occurs.
 
 Again, I wonder if my problem is related to my resource bundle, not
 
 being
 
 able to find it, etc. How can I simply diagnose that the tag
 
 bean:message
 
 key=button.add / is being processed properly by the
ActionServlet
 (value
 being found, etc.). thanks. Sorry for this going on-and-on. Who
 
 knew...
 
 
 
 -Original Message-
 From: Suzette Daniel [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:43 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 I received the same error, so I switched to using my own property
 
 method
 
 and if fixed that error.
 
 JSP:
   html:submit property=method
 titleKey=verify.order.add.another.button.title
   bean:message key=button.add /
   /html:submit
 
 Struts-config:
  ..
 action path=/doOrderVerification name=monitorInfoForm
 input=/pages/verifyorder.jsp parameter=method
 type=com.waca.nec.consumer.actions.StoreProductDispatchAction
 scope=session
 
 Suzette
 
 -Original Message-
 From: Tim Clotworthy [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 4:40 PM
 To: 'Struts Users Mailing List'
 Subject: RE: LookupDispatchAction problem
 
 
 Thanks to all earnest responses. I still have a problem, but it
 
  has
 
 evolved a little. I have simplified the syntax (using husted tip
 
 003),
 
 so that
 
 my
 
 jsp has:
 
 html:submit
 bean:message key=button.selectOrgs/
 /html:submit
 
 (as he suggested, using the default name of submit that
 
  corresponds
 
 to
 
 the
 
 html:submit tag, and in my struts-config, I now have:
 
 action path=/SupportOrgDispatchAction
 
 
 
type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc
 
 tion name=SupportOrgForm parameter=submit
 forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/
 /action
 
 and in my action I have:
 
 protected Map getKeyMethodMap() {
 
 Map map = new HashMap();
 map.put(button.selectOrgs, selectOrgs);
 return map;
 }
 
 
 But alas, I am still getting an error (below). I wonder if my
 
 resource
 
 bundled is not being read properly, because the button on the form
 
 appears
 
 with the tag syntax bean:message key (obviously red flag
 
 something
 
 is
 
 wrong), rather than the value from the properties file. How can I
 
 check
 
 that
 the property button.selectOrgs is being found in the resource
 
 bundle,
 
 or,
 
 for that matter, that the resource bundle is being found at all

Re: LookupDispatchAction question part2

2003-06-26 Thread Jason Lea
Frances Aleah Z. de Guzman wrote:
i had posted a question i think 3 days ago about submitting a form to a 
LookupDispatchAction without hitting any button and still having a default 
value of the parameter handler. someone advised me (im sorry i forgot your 
name) that i should have a hidden property of my parameter name, so that 
eventhough i hit the enter button the submitted form will go to the method of 
the action corresponding to the default value of the parameter i specified. 
and it worked! but i have the same problem again with a little twistin my 
jsp i have a display of collection in a tabular form, and each record has a 
link going to an lookupdispatchaction that will edit its contents. i used 
html:link action=/holiday.do paramId=id paramName=holiday 
paramProperty=holidayId/, but everytime i click this link im having the 
same exception as before Request[/holiday] does not contain handler 
parameter named action. i put a hidden property of action eventhough i know 
that wont work coz link doesnt submit the form. how will i solve this?
You should be able to add the dispatch name to the action in the link tag:

html:link action=/holiday.do?action=edit paramId=id 
paramName=holiday paramProperty=holidayId/

I don't think you need the '.do' on the action either (the tag can match 
the correct action without it) so this should work:

html:link action=/holiday?action=edit paramId=id 
paramName=holiday paramProperty=holidayId/

Of course you might have trouble with this sort of link because the 
LookupDispatchAction will try to match the action parameter's value with 
a localised key.  I define two keys for each method eg

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(global.action.internal.list, list);
map.put(global.action.internal.edit, edit);
map.put(button.list, list);
map.put(button.edit, edit);
return map;
}
The global.action.internal.* keys are only defined in my 
application.properties file so I can create standard links like the one 
above.  The button.* keys are defined application.properties and also 
the other locales (eg application_ja.properties) so my buttons can show 
the localised name and still call the correct method.

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


Re: LookupDispatchAction question part2

2003-06-26 Thread Frances Aleah Z. de Guzman
im sorry but im having the same exception

On Thursday 26 June 2003 05:01 pm, Jason Lea wrote:
 Frances Aleah Z. de Guzman wrote:
  i had posted a question i think 3 days ago about submitting a form to a
  LookupDispatchAction without hitting any button and still having a
  default value of the parameter handler. someone advised me (im sorry i
  forgot your name) that i should have a hidden property of my parameter
  name, so that eventhough i hit the enter button the submitted form will
  go to the method of the action corresponding to the default value of the
  parameter i specified. and it worked! but i have the same problem again
  with a little twistin my jsp i have a display of collection in a
  tabular form, and each record has a link going to an lookupdispatchaction
  that will edit its contents. i used html:link action=/holiday.do
  paramId=id paramName=holiday paramProperty=holidayId/, but
  everytime i click this link im having the same exception as before
  Request[/holiday] does not contain handler parameter named action. i
  put a hidden property of action eventhough i know that wont work coz link
  doesnt submit the form. how will i solve this?

 You should be able to add the dispatch name to the action in the link tag:

 html:link action=/holiday.do?action=edit paramId=id
 paramName=holiday paramProperty=holidayId/

 I don't think you need the '.do' on the action either (the tag can match
 the correct action without it) so this should work:

 html:link action=/holiday?action=edit paramId=id
 paramName=holiday paramProperty=holidayId/

 Of course you might have trouble with this sort of link because the
 LookupDispatchAction will try to match the action parameter's value with
 a localised key.  I define two keys for each method eg

 protected Map getKeyMethodMap() {
  Map map = new HashMap();
  map.put(global.action.internal.list, list);
  map.put(global.action.internal.edit, edit);
  map.put(button.list, list);
  map.put(button.edit, edit);
  return map;
 }


 The global.action.internal.* keys are only defined in my
 application.properties file so I can create standard links like the one
 above.  The button.* keys are defined application.properties and also
 the other locales (eg application_ja.properties) so my buttons can show
 the localised name and still call the correct method.

-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



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



Re: LookupDispatchAction question part2

2003-06-26 Thread Jason Lea
Hi Frances,

Frances Aleah Z. de Guzman wrote:
im sorry but im having the same exception
What does your html:link tag look like?
What was the HTML output it produced?
What do you have in your getKeyMethodMap()?
What are the matching entries in your application.properties file?
If you post those things I might be able to help better...

--jason

On Thursday 26 June 2003 05:01 pm, Jason Lea wrote:

Frances Aleah Z. de Guzman wrote:

i had posted a question i think 3 days ago about submitting a form to a
LookupDispatchAction without hitting any button and still having a
default value of the parameter handler. someone advised me (im sorry i
forgot your name) that i should have a hidden property of my parameter
name, so that eventhough i hit the enter button the submitted form will
go to the method of the action corresponding to the default value of the
parameter i specified. and it worked! but i have the same problem again
with a little twistin my jsp i have a display of collection in a
tabular form, and each record has a link going to an lookupdispatchaction
that will edit its contents. i used html:link action=/holiday.do
paramId=id paramName=holiday paramProperty=holidayId/, but
everytime i click this link im having the same exception as before
Request[/holiday] does not contain handler parameter named action. i
put a hidden property of action eventhough i know that wont work coz link
doesnt submit the form. how will i solve this?
You should be able to add the dispatch name to the action in the link tag:

html:link action=/holiday.do?action=edit paramId=id
paramName=holiday paramProperty=holidayId/
I don't think you need the '.do' on the action either (the tag can match
the correct action without it) so this should work:
html:link action=/holiday?action=edit paramId=id
paramName=holiday paramProperty=holidayId/
Of course you might have trouble with this sort of link because the
LookupDispatchAction will try to match the action parameter's value with
a localised key.  I define two keys for each method eg
protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(global.action.internal.list, list);
map.put(global.action.internal.edit, edit);
map.put(button.list, list);
map.put(button.edit, edit);
return map;
}
The global.action.internal.* keys are only defined in my
application.properties file so I can create standard links like the one
above.  The button.* keys are defined application.properties and also
the other locales (eg application_ja.properties) so my buttons can show
the localised name and still call the correct method.




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


Re: LookupDispatchAction question part2

2003-06-26 Thread Frances Aleah Z. de Guzman
thanks jason, i double checked my application.properties and i found out that 
the value of my action should be Edit with the capital E but what im 
putting a while ago is ehehehemy mistake! thanks again.

On Thursday 26 June 2003 06:58 pm, Jason Lea wrote:
 Hi Frances,

 Frances Aleah Z. de Guzman wrote:
  im sorry but im having the same exception

 What does your html:link tag look like?
 What was the HTML output it produced?
 What do you have in your getKeyMethodMap()?
 What are the matching entries in your application.properties file?

 If you post those things I might be able to help better...

 --jason

  On Thursday 26 June 2003 05:01 pm, Jason Lea wrote:
 Frances Aleah Z. de Guzman wrote:
 i had posted a question i think 3 days ago about submitting a form to a
 LookupDispatchAction without hitting any button and still having a
 default value of the parameter handler. someone advised me (im sorry i
 forgot your name) that i should have a hidden property of my parameter
 name, so that eventhough i hit the enter button the submitted form will
 go to the method of the action corresponding to the default value of the
 parameter i specified. and it worked! but i have the same problem again
 with a little twistin my jsp i have a display of collection in a
 tabular form, and each record has a link going to an
  lookupdispatchaction that will edit its contents. i used html:link
  action=/holiday.do paramId=id paramName=holiday
  paramProperty=holidayId/, but everytime i click this link im having
  the same exception as before Request[/holiday] does not contain
  handler parameter named action. i put a hidden property of action
  eventhough i know that wont work coz link doesnt submit the form. how
  will i solve this?
 
 You should be able to add the dispatch name to the action in the link
  tag:
 
 html:link action=/holiday.do?action=edit paramId=id
 paramName=holiday paramProperty=holidayId/
 
 I don't think you need the '.do' on the action either (the tag can match
 the correct action without it) so this should work:
 
 html:link action=/holiday?action=edit paramId=id
 paramName=holiday paramProperty=holidayId/
 
 Of course you might have trouble with this sort of link because the
 LookupDispatchAction will try to match the action parameter's value with
 a localised key.  I define two keys for each method eg
 
 protected Map getKeyMethodMap() {
  Map map = new HashMap();
  map.put(global.action.internal.list, list);
  map.put(global.action.internal.edit, edit);
  map.put(button.list, list);
  map.put(button.edit, edit);
  return map;
 }
 
 
 The global.action.internal.* keys are only defined in my
 application.properties file so I can create standard links like the one
 above.  The button.* keys are defined application.properties and also
 the other locales (eg application_ja.properties) so my buttons can show
 the localised name and still call the correct method.

-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



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



Re: LookupDispatchAction and getParameter

2003-05-29 Thread Gregory F. March

On May 28, 2003, Eric Miles [EMAIL PROTECTED]  wrote:

 |or try getParameter(action) in your execute method.  The URL for the
 |request looks like http://...?action=doSave; internally.

Hmm... I printed out request.getParameter(action), and the value is
always the label of the submit button, i.e. Save, not create.save
(the application resource file looks like create.save=Save).

However, I also printed out the value of mapping.getParameter() and it
is always null.

Again, any help is greatly appreciated.

Thanks...

/greg


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

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



Re: LookupDispatchAction and getParameter

2003-05-29 Thread Gregory F. March

On May 27, 2003, Gregory F. March [EMAIL PROTECTED]  wrote:

 |I have a form with multiple submit buttons.  I'm trying to set up a
 |LookupDispatchAction.  It seems that
 |
 |request.getParameter(mapping.getParameter())
 |
 |is always returning null so I can't get to my actions.


Arg.  I'm really sorry - I had a typo in the struts-config.xml file
that was causing my grief.

For anyone interested, I had the following:

 action
blah=blah
foo=foo
parameter=action
 /action

Note the extra  after the foo.  The reason is that I copied that
action from another action that had some forwards in it.

Nothing like spending 12 hours chasing down a . :-)

Thanks anyway,

/greg

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

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



Re: LookupDispatchAction and getParameter

2003-05-29 Thread Eric Miles
--- In [EMAIL PROTECTED], Gregory F. March [EMAIL PROTECTED] wrote:
 
 On May 28, 2003, Eric Miles [EMAIL PROTECTED]  wrote:
 
  |or try getParameter(action) in your execute method.  The URL 
for the
  |request looks like http://...?action=doSave; internally.
 
 Hmm... I printed out request.getParameter(action), and the value 
is
 always the label of the submit button, i.e. Save, 
not create.save
 (the application resource file looks like create.save=Save).
 

This is the way it's supposed to work, then the Save is used as the 
key in looking up the method to call from getKeyMethodMap(), which 
resolves to doSave, which is passed the mapping, form, request and 
response objects.

I would comment out the execute method and put some debug statements 
in doSave() and see if I get to that point.  You should.  I'm new at 
this also, so bear with me!

Also, plug in the following lines to handle the default (you may need 
only 1 of these lines) in your getKeyMethodMap():

  map.put(null, doSave);
  map.put(, doSave);


 However, I also printed out the value of mapping.getParameter() and 
it
 is always null.
 
 Again, any help is greatly appreciated.
 
 Thanks...
 
 /greg
 
 
 --
 Gregory F. March-=-http://www.gfm.net:81/~march-=-
AIM:GfmNet
 
 
-
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: LookupDispatchAction and getParameter

2003-05-28 Thread Gregory F. March

On May 28, 2003, Eric Miles [EMAIL PROTECTED]  wrote:

 |Don't override the execute method, the LookupDispatchAction will call
 |'doSave' automatically.  Simply comment out your execute method.

Eric,

I was originally doing exactly what you say, but I was getting an
exception.  I searched the web and came across this snippet of code
where the parameter was checked in the overridden execute method
calling the super's execute only if something was there.  This is when
I realized it was never being set.  And since I guess there is no
default action, I was getting an exception.

Thanks,

/greg


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

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



Re: LookupDispatchAction and getParameter

2003-05-27 Thread Eric Miles
Don't override the execute method, the LookupDispatchAction will call
'doSave' automatically.  Simply comment out your execute method.

-Eric

--- In [EMAIL PROTECTED], Gregory F. March [EMAIL PROTECTED] wrote:
 
 Hi all.  Typical standard disclaimers apply... I'm new to struts, I'm
 having problems, I hope you all can help, thanks in advance, etc. :-)
 
 Here's my problem.
 
 I have a form with multiple submit buttons.  I'm trying to set up a
 LookupDispatchAction.  It seems that
 
 request.getParameter(mapping.getParameter())
 
 is always returning null so I can't get to my actions.
 
 My (highly trimmed down) code is below.  Any help would be appreciated.
 
 Many thanks...
 
 /greg
 
 
 --
 Gregory F. March-=-http://www.gfm.net:81/~march-=-   
AIM:GfmNet
 

--
 CreateParticipants.jsp:
 
 html:form action=SaveItem
   html:text property=ApplicantID size=25 maxlength=35
 onChange=javascript:this.value=this.value.toUpperCase();
 value= tabindex=5 /
   html:submit property=action
 bean:message key=create.save/
   /html:submit
 /html:form
 

--
 struts-config.xml:
 
   action
   path=/SaveItem
   type=com.mycompany.SaveItemAction
   scope=session
   name=MyCreateForm
   validate=true
   input=/CreateParticipants.jsp 
   parameter=action /
   /action
 
   form-bean
   name=MyCreateForm
   type=org.apache.struts.action.DynaActionForm
 
   form-property name=ApplicantID type=java.lang.String/
   /form-bean
 

--
 SaveItemAction.java
 
 public class SaveItemAction extends LookupDispatchAction  {
 
 /**
  * Create a map for the lookup dispatch method
  */
 
 protected Map getKeyMethodMap() {
 Map map = new HashMap();
 
 map.put(create.save, doSave);
 
 return map;
 }
 
 public ActionForward execute(ActionMapping   mapping,
  ActionForm  form,
  HttpServletRequest  request,
  HttpServletResponse response)
 throws Exception {
 DynaActionForm daform= (DynaActionForm) form;
 ActionForward  forward   = null;
 
 if(request.getParameter(mapping.getParameter()) == null) {
 //required parameter is missing!
 
 // This is ALWAYS null!!!
 
 System.out.println(Failure!);
 return(mapping.findForward(Failure));
 }
 
 return(super.execute(mapping, form, request, response));
 }
 
 /**
  * Process save
  */
 
 public ActionForward doSave(ActionMapping   mapping,
 ActionForm  form,
 HttpServletRequest  request,
 HttpServletResponse response)
 throws Exception {
 
 // Return success
 
 return(mapping.findForward(Success));
 }
 }
 
 -
 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: LookupDispatchAction and getParameter

2003-05-27 Thread Eric Miles
or try getParameter(action) in your execute method.  The URL for the
request looks like http://...?action=doSave; internally.

-Eric


--- In [EMAIL PROTECTED], Eric Miles [EMAIL PROTECTED] wrote:
 Don't override the execute method, the LookupDispatchAction will call
 'doSave' automatically.  Simply comment out your execute method.
 
 -Eric
 
 --- In [EMAIL PROTECTED], Gregory F. March [EMAIL PROTECTED] wrote:
  
  Hi all.  Typical standard disclaimers apply... I'm new to struts, I'm
  having problems, I hope you all can help, thanks in advance, etc. :-)
  
  Here's my problem.
  
  I have a form with multiple submit buttons.  I'm trying to set up a
  LookupDispatchAction.  It seems that
  
  request.getParameter(mapping.getParameter())
  
  is always returning null so I can't get to my actions.
  
  My (highly trimmed down) code is below.  Any help would be
appreciated.
  
  Many thanks...
  
  /greg
  
  
  --
  Gregory F. March-=-http://www.gfm.net:81/~march-=-   
 AIM:GfmNet
  
 

--
  CreateParticipants.jsp:
  
  html:form action=SaveItem
html:text property=ApplicantID size=25 maxlength=35
  onChange=javascript:this.value=this.value.toUpperCase();
  value= tabindex=5 /
html:submit property=action
  bean:message key=create.save/
/html:submit
  /html:form
  
 

--
  struts-config.xml:
  
action
path=/SaveItem
type=com.mycompany.SaveItemAction
scope=session
name=MyCreateForm
validate=true
input=/CreateParticipants.jsp 
parameter=action /
/action
  
form-bean
name=MyCreateForm
type=org.apache.struts.action.DynaActionForm
  
form-property name=ApplicantID type=java.lang.String/
/form-bean
  
 

--
  SaveItemAction.java
  
  public class SaveItemAction extends LookupDispatchAction  {
  
  /**
   * Create a map for the lookup dispatch method
   */
  
  protected Map getKeyMethodMap() {
  Map map = new HashMap();
  
  map.put(create.save, doSave);
  
  return map;
  }
  
  public ActionForward execute(ActionMapping   mapping,
   ActionForm  form,
   HttpServletRequest  request,
   HttpServletResponse response)
  throws Exception {
  DynaActionForm daform= (DynaActionForm) form;
  ActionForward  forward   = null;
  
  if(request.getParameter(mapping.getParameter()) == null) {
  //required parameter is missing!
  
  // This is ALWAYS null!!!
  
  System.out.println(Failure!);
  return(mapping.findForward(Failure));
  }
  
  return(super.execute(mapping, form, request, response));
  }
  
  /**
   * Process save
   */
  
  public ActionForward doSave(ActionMapping   mapping,
  ActionForm  form,
  HttpServletRequest  request,
  HttpServletResponse response)
  throws Exception {
  
  // Return success
  
  return(mapping.findForward(Success));
  }
  }
  
  -
  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: LookupDispatchAction + Paging with form submit

2003-03-25 Thread Andrew Hill
Looks like the action parameter isnt getting through.

Hmm. Heres why:
snip
document.forms[0].submit.value =
/myLookupDispatchAction.do?action=pagingpager.offset= + offset;
/snip

You seem to be setting the wrong attribute. Try:

document.forms[0].action =
/myLookupDispatchAction.do?action=pagingpager.offset= + offset;

btw
Despite being used in several struts examples, the parameter name action
is actually a very bad choice as it shadows a javascript form object
attribute also named action (which you probably noticed in my potential
solution above - shouldnt hurt as part of the url but as an html field it
will be bad as it will stop you setting the form action attribute in
javascript). A better choice of parameter name would be method or bob
(hehe).
/btw

-Original Message-
From: Pat Quinn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 25 March 2003 22:29
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction + Paging with form submit


I have a LookupDispatchAction as follows:

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put(label.catalogue.find, doFind);
map.put(label.catalogue.addtoCart, doAddToCart);
map.put(label.paging, doPaging);


return map;
}

I display my paging details using a Href's for eg.
a
href=/myWebApp/myLookupDispatchAction.do?action=pagingpager.offset=82/a



This all worked fine for me... but i then need to change my href to submit
the form as i page to the next page (I want to pick up client changes as
they page...
redirecting to the next view doesn't work as you'd expect)
.
So i changed my paging href's to the following:


a href=# onClick=dopaging(8)2/a


I have the following javascript method defined in the same jsp file:


function dopaging(offset) {
document.forms[0].submit.value =
/myLookupDispatchAction.do?action=pagingpager.offset= + offset;
document.forms[0].submit();
}


I then get the following error:

ERROR BaseAction::execute unexpected exception
javax.servlet.ServletException: Request[/myLookupDispatchAction] does not
contain handler parameter named
action
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.
java:200)



Any ideas guys... is there a better way to do this???







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


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



Re: LookupDispatchAction w/ Buttons Images

2003-02-24 Thread Vic Cekvenich
By searching the mail archive for you for other times this question was 
asked:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg48962.html

Vic, a nice guy.

Art Vandalay wrote:
I have a page that has 7 text buttons, an HTML table
with repeating rows of data, and 2 images. The images,
Previous and Next, allow a user to scroll through the
data that is displayed in the HTML table.
I chose to implement this as a LookupDispatchAction
originally because each of the 7 buttons will submit
the form. But the 2 images will also need to submit
the form. I'm not sure how to do this.
How do I tell Struts to set the parameter value
identified in my struts_config for the image that was
clicked as it does for the text buttons? There is no
property attribute on html:image (well, there is
but its deprecated and was used for a different
purpose). Do I need to do this myself in my javascript
that submits the form? 

If anyone has done this before and has any
examples/advice I'd appreciate it.
TIA.

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


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


RE: LookupDispatchAction w/ Buttons Images

2003-02-24 Thread James Mitchell
Hey, that's not fair.  Your sig is better than mine :)



--
James Mitchell
Software Engineer/Struts Evangelist


Beer is the reason we get up each afternoon.
   Ray McNeill 



 -Original Message-
 From: Vic Cekvenich [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 24, 2003 2:34 PM
 To: [EMAIL PROTECTED]
 Subject: Re: LookupDispatchAction w/ Buttons  Images
 
 
 By searching the mail archive for you for other times this 
 question was 
 asked:
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg
 48962.html
 
 Vic, a nice guy.
 
 
 Art Vandalay wrote:
  I have a page that has 7 text buttons, an HTML table
  with repeating rows of data, and 2 images. The images,
  Previous and Next, allow a user to scroll through the
  data that is displayed in the HTML table.
  
  I chose to implement this as a LookupDispatchAction
  originally because each of the 7 buttons will submit
  the form. But the 2 images will also need to submit
  the form. I'm not sure how to do this.
  
  How do I tell Struts to set the parameter value
  identified in my struts_config for the image that was
  clicked as it does for the text buttons? There is no
  property attribute on html:image (well, there is
  but its deprecated and was used for a different
  purpose). Do I need to do this myself in my javascript
  that submits the form? 
  
  If anyone has done this before and has any
  examples/advice I'd appreciate it.
  
  TIA.
  
  __
  Do you Yahoo!?
  Yahoo! Tax Center - forms, calculators, tips, more
  http://taxes.yahoo.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: LookupDispatchAction w/ Buttons Images

2003-02-24 Thread Art Vandalay
Thanks, but that older post from the archives does not
answer my question. I had searched the archive, like I
always do and found no previous answer to my question.

Maybe instead of being a nice guy you should
concentrate on being an effective guy.


--- Vic Cekvenich [EMAIL PROTECTED] wrote:
 By searching the mail archive for you for other
 times this question was 
 asked:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg48962.html
 
 Vic, a nice guy.
 
 
 Art Vandalay wrote:
  I have a page that has 7 text buttons, an HTML
 table
  with repeating rows of data, and 2 images. The
 images,
  Previous and Next, allow a user to scroll through
 the
  data that is displayed in the HTML table.
  
  I chose to implement this as a
 LookupDispatchAction
  originally because each of the 7 buttons will
 submit
  the form. But the 2 images will also need to
 submit
  the form. I'm not sure how to do this.
  
  How do I tell Struts to set the parameter value
  identified in my struts_config for the image that
 was
  clicked as it does for the text buttons? There is
 no
  property attribute on html:image (well, there
 is
  but its deprecated and was used for a different
  purpose). Do I need to do this myself in my
 javascript
  that submits the form? 
  
  If anyone has done this before and has any
  examples/advice I'd appreciate it.
  
  TIA.
  
  __
  Do you Yahoo!?
  Yahoo! Tax Center - forms, calculators, tips, more
  http://taxes.yahoo.com/
 
 
 

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


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



Re: LookupDispatchAction w/ Buttons Images

2003-02-24 Thread Vic Cekvenich
I read your post that said: I wants an example of images to submit.

You got a link to a working example, and how it works.

Please don't call me in-effective. I promise I will try to concentrate.
See what nice gets you.
Vic, aka not nice anymore, nor effective.

Art Vandalay wrote:
Thanks, but that older post from the archives does not
answer my question. I had searched the archive, like I
always do and found no previous answer to my question.
Maybe instead of being a nice guy you should
concentrate on being an effective guy.
--- Vic Cekvenich [EMAIL PROTECTED] wrote:

By searching the mail archive for you for other
times this question was 
asked:

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

Vic, a nice guy.

Art Vandalay wrote:

I have a page that has 7 text buttons, an HTML
table

with repeating rows of data, and 2 images. The
images,

Previous and Next, allow a user to scroll through
the

data that is displayed in the HTML table.

I chose to implement this as a
LookupDispatchAction

originally because each of the 7 buttons will
submit

the form. But the 2 images will also need to
submit

the form. I'm not sure how to do this.

How do I tell Struts to set the parameter value
identified in my struts_config for the image that
was

clicked as it does for the text buttons? There is
no

property attribute on html:image (well, there
is

but its deprecated and was used for a different
purpose). Do I need to do this myself in my
javascript

that submits the form? 

If anyone has done this before and has any
examples/advice I'd appreciate it.
TIA.

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/




-

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


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


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


RE: LookupDispatchAction

2003-02-13 Thread Wendy Smoak
 Ok, here goes... I've definately defined the internationalization
 Stuff in ApplicationResources.  Note the struts config bit below
 And the fact that I've specified the scope as session, does this
 make a difference? 

It shouldn't... my LookupDispatchForm is also in session scope and it works
fine.

   action path=/addbanana
type=com.example.AddBananaAction
name=BananaForm
input=/addbanana.jsp
scope=session
parameter=action 
forward name=success path=success.jsp/
/action

 My JSP has the bit...
 html:submit property=action
   bean:message key=button.banana.add/
 /html:submit

This also looks good.  Have you viewed the source of the resulting HTML and
made sure it's really emitting:
  input type=submit name=action value=Add Banana

I'm doing something a little different because I have some graphical buttons
that have to have spaces in the value:
   html-el:submit property=submit  onclick=setAction('Add Staff');
styleClass=addButton titleKey=button.add.staff value= /
but I also have a submit button like yours:
   html-el:submit property=submit onclick=setAction('Finish')
  bean-el:message key=button.finish/
   /html-el:submit
with
   SCRIPT
  function setAction(target) {document.forms[0].action.value=target;}
   /SCRIPT

 Finally application resources contains...
 button.banana.add=Add Banana

I was hoping it would be something obvious!  Sorry, I don't see anything
wrong with what you've posted.  

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management




RE: LookupDispatchAction

2003-02-13 Thread Wendy Smoak
I wrote:
 It shouldn't... my LookupDispatchForm is also in session scope 

Obviously it's way too early to be typing.  That's LookupDispatchAction, not
Form!

-- 
Wendy



Re: LookupDispatchAction

2003-02-12 Thread David Graham
The key method map should contain resource keys not actual message text.

David




From: JONATHAN PHILIP HOLLOWAY [EMAIL PROTECTED]
Reply-To: JONATHAN PHILIP HOLLOWAY [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: LookupDispatchAction
Date: Wed, 12 Feb 2003 17:03:57 -

Does anybody know why the following is casuing me so many problems.
I'm using LookupDispatchAction and have a number of methods defined
in my action class including an execute method.  The problem is that
the execute method ALWAYS gets executed and not the intended method.

I have in the addbanana.jsp:
html:submit value=Add Banana property=action/

and in Struts-config:
  action path=/addbanana
type=com.example.AddBananaAction
name=BananaForm
input=/addbanana.jsp
scope=session
parameter=action

   /action

In my action class I've defined the following:

public ActionForward addBanana(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
HttpServletResponse response) 
throws IOException, ServletException {


  return (mapping.findForward(success));
 }

public ActionForward deleteBanana(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
HttpServletResponse response) 
throws IOException, ServletException {


  return (mapping.findForward(success));
 }

/**
 * Get key method map just obtains the map that maps the button
 * text onto the particular method in this action
 * @param mapping is the action mapping
 * @param form is the action form
 * @param request is the http request
 */
protected Map getKeyMethodMap() {


  Map map = new HashMap();
  map.put(Add Banana, addBanana);
  map.put(Delete Banana, deleteBanana);
  return map;
 }



  /**
 * Execute method
 * @param mapping is the information regardin gthe URI mapping and the 
action
 * @param form is the action form used
 * @param request is the request
 * @param response is the response
 * @return the action forward, a destination to forward the user onto (eg 
another JSP)
 */
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws 
IOException, ServletException {


  Logger.logInfo(Execute Called);



//We can now put these bits in the database
return (mapping.findForward(success)
}


Does anybody know why EXECUTE is called but the intended ADDBANANA method 
is not
called?

Many thanks,
Jon.



*-*
 Jonathan Holloway,
 Dept. Of Computer Science,
 Aberystwyth University,
 Ceredigion,
 West Wales,
 SY23 3DV.

 07968 902140
 http://users.aber.ac.uk/jph8
*-*


_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



RE: LookupDispatchAction

2003-02-12 Thread Rob Kischuk
The keys in your KeyMethodMap should correspond to messages in your message
bundle used to render the button.  So you would have in your jsp:
html:submit
  bean:message key=button.add.banana/
/html:submit

in your action:

 protected Map getKeyMethodMap(ActionMapping mapping,
ActionForm form,
HttpServletRequest request) {
  Map map = new HashMap();
  map.put(button.add.banana, addBanana);
  map.put(button.delete.banana, deleteBanana);   
  return map;
}

And in your message-resources file:
button.add.banana=Add Banana
button.delete.banana=Delete Banana

If you don't need the message resources (for i18n or something), you might
want to use DispatchAction instead.

-Rob

-Original Message-
From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 12, 2003 12:04 PM
To: Struts Users Mailing List
Subject: LookupDispatchAction


Does anybody know why the following is casuing me so many problems.
I'm using LookupDispatchAction and have a number of methods defined
in my action class including an execute method.  The problem is that
the execute method ALWAYS gets executed and not the intended method.

I have in the addbanana.jsp:
html:submit value=Add Banana property=action/

and in Struts-config:
  action path=/addbanana
type=com.example.AddBananaAction
name=BananaForm
input=/addbanana.jsp
scope=session
parameter=action 
  
   /action

In my action class I've defined the following:

public ActionForward addBanana(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
HttpServletResponse response) throws
IOException, ServletException {
 

  return (mapping.findForward(success));
 }

public ActionForward deleteBanana(ActionMapping mapping, 
  ActionForm form, 
  HttpServletRequest request, 
HttpServletResponse response) throws
IOException, ServletException {
 

  return (mapping.findForward(success));
 }
 
/**
 * Get key method map just obtains the map that maps the button
 * text onto the particular method in this action
 * @param mapping is the action mapping
 * @param form is the action form 
 * @param request is the http request
 */ 
protected Map getKeyMethodMap() {
   
   
  Map map = new HashMap();
  map.put(Add Banana, addBanana);
  map.put(Delete Banana, deleteBanana);   
  return map;
 }



  /**
 * Execute method
 * @param mapping is the information regardin gthe URI mapping and the
action
 * @param form is the action form used
 * @param request is the request
 * @param response is the response
 * @return the action forward, a destination to forward the user onto (eg
another JSP)
 */
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
IOException, ServletException {

  
  Logger.logInfo(Execute Called);   
  
  
  
//We can now put these bits in the database
return (mapping.findForward(success)
}


Does anybody know why EXECUTE is called but the intended ADDBANANA method is
not
called?

Many thanks,
Jon.



*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*

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




RE: LookupDispatchAction

2003-02-12 Thread Wendy Smoak
 The problem is that the execute method ALWAYS gets executed and not the
intended method.
 Does anybody know why EXECUTE is called but the intended ADDBANANA method
is not called?

You've effectively undone the use of LookupDispatchAction by overriding
the execute method without calling super.execute(...).  You correctly
complain that *your* execute method is being called, not the one in
LookupDispatchAction that figures out which method to call.  So either get
rid of your execute method, or make sure to call super.execute(...).

In addition, as David mentioned, the things in the KeyMethodMap should be
keys present in your ApplicationResources.properties file, not the actual
value in the request.

An example from my project:

   ApplicationResources.properties contains:
  button.add.prospect=Add Prospect
  button.delete.prospect=Delete Prospect

   and getKeyMethodMap has this:
  map.put( button.add.prospect, addProspect );
  map.put( button.delete.prospect, deleteProspect );

Also consider implementing the 'unspecified' method to prevent a problem if
the specified parameter is not present in the request.

HTH,

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management



RE: LookupDispatchAction

2003-02-12 Thread Brandon Goodin
(Http11Processor.java:40
5)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:380)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:50
8)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:533)
at java.lang.Thread.run(Thread.java:536)


root cause

java.lang.NullPointerException
at java.lang.Class.getMethod0(Class.java:1734)
at java.lang.Class.getMethod(Class.java:951)
at
org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:3
34)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.j
ava:266)
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
ion.java:239)
at
tweek.struts.staff.action.assessment.QuestionMCAction.execute(QuestionMC
Action.java:173)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:446)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
266)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:239
6)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:40
5)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:380)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:50
8)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:533)
at java.lang.Thread.run(Thread.java:536)


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]]
Sent: 12 February 2003 17:21
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction

 The problem is that the execute method ALWAYS gets executed and not
the
intended method.
 Does anybody know why EXECUTE is called but the intended ADDBANANA
method
is not called?

You've effectively undone the use of LookupDispatchAction by
overriding
the execute method without calling super.execute(...).  You correctly
complain that *your* execute method is being called, not the one in
LookupDispatchAction that figures out which method to call.  So either
get
rid of your execute method, or make sure to call super.execute(...).

In addition, as David mentioned, the things in the KeyMethodMap should
be
keys present in your

RE: LookupDispatchAction

2003-02-12 Thread Wendy Smoak
 Ok the reason I had just put strings in the Map was because of
 Lack of internationalisation, I've now done this but still I get
 The same error that of a NullPointerException.  I'm assuming this
 Is because of a method not found error from my ServletException
 Output in Tomcat... (See attached)  Am I correct in assuming that
 map.put( button.banana.add, addBanana );
 maps onto the method..
 public ActionForward addBanana(

Not without the following:
   In the .properties file:
  button.banana.add=Add Banana
   In the request
  action being equal to Add Banana
   In struts-config:
  actionpath=/editContact
  ...
  parameter=action

 I've simply stuck super.execute() in my execute method and also
 Tried removing the method as well but I still seem to get the 
 Following exception *sigh*.  Can anyone suggest whats wrong?

This isn't the same error you described earlier... now the
LookupDispatchAction's execute method *is* being executed, but it can't
figure out which method to pick.

You're much closer now, just get all the bits arranged properly and it will
work.  If you're still stuck, post the relevant snippets of struts-config,
.properties and the JSP.  We've just seen the map.put and the addBanana
method signature so far.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management



RE: LookupDispatchAction

2003-02-12 Thread Jonathan
Ok, here goes... I've definately defined the internationalization
Stuff in ApplicationResources.  Note the struts config bit below
And the fact that I've specified the scope as session, does this
make a difference? 


action path=/addbanana
type=com.example.AddBananaAction
name=BananaForm
input=/addbanana.jsp
scope=session
parameter=action 

forward name=success path=success.jsp/

/action 

My JSP has the bit...

html:submit property=action
bean:message key=button.banana.add/

/html:submit

Is this wrong for a submit button?  Should I be specifying a value 
Attribute?  If so how do I pass the bean:message bit in, is it this
instead

html:submit property=action value=bean:message
key=button.banana.add/  
/html:submit


Finally application resources contains...

button.banana.add=Add Banana


Many thanks,
Jon.


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]] 
Sent: 13 February 2003 00:28
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction

 Ok the reason I had just put strings in the Map was because of
 Lack of internationalisation, I've now done this but still I get
 The same error that of a NullPointerException.  I'm assuming this
 Is because of a method not found error from my ServletException
 Output in Tomcat... (See attached)  Am I correct in assuming that
 map.put( button.banana.add, addBanana );
 maps onto the method..
 public ActionForward addBanana(

Not without the following:
   In the .properties file:
  button.banana.add=Add Banana
   In the request
  action being equal to Add Banana
   In struts-config:
  actionpath=/editContact
  ...
  parameter=action

 I've simply stuck super.execute() in my execute method and also
 Tried removing the method as well but I still seem to get the 
 Following exception *sigh*.  Can anyone suggest whats wrong?

This isn't the same error you described earlier... now the
LookupDispatchAction's execute method *is* being executed, but it can't
figure out which method to pick.

You're much closer now, just get all the bits arranged properly and it
will
work.  If you're still stuck, post the relevant snippets of
struts-config,
.properties and the JSP.  We've just seen the map.put and the addBanana
method signature so far.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


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




RE: LookupDispatchAction Question

2003-02-11 Thread Alvarado, Juan (c)
I would suggest you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

 public ActionForward execute(ActionMapping actionMapping,
 ActionForm actionForm,
 HttpServletRequest httpServletRequest,
 HttpServletResponse httpServletResponse)
   throws Exception
 {
  if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
  {
   return defaultMethod();
  }
  else
  {
   return super.execute(actionMapping, actionForm, httpServletRequest,
 httpServletResponse);
  }
 }


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.

 



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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




RE: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated

I looked at that site. That is where I found out about LookupDispatchAction. But there 
is nothing that I can find that tells me how to initially display a page that will 
subsequently use a dispatch action. In fact, I can't figure out how to do it in Struts 
at all without either having a plain .html page as the inital page or having 2 .jsp 
pages. Niether solution is good.
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:I would suggest you read 
up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day


RE: LookupDispatchAction Question

2003-02-11 Thread Alvarado, Juan (c)
Okay can you please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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




RE: LookupDispatchAction Question

2003-02-11 Thread Brandon Goodin
U, I'm not sure from your message what you are doing. It sounds like you
are forwarding to a page that contains a form and requires some
initialization.

In that case you would use the [parameterName]= to call the unspecified
method.

In your LookupDispatchAction there is an unspecified method that is called
when you do not specify a value for your paramter. So you just need to
specify an unspecified method in your LookupDispatch action that will
contain all the initialization logic calls that are needed. That would allow
you to use the same page for different dispatch methods.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 12:54 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


I would suggest you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

 public ActionForward execute(ActionMapping actionMapping,
 ActionForm actionForm,
 HttpServletRequest httpServletRequest,
 HttpServletResponse httpServletResponse)
   throws Exception
 {
  if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
  {
   return defaultMethod();
  }
  else
  {
   return super.execute(actionMapping, actionForm, httpServletRequest,
 httpServletResponse);
  }
 }


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

-
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: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated

After the user logs on they are supposed to go to a lookup page. This page will have 
no data on it when it is first displayed. This page, which is a JSP of course, will 
have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts calls my 
Action class (which extends LookupDispatchAction), there is no value for the submit 
button. That is, Struts doesn't know which of my methods to invoke and throws an 
exception (the error message from my first email).  This is because the user hasn't 
clicked any of the submit buttons yet -- they haven't even seen the page.
How do I get the page to display initially?
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay can you please tell 
me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day


RE: LookupDispatchAction Question

2003-02-11 Thread Brandon Goodin
simple...

in your execute method check to see if the mapping.getParameter is null.

If it is null then have it call a method that performs some initialization
(if needed) and returns an ActionForward to your jsp page.

If you want code... I have done this many times.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email).  This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day


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




RE: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated

OK, so if I don't have a value for the dispatch parameter I can simply do the 
following?: 

return unspecified(actionMapping, actionForm, httpServletRequest,
  httpServletResponse); 

 Brandon Goodin [EMAIL PROTECTED] wrote: U, I'm not sure from your message what you 
are doing. It sounds like you
are forwarding to a page that contains a form and requires some
initialization.

In that case you would use the [parameterName]= to call the unspecified
method.

In your LookupDispatchAction there is an unspecified method that is called
when you do not specify a value for your paramter. So you just need to
specify an unspecified method in your LookupDispatch action that will
contain all the initialization logic calls that are needed. That would allow
you to use the same page for different dispatch methods.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 12:54 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


I would suggest you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

-
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! Shopping - Send Flowers for Valentine's Day


RE: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated

yes, i need some code. I don't understand how I can forward to my .jsp page -- won't 
this put me in a loop? Won't Struts just call my Action class again after looking up 
the .jsp page's mapping?
 Brandon Goodin [EMAIL PROTECTED] wrote:simple...

in your execute method check to see if the mapping.getParameter is null.

If it is null then have it call a method that performs some initialization
(if needed) and returns an ActionForward to your jsp page.

If you want code... I have done this many times.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day


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

RE: LookupDispatchAction Question

2003-02-11 Thread Alvarado, Juan (c)
Okay this is one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage. 

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email).  This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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




RE: LookupDispatchAction Question

2003-02-11 Thread Brandon Goodin
That is correct... here is a code sample.


public ActionForward execute(mapping,form,request,response) {

if (mapping.getParamter() == null) {
// this avoids an exception from happening
// when no parameter exists
return uspecified(mapping,form,request,response);

} else {

// this handles everything just fine when the
// parameter exists even if the parameter has
// no value

return super.execute(mapping,form,request,response);

}

}

public ActionForward unspecified(mapping,form,request,response) {

... do your stuff here

}


public ActionForward  other methods etc


Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:15 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



OK, so if I don't have a value for the dispatch parameter I can simply do
the following?:

return unspecified(actionMapping, actionForm, httpServletRequest,
  httpServletResponse);

 Brandon Goodin [EMAIL PROTECTED] wrote: U, I'm not sure from your message
what you are doing. It sounds like you
are forwarding to a page that contains a form and requires some
initialization.

In that case you would use the [parameterName]= to call the unspecified
method.

In your LookupDispatchAction there is an unspecified method that is called
when you do not specify a value for your paramter. So you just need to
specify an unspecified method in your LookupDispatch action that will
contain all the initialization logic calls that are needed. That would allow
you to use the same page for different dispatch methods.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 12:54 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


I would suggest you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

-
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! Shopping - Send Flowers for Valentine's Day


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




RE: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated

My login IS NOT a LookupDispatchAction. It is an Action. It is the page that login 
forwards to that is a LookupDispatchAction. But that page never displays because there 
is no value for the submit parameter in this case.
 
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay this is one way of 
doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage. 

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

-
To unsubscribe, e-mail

RE: LookupDispatchAction Question

2003-02-11 Thread Alvarado, Juan (c)
Can you show me the snippet of code you are using to forward to the JSP from
the login action.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:25 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



My login IS NOT a LookupDispatchAction. It is an Action. It is the page that
login forwards to that is a LookupDispatchAction. But that page never
displays because there is no value for the submit parameter in this case.
 
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay this is
one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage. 

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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



-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

RE: LookupDispatchAction Question

2003-02-11 Thread Brandon Goodin
I would like to say that the LookupDispatchAction is used to handle the
organization and grouping of Actions into methods that work in concert. It
is mainly organizational. It sounds to me that Mr. Avexus Incorporated ;) is
using it quite within it's means. But, he is quite vague in his
implementation and to be honest I don't think we should start telling him
how to implement his system. We really should answer the question first and
when it is clear that he is breaking the hard fast rules of struts... then
tell him he's wacked out and needs to change :-D.

Peace and Granola,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:20 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


Okay this is one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage.

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email).  This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only solution.





-
Do you Yahoo!?
Yahoo! Shopping - Send Flowers

RE: LookupDispatchAction Question

2003-02-11 Thread Brandon Goodin
:-D :-D :-D

Juan was right. Why are you forwarding to another action from an action.
I'll get out of this discussion cuz I think Juan has got it.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:33 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


Can you show me the snippet of code you are using to forward to the JSP from
the login action.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:25 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



My login IS NOT a LookupDispatchAction. It is an Action. It is the page that
login forwards to that is a LookupDispatchAction. But that page never
displays because there is no value for the submit parameter in this case.

 Alvarado, Juan (c) [EMAIL PROTECTED] wrote:Okay this is
one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage.

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon submit -- but that is ugly and I hope not the only

RE: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated

If I code the following: 
 
public class LookupAction  extends LookupDispatchAction
{ 
 public ActionForward execute(ActionMapping actionMapping,
 ActionForm actionForm,
 HttpServletRequest httpServletRequest,
 HttpServletResponse httpServletResponse)
   throws Exception
 {
  if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
  {
   return super.unspecified(actionMapping, actionForm, httpServletRequest,
  httpServletResponse);
  }
  else
  {
   return super.execute(actionMapping, actionForm, httpServletRequest,
 httpServletResponse);
  }
 } 
 
and forward to my JSP without any value for submit, then I get the error message: 
 
Request[/lookup] does not contain handler parameter named submit. 
 
Here is my action mapping from struts_config:
 

action path=/lookup type=com.avexus.client.action.lookupAction name=lookupForm 
scope=request input=/lookup.jsp unknown=false validate=true 
parameter=submit/

 Brandon Goodin [EMAIL PROTECTED] wrote: I would like to say that the 
LookupDispatchAction is used to handle the
organization and grouping of Actions into methods that work in concert. It
is mainly organizational. It sounds to me that Mr. Avexus Incorporated ;) is
using it quite within it's means. But, he is quite vague in his
implementation and to be honest I don't think we should start telling him
how to implement his system. We really should answer the question first and
when it is clear that he is breaking the hard fast rules of struts... then
tell him he's wacked out and needs to change :-D.

Peace and Granola,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:20 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


Okay this is one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage.

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't

RE: LookupDispatchAction Question

2003-02-11 Thread Avexus Incorporated
should be nothing wrong with that. i do that all the time, except this is the first 
time that i've tried to use LookupDispatchAction as I just came across it.
 
 Brandon Goodin [EMAIL PROTECTED] wrote::-D :-D :-D

Juan was right. Why are you forwarding to another action from an action.
I'll get out of this discussion cuz I think Juan has got it.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:33 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


Can you show me the snippet of code you are using to forward to the JSP from
the login action.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:25 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



My login IS NOT a LookupDispatchAction. It is an Action. It is the page that
login forwards to that is a LookupDispatchAction. But that page never
displays because there is no value for the submit parameter in this case.

Alvarado, Juan (c) wrote:Okay this is
one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage.

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception
{
if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
{
return defaultMethod();
}
else
{
return super.execute(actionMapping, actionForm, httpServletRequest,
httpServletResponse);
}
}


My question is what do I return from defaultMethod? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page

RE: LookupDispatchAction Question

2003-02-11 Thread Alvarado, Juan (c)
From a design point of view, forwarding from one action to another action
should be examined closely. It should be the exception rather than the rule.


I would suggest you do the following. From your login action just forward to
your JSP; don't forward to the LookupDispatchAction. This should solve your
problem.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:48 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question


should be nothing wrong with that. i do that all the time, except this is
the first time that i've tried to use LookupDispatchAction as I just came
across it.
 
 Brandon Goodin [EMAIL PROTECTED] wrote::-D :-D :-D

Juan was right. Why are you forwarding to another action from an action.
I'll get out of this discussion cuz I think Juan has got it.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 1:33 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


Can you show me the snippet of code you are using to forward to the JSP from
the login action.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:25 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



My login IS NOT a LookupDispatchAction. It is an Action. It is the page that
login forwards to that is a LookupDispatchAction. But that page never
displays because there is no value for the submit parameter in this case.

Alvarado, Juan (c) wrote:Okay this is
one way of doing this:

Your login action in this case should not be a LookupDispatchAction. It
should be a sub-class of the struts Action class. LookupDispatchAction has
another intended usage.

When your user is authenticated (from the login action), you will forward to
the jsp that is suppose to contain all the submit buttons. Assuming
everything else is configured properly, your JSP should then display
properly.


-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:11 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



After the user logs on they are supposed to go to a lookup page. This page
will have no data on it when it is first displayed. This page, which is a
JSP of course, will have a form and more than 1 submit button.
The problem is that the page can't even be displayed because when Struts
calls my Action class (which extends LookupDispatchAction), there is no
value for the submit button. That is, Struts doesn't know which of my
methods to invoke and throws an exception (the error message from my first
email). This is because the user hasn't clicked any of the submit buttons
yet -- they haven't even seen the page.
How do I get the page to display initially?
Alvarado, Juan (c) wrote:Okay can you
please tell me what exactly it is you're trying to
accomplish??? I don't quite get what your ultimate goal is.

Thanks

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:01 PM
To: Struts Users Mailing List
Subject: RE: LookupDispatchAction Question



I looked at that site. That is where I found out about LookupDispatchAction.
But there is nothing that I can find that tells me how to initially display
a page that will subsequently use a dispatch action. In fact, I can't figure
out how to do it in Struts at all without either having a plain .html page
as the inital page or having 2 .jsp pages. Niether solution is good.
Alvarado, Juan (c) wrote:I would suggest
you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-Original Message-
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the submit button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

public ActionForward execute

RE: LookupDispatchAction Question

2003-02-11 Thread Chen, Gin
Okay from what I got:

Login - Lookup

Login is an Action.
Lookup is a LookupDispatchAction.

The problem is that it is forwarding to ur LookupDispatchAction class and
not to you lookup page.

If this is wrong then stop reading ur wasting ur time and I've already
wasted mine.

So I'm assuming that your Login action class has an execute method that
looks like:


execute()
{
  //handle login
  blah...

  return mapping.findForward(success);
}

like most standard struts applications and that ur success is to an action

In addition your forward is defined as such:

forward name=success
 contextRelative=true
 path=/myLookupAction.do
 redirect=true/
which means that it goes to your Lookup dispatch action.

Fine. At this point you have several options one of which is the following:

replace path=/myLookupAction.do (or whatever you have)
with path=/myLookupPage.jsp (to go directly to ur jsp)
-Tim


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




  1   2   >