RE: Action mappings

2004-01-27 Thread struts fox
  That fixed it!!  Thanks.
I was getting the application resource not found, which now obviously makes sense.
Loving struts!
 
 
 
 
 


"Gopalakrishnan, Jayesh" <[EMAIL PROTECTED]> wrote:Do you have web.xml configured with 
"/do" URLS going to struts.

If so, your entry should be, Notice that the path is the complete path with
the prefix.

type="net.strutstest.SetUpEmployeeAction"
name="employeeForm"
scope="request"
validate="false"
>




Hope this helps

-jayash

-Original Message-
From: struts fox [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 11:45 AM
To: [EMAIL PROTECTED]
Subject: Action mappings


I t seems Struts lets you use action mappings that it figures out and
forwards for you, but I have had no luck testing this.




type="net.strutstest.SetUpEmployeeAction"
name="employeeForm"
scope="request"
validate="false"
>





type="net.strutstest.SteveAction"
name="employeeForm"
scope="request"
validate="false"
>
name="continue"
path="/employeeForm.jsp"/>



So basically SetUpEmployeeAction should be called when the user submits.
Then SetUpEmployeeAction forward to SteveAction and then that forwards to
employeeForm.jsp. It errors out trying to load the resource SteveAction, but
I see nothing else I need to declare in any properties file or resource
file. Struts should be able to do this from what I've read.


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

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



-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

RE: Action mappings

2004-01-27 Thread Peter Abbot
Are you using something like .do for your servlet mapping in the web.xml
to map requests to the ActionServlet.

The forward "continue" you have defined for you action
"/setUpEmployeeForm" needs to have the servlet mapping extension, so it
should look something like:





Cheers

Pete


-Original Message-
From: struts fox [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 28 January 2004 8:45 a.m.
To: [EMAIL PROTECTED]
Subject: Action mappings


I t seems Struts lets you use action mappings that it figures out and
forwards for you, but I have had no luck testing this.















So basically SetUpEmployeeAction should be called when the user submits.
Then SetUpEmployeeAction forward to SteveAction and then that forwards
to employeeForm.jsp. It errors out trying to load the resource
SteveAction, but I see nothing else I need to declare in any properties
file or resource file. Struts should be able to do this from what I've
read.


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

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



RE: Action mappings

2004-01-27 Thread Gopalakrishnan, Jayesh
Do you have web.xml configured with "/do" URLS going to struts.

If so, your entry should be, Notice that the path is the complete path with
the prefix.



   


Hope this helps

-jayash

-Original Message-
From: struts fox [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 11:45 AM
To: [EMAIL PROTECTED]
Subject: Action mappings


I t seems Struts lets you use action mappings that it figures out and
forwards for you, but I have had no luck testing this.















So basically SetUpEmployeeAction should be called when the user submits.
Then SetUpEmployeeAction forward to SteveAction and then that forwards to
employeeForm.jsp. It errors out trying to load the resource SteveAction, but
I see nothing else I need to declare in any properties file or resource
file. Struts should be able to do this from what I've read.


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

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



RE: Action mappings

2004-01-27 Thread Barnett, Brian W.
What is the error when it "errors out"?

-Original Message-
From: struts fox [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 12:45 PM
To: [EMAIL PROTECTED]
Subject: Action mappings

I t seems Struts lets you use action mappings that it figures out and
forwards for you, but I have had no luck testing this.















So basically SetUpEmployeeAction should be called when the user submits.
Then SetUpEmployeeAction forward to SteveAction and then that forwards to
employeeForm.jsp. It errors out trying to load the resource SteveAction, but
I see nothing else I need to declare in any properties file or resource
file. Struts should be able to do this from what I've read.


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

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



Re: Action mappings

2004-01-27 Thread Brandon Goodin
Of course.

>>> [EMAIL PROTECTED] 1/27/2004 12:45:01 PM >>>
I t seems Struts lets you use action mappings that it figures out and
forwards for you, but I have had no luck testing this.















So basically SetUpEmployeeAction should be called when the user
submits.  Then SetUpEmployeeAction forward to SteveAction and then that
forwards to employeeForm.jsp. It errors out trying to load the resource
SteveAction, but I see nothing else I need to declare in any properties
file or resource file. Struts should be able to do this from what I've
read.


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

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



Action mappings

2004-01-27 Thread struts fox
I t seems Struts lets you use action mappings that it figures out and forwards for 
you, but I have had no luck testing this.















So basically SetUpEmployeeAction should be called when the user submits.  Then 
SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. 
It errors out trying to load the resource SteveAction, but I see nothing else I need 
to declare in any properties file or resource file. Struts should be able to do this 
from what I've read.


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

Re: action-mappings, action not working

2003-11-13 Thread Phil
Hi,

the methode signature is wrong.
You have to override the methode

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

There is no method

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

in the Action class.

Since Struts 1.1 the perform method is deprecated,
so you better use the execute method.

public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 ServletRequest request,
 ServletResponse response)
throws Exception {

HTH,

Phil






- Original Message -
From: "Ajay Kalidindi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 13, 2003 12:23 PM
Subject: action-mappings, action not working


> Hi
>
>
> I am using :
>
> Redhat 9
> Apache 2.0.48
> Tomcat 4.1.29
> Struts 1.1
>
> For some reason I am not getting any errors and control is not getting
forwarded
> to respective success forward from DummyAction.
> Any help is appreciated.
>
> Regards
>
> Ajay Kalidindi
>
> config and source  follows:
>
> struts-config.xml entry:
>
>  
>
>  
>
>  
>
> DummyAction.java :
>
> package com.kalidindis.home;
>
> import java.io.IOException;
> import javax.servlet.RequestDispatcher;
> import javax.servlet.*;
> import org.apache.struts.action.*;
> import org.apache.struts.util.*;
>
> /**
>  * Implementation of Action that lists contacts of Ajay
> Kalidindi.
>  */
>
> public final class DummyAction extends Action {
>   public ActionForward perform(ActionServlet servlet,
>ActionMapping mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response)
> throws IOException, ServletException {
> return (mapping.findForward("success"));
>   }
> }
>
>
>
>
>


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



Re: action-mappings, action not working

2003-11-13 Thread Raman Garg
Try to debug it using System.out.println ("<<<<<>>>>>");

in your action class
public ActionForward perform(ActionServlet servlet,
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
 throws IOException, ServletException {
System.out.println ("<<<<<>>>>>");
 return (mapping.findForward("success"));
   }

and check the output at tomcat after restarting it... this will ensure that
your class file is called.
if this goes ok then some problem is there in your index.jsp

cheers
Raman Garg







- Original Message -
From: "Ajay Kalidindi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 13, 2003 4:53 PM
Subject: action-mappings, action not working


> Hi
>
>
> I am using :
>
> Redhat 9
> Apache 2.0.48
> Tomcat 4.1.29
> Struts 1.1
>
> For some reason I am not getting any errors and control is not getting
forwarded
> to respective success forward from DummyAction.
> Any help is appreciated.
>
> Regards
>
> Ajay Kalidindi
>
> config and source  follows:
>
> struts-config.xml entry:
>
>  
>
>  
>
>  
>
> DummyAction.java :
>
> package com.kalidindis.home;
>
> import java.io.IOException;
> import javax.servlet.RequestDispatcher;
> import javax.servlet.*;
> import org.apache.struts.action.*;
> import org.apache.struts.util.*;
>
> /**
>  * Implementation of Action that lists contacts of Ajay
> Kalidindi.
>  */
>
> public final class DummyAction extends Action {
>   public ActionForward perform(ActionServlet servlet,
>ActionMapping mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response)
> throws IOException, ServletException {
> return (mapping.findForward("success"));
>   }
> }
>
>
>
>
>


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



action-mappings, action not working

2003-11-13 Thread Ajay Kalidindi
Hi


I am using :

Redhat 9
Apache 2.0.48
Tomcat 4.1.29
Struts 1.1

For some reason I am not getting any errors and control is not getting forwarded
to respective success forward from DummyAction.
Any help is appreciated.

Regards

Ajay Kalidindi

config and source  follows:

struts-config.xml entry:

 
   
 
   
 

DummyAction.java :

package com.kalidindis.home;

import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.*;
import org.apache.struts.action.*;
import org.apache.struts.util.*;

/**
 * Implementation of Action that lists contacts of Ajay
Kalidindi.
 */

public final class DummyAction extends Action {
  public ActionForward perform(ActionServlet servlet,
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
throws IOException, ServletException {
return (mapping.findForward("success"));
  }
}






action mappings not found? page not found

2003-11-10 Thread Marcel Overdijk
In my multiple strus enviroment I have 3 modules.
The default and for example config/reflection and config/2
My default struts-config contains the folowing global forward:


In my struts-reflection-config I have the following mapping:

   
This mappings maps to a Tiles page, but when starting this page I receive a 
standard IE page not found error. Not a Apache Tomcat 404 error.

I really don't kown what's the problem..

Any help appreciated.

_
MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: declaring action mappings at runtime

2003-10-31 Thread Ahmet ISIK
Kirk, thanks for the advice,
yes, you're right I think. I'm going to change it that way in the first 
refactoring time available.

Kirk Wylie wrote:
I know this is a little OT, but had you thought about doing it with 
xdoclet? Particularly if the Hibernate configurations are coming out of 
xdoclet in the first place (and everything's set at compile time), you 
could probably extend the Hibernate templates pretty easily to generate 
the action mappings automatically. Then you'd have everything based on 
Hibernate, done dynamically, and a faster startup time as well.

Just an idea.

Kirk Wylie
M7 Corporation
Ahmet ISIK wrote:

I'm doing it in a plugin.
My purpose is to develop generic CRUD operations, views and forms for
any model object that is persisted using Hibernate. For this, I
introspect Hibernate config and provide form fields according to
underlying object's properties.
I'm declaring actionmappings at runtime because I'm asking Hibernate for
a list of entities that are declared.
Martin Cooper wrote:
 > "Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
 > news:[EMAIL PROTECTED]
 >
 >>thanks Martin,
 >>I have found a solution. I have acquired module config by
 >>Globals.MODULE_KEY key from app context. Then I added programmatically
 >>configured ActionMappings to module config object. after that it is
 >>possible to use those action mappings. Is this a bad practice?
 >
 >
 > Where are you doing this? (And why?)
 >
 > If you're doing it in a plug-in, then I believe it will work, but I 
don't
 > see how that would be any more "dynamic" than adding them to your 
Struts
 > config file. (Also in that case, you are already passed the module 
config,
 > so you wouldn't need to look it up, as you mentioned you are doing.)
 >
 > If you're doing it outside of a plug-in, then I'm puzzled. Once 
Struts loads
 > the config, it freezes it and throws IllegalStateException if you 
attempt to
 > modify it.
 >
 > --
 > Martin Cooper
 >
 >
 >
 >>Martin Cooper wrote:
 >>
 >>>"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
 >>>news:[EMAIL PROTECTED]
 >>>
 >>>
 >>>>Hi,
 >>>>Is it possible to declare struts action mappings at runtime, and 
how?
 >>>
 >>>
 >>>No, it's not possible. The config is read in at application 
startup and
 >
 > is
 >
 >>>then frozen. (The reason it's done this way is so that access to the
 >
 > config
 >
 >>>does not need to be synchronised once the app is up and running, thus
 >>>leading to much improved overall performance.)
 >>>
 >>>--
 >>>Martin Cooper
 >>>
 >>>
 >>>
 >>>
 >>>>Thanks in advance
 >>>>
 >>>>--
 >>>>Ahmet ISIK
 >>>>Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
 >>>>Yazilim Muhendisi
 >>>>http://www.idealteknoloji.com
 >>>
 >>>
 >>>
 >>>
 >>>
 >>>-
 >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
 >>>For additional commands, e-mail: [EMAIL PROTECTED]
 >>>
 >>>
 >>
 >>
 >>--
 >>Ahmet ISIK
 >>Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
 >>Yazilim Muhendisi
 >>[EMAIL PROTECTED]
 >>http://www.idealteknoloji.com
 >
 >
 >
 >
 >
 > -
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >
 >

--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.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]



--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: declaring action mappings at runtime

2003-10-30 Thread Kirk Wylie
I know this is a little OT, but had you thought about doing it with 
xdoclet? Particularly if the Hibernate configurations are coming out of 
xdoclet in the first place (and everything's set at compile time), you 
could probably extend the Hibernate templates pretty easily to generate 
the action mappings automatically. Then you'd have everything based on 
Hibernate, done dynamically, and a faster startup time as well.

Just an idea.

Kirk Wylie
M7 Corporation
Ahmet ISIK wrote:
I'm doing it in a plugin.
My purpose is to develop generic CRUD operations, views and forms for
any model object that is persisted using Hibernate. For this, I
introspect Hibernate config and provide form fields according to
underlying object's properties.
I'm declaring actionmappings at runtime because I'm asking Hibernate for
a list of entities that are declared.
Martin Cooper wrote:
 > "Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
 > news:[EMAIL PROTECTED]
 >
 >>thanks Martin,
 >>I have found a solution. I have acquired module config by
 >>Globals.MODULE_KEY key from app context. Then I added programmatically
 >>configured ActionMappings to module config object. after that it is
 >>possible to use those action mappings. Is this a bad practice?
 >
 >
 > Where are you doing this? (And why?)
 >
 > If you're doing it in a plug-in, then I believe it will work, but I 
don't
 > see how that would be any more "dynamic" than adding them to your Struts
 > config file. (Also in that case, you are already passed the module 
config,
 > so you wouldn't need to look it up, as you mentioned you are doing.)
 >
 > If you're doing it outside of a plug-in, then I'm puzzled. Once 
Struts loads
 > the config, it freezes it and throws IllegalStateException if you 
attempt to
 > modify it.
 >
 > --
 > Martin Cooper
 >
 >
 >
 >>Martin Cooper wrote:
 >>
 >>>"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
 >>>news:[EMAIL PROTECTED]
 >>>
 >>>
 >>>>Hi,
 >>>>Is it possible to declare struts action mappings at runtime, and how?
 >>>
 >>>
 >>>No, it's not possible. The config is read in at application startup and
 >
 > is
 >
 >>>then frozen. (The reason it's done this way is so that access to the
 >
 > config
 >
 >>>does not need to be synchronised once the app is up and running, thus
 >>>leading to much improved overall performance.)
 >>>
 >>>--
 >>>Martin Cooper
 >>>
 >>>
 >>>
 >>>
 >>>>Thanks in advance
 >>>>
 >>>>--
 >>>>Ahmet ISIK
 >>>>Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
 >>>>Yazilim Muhendisi
 >>>>http://www.idealteknoloji.com
 >>>
 >>>
 >>>
 >>>
 >>>
 >>>-
 >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
 >>>For additional commands, e-mail: [EMAIL PROTECTED]
 >>>
 >>>
 >>
 >>
 >>--
 >>Ahmet ISIK
 >>Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
 >>Yazilim Muhendisi
 >>[EMAIL PROTECTED]
 >>http://www.idealteknoloji.com
 >
 >
 >
 >
 >
 > -
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >
 >

--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.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: declaring action mappings at runtime

2003-10-30 Thread Craig R. McClanahan
Ahmet ISIK wrote:

I'm doing it in a plugin.
My purpose is to develop generic CRUD operations, views and forms for 
any model object that is persisted using Hibernate. For this, I 
introspect Hibernate config and provide form fields according to 
underlying object's properties.
I'm declaring actionmappings at runtime because I'm asking Hibernate 
for a list of entities that are declared.

Modifying the configuration information in a PlugIn is specifically 
allowed, for precisely this kind of purpose.  It is safe, because 
plugins are called from the init() method of ActionServlet, and must all 
complete successfully before the first request is processed.

Struts freezes the configuration information *after* the plugins have 
been initialized; from that point on, you'll get IllegalStateExceptions 
if you try to modify existing XxxConfig beans in any way.

Craig


Martin Cooper wrote:

"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
thanks Martin,
I have found a solution. I have acquired module config by
Globals.MODULE_KEY key from app context. Then I added programmatically
configured ActionMappings to module config object. after that it is
possible to use those action mappings. Is this a bad practice?


Where are you doing this? (And why?)

If you're doing it in a plug-in, then I believe it will work, but I 
don't
see how that would be any more "dynamic" than adding them to your Struts
config file. (Also in that case, you are already passed the module 
config,
so you wouldn't need to look it up, as you mentioned you are doing.)

If you're doing it outside of a plug-in, then I'm puzzled. Once 
Struts loads
the config, it freezes it and throws IllegalStateException if you 
attempt to
modify it.

--
Martin Cooper


Martin Cooper wrote:

"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Hi,
Is it possible to declare struts action mappings at runtime, and how?


No, it's not possible. The config is read in at application startup 
and

is

then frozen. (The reason it's done this way is so that access to the

config

does not need to be synchronised once the app is up and running, thus
leading to much improved overall performance.)
--
Martin Cooper



Thanks in advance

--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
http://www.idealteknoloji.com






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



--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.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: declaring action mappings at runtime

2003-10-30 Thread Ahmet ISIK
I'm doing it in a plugin.
My purpose is to develop generic CRUD operations, views and forms for 
any model object that is persisted using Hibernate. For this, I 
introspect Hibernate config and provide form fields according to 
underlying object's properties.
I'm declaring actionmappings at runtime because I'm asking Hibernate for 
a list of entities that are declared.

Martin Cooper wrote:
"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
thanks Martin,
I have found a solution. I have acquired module config by
Globals.MODULE_KEY key from app context. Then I added programmatically
configured ActionMappings to module config object. after that it is
possible to use those action mappings. Is this a bad practice?


Where are you doing this? (And why?)

If you're doing it in a plug-in, then I believe it will work, but I don't
see how that would be any more "dynamic" than adding them to your Struts
config file. (Also in that case, you are already passed the module config,
so you wouldn't need to look it up, as you mentioned you are doing.)
If you're doing it outside of a plug-in, then I'm puzzled. Once Struts loads
the config, it freezes it and throws IllegalStateException if you attempt to
modify it.
--
Martin Cooper


Martin Cooper wrote:

"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Hi,
Is it possible to declare struts action mappings at runtime, and how?


No, it's not possible. The config is read in at application startup and
is

then frozen. (The reason it's done this way is so that access to the
config

does not need to be synchronised once the app is up and running, thus
leading to much improved overall performance.)
--
Martin Cooper



Thanks in advance

--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
http://www.idealteknoloji.com




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



--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.com




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



--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: declaring action mappings at runtime

2003-10-29 Thread Martin Cooper

"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> thanks Martin,
> I have found a solution. I have acquired module config by
> Globals.MODULE_KEY key from app context. Then I added programmatically
> configured ActionMappings to module config object. after that it is
> possible to use those action mappings. Is this a bad practice?

Where are you doing this? (And why?)

If you're doing it in a plug-in, then I believe it will work, but I don't
see how that would be any more "dynamic" than adding them to your Struts
config file. (Also in that case, you are already passed the module config,
so you wouldn't need to look it up, as you mentioned you are doing.)

If you're doing it outside of a plug-in, then I'm puzzled. Once Struts loads
the config, it freezes it and throws IllegalStateException if you attempt to
modify it.

--
Martin Cooper


>
> Martin Cooper wrote:
> > "Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>Hi,
> >>Is it possible to declare struts action mappings at runtime, and how?
> >
> >
> > No, it's not possible. The config is read in at application startup and
is
> > then frozen. (The reason it's done this way is so that access to the
config
> > does not need to be synchronised once the app is up and running, thus
> > leading to much improved overall performance.)
> >
> > --
> > Martin Cooper
> >
> >
> >
> >>Thanks in advance
> >>
> >>-- 
> >>Ahmet ISIK
> >>Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
> >>Yazilim Muhendisi
> >>http://www.idealteknoloji.com
> >
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> -- 
> Ahmet ISIK
> Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
> Yazilim Muhendisi
> [EMAIL PROTECTED]
> http://www.idealteknoloji.com




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



RE: declaring action mappings at runtime

2003-10-29 Thread Zhang, Larry (L.)
If you want to find out which will be next page to go, you can create an ActionForward 
object and customize the parameter. 

-Original Message-
From: Martin Cooper [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 29, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: Re: declaring action mappings at runtime



"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> Is it possible to declare struts action mappings at runtime, and how?

No, it's not possible. The config is read in at application startup and is
then frozen. (The reason it's done this way is so that access to the config
does not need to be synchronised once the app is up and running, thus
leading to much improved overall performance.)

--
Martin Cooper


> Thanks in advance
>
> -- 
> Ahmet ISIK
> Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
> Yazilim Muhendisi
> http://www.idealteknoloji.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: declaring action mappings at runtime

2003-10-29 Thread Ahmet ISIK
thanks Martin,
I have found a solution. I have acquired module config by 
Globals.MODULE_KEY key from app context. Then I added programmatically 
configured ActionMappings to module config object. after that it is 
possible to use those action mappings. Is this a bad practice?

Martin Cooper wrote:
"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,
Is it possible to declare struts action mappings at runtime, and how?


No, it's not possible. The config is read in at application startup and is
then frozen. (The reason it's done this way is so that access to the config
does not need to be synchronised once the app is up and running, thus
leading to much improved overall performance.)
--
Martin Cooper


Thanks in advance

--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
http://www.idealteknoloji.com




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



--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
[EMAIL PROTECTED]
http://www.idealteknoloji.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: declaring action mappings at runtime

2003-10-29 Thread Martin Cooper

"Ahmet ISIK" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> Is it possible to declare struts action mappings at runtime, and how?

No, it's not possible. The config is read in at application startup and is
then frozen. (The reason it's done this way is so that access to the config
does not need to be synchronised once the app is up and running, thus
leading to much improved overall performance.)

--
Martin Cooper


> Thanks in advance
>
> -- 
> Ahmet ISIK
> Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
> Yazilim Muhendisi
> http://www.idealteknoloji.com




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



declaring action mappings at runtime

2003-10-29 Thread Ahmet ISIK
Hi,
Is it possible to declare struts action mappings at runtime, and how?
Thanks in advance
--
Ahmet ISIK
Ideal Teknoloji Bilisim Çözümleri A.S.- Iliskisel Is Kanali
Yazilim Muhendisi
http://www.idealteknoloji.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Poll] action mappings

2003-09-30 Thread Ted Husted
I use ActionMappings to represent a use-case or client story, rather 
than an atomic operation. The form-bean and validator collect the data 
the story needs, and an Action passes those to the business layer, and 
return the outcome. The business layer class is specified as a parameter 
so that I can reuse the same standard Action for most stories.

So, I suppose my answer to this poll is I don't use ActionMappings for 
CRUD operations. I keep the CRUD crud between the business layer and the 
data access objects. Unless, of course, create/retrieve/update/delete 
were stories from the client's perspective :)

I imagine you've seen this, but ...

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

The work on the Commons Chain is coming along nicely, and we should see 
some standard Command Actions showing up that just pass a context up the 
business layer and then pass it back to the presentation layer. So, 
before long, I suspect people will be talking less about Actions and 
more about business layer Commands and Command Chains.

-Ted.

Mainguy, Mike wrote:

I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
	/createUser.do ->>  UserAction.java
	/readUser.do   ->>  UserAction.java
	/updateUser.do ->>  UserAction.java
	/deleteUser.do ->>  UserAction.java
	

#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
	/createUser.do ->>  CreateUserAction.java
	/readUser.do   ->>  ReadUserAction.java
	/updateUser.do ->>  UpdateUserAction.java
	/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
	/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
	/displayUser.do->> UserAction.java

#4  creating an aggregate action class with a unique action mapping with 
multiple operations
	/editUser.do   ->> EditUserAction.java   
	/displayUser.do->> DisplayUserAction.java

Some other way (or a combination) ...

  

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



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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



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


Re: BeanMapping WAS: [Poll] action mappings

2003-09-27 Thread Adam Hardy
Yes, it answers my question. I use the BeanUtils.copyProperties() to 
move data back and forth between my transfer objects and my dynaforms 
and I don't like doing that because

(a) it seems an unnecessary step since I'm already marshalling data into 
& out of resultsets

(b) I have to maintain the object field/member variable information in 
yet another place (UML, database schema, xml schema, struts-config (& 
possibly HTML should be on this list too))

(c) BeanUtils won't convert strings based on locale-specific information 
(yet, AFAIK though it might be in the pipeline)

re (b), when I only have to specify that in one place, I know that I 
will have died and gone to programmer heaven :)

On 09/27/2003 05:00 PM Sgarlata Matt wrote:
Hmm well I do sometimes use different types in my DynaForms, but I think I
want to move away from this practice in the future.  There was a fairly good
discussion of this in the post "[repost] Special view information ->
ActionForm or request?" starting on 9/18.
To answer your real question about using DynaForms as transfer objects, I
only use them if I am transferring data from the presentation tier down to
the business tier.  I use the DynaBean interface to do this.  It's pretty
slick how this works.  If for some reason I decide not to use DynaActionForm
at some point in the future you can make a POJO into a DynaBean by just
passing "new WrapDynaBean(pojo)".  If you want your business tier to have
things already nicely placed in the correct type you could always use
ConvertUtils to populate a strongly-typed POJO from your ActionForm.  Or if
you want to use a typed DynaBean I think you can declare your own DynaClass
or something, but I'm not really sure on all the specifics of this process.
Does that answer your question?

Matt
- Original Message - 
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, September 27, 2003 10:40 AM
Subject: Re: BeanMapping WAS: [Poll] action mappings



Hey Matt,
do you use different types in your dynaforms or do you stick to just
strings? I was wondering about using dynaforms as transfer objects like
you mention, but I only use strings, since incorrect form entries for
non-string types don't make it back into the form after validation
failure.

And I would want to have types in my transfer objects.

Adam

On 09/26/2003 10:44 PM Sgarlata Matt wrote:

- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 3:35 PM
Subject: BeanMapping WAS: [Poll] action mappings




I think your way is perfectly acceptable.  I like to try and use the
supplied interfaces (i.e. DynaBean) if they suit my needs and, to date,
DynaBean has served me well.  You can use BeanUtils to map DynaBeans to
POJO's and visa versa (as a matter of fact you can to it to/from  maps
also


I believe).


After working with DynaBeans some more, I agree with you.  I am going to
use

them as my type for transfer objects as well instead of the strategy I
outlined before where I defined my own IInputForm and IDynaInputForm
interfaces.


My only gripe with using the commons-beanutils would be that I would
perhaps


like to have a couple levels of DynaBean and perhaps at the simplest
level

only have an interface like you describe (i.e. fewer methods in
implement).

I would like to see an empty interface called
org.apache.commons.beanutils.Bean, but I can see that being a huge point
of

contention so I'm not going to press for it.

Matt

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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To 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]

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: BeanMapping WAS: [Poll] action mappings

2003-09-27 Thread Sgarlata Matt
Hmm well I do sometimes use different types in my DynaForms, but I think I
want to move away from this practice in the future.  There was a fairly good
discussion of this in the post "[repost] Special view information ->
ActionForm or request?" starting on 9/18.

To answer your real question about using DynaForms as transfer objects, I
only use them if I am transferring data from the presentation tier down to
the business tier.  I use the DynaBean interface to do this.  It's pretty
slick how this works.  If for some reason I decide not to use DynaActionForm
at some point in the future you can make a POJO into a DynaBean by just
passing "new WrapDynaBean(pojo)".  If you want your business tier to have
things already nicely placed in the correct type you could always use
ConvertUtils to populate a strongly-typed POJO from your ActionForm.  Or if
you want to use a typed DynaBean I think you can declare your own DynaClass
or something, but I'm not really sure on all the specifics of this process.

Does that answer your question?

Matt
- Original Message - 
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, September 27, 2003 10:40 AM
Subject: Re: BeanMapping WAS: [Poll] action mappings


> Hey Matt,
> do you use different types in your dynaforms or do you stick to just
> strings? I was wondering about using dynaforms as transfer objects like
> you mention, but I only use strings, since incorrect form entries for
> non-string types don't make it back into the form after validation
failure.
>
> And I would want to have types in my transfer objects.
>
> Adam
>
> On 09/26/2003 10:44 PM Sgarlata Matt wrote:
> > - Original Message - 
> > From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Thursday, September 25, 2003 3:35 PM
> > Subject: BeanMapping WAS: [Poll] action mappings
> >
> >
> >
> >>I think your way is perfectly acceptable.  I like to try and use the
> >>supplied interfaces (i.e. DynaBean) if they suit my needs and, to date,
> >>DynaBean has served me well.  You can use BeanUtils to map DynaBeans to
> >>POJO's and visa versa (as a matter of fact you can to it to/from  maps
> >
> > also
> >
> >>I believe).
> >
> >
> > After working with DynaBeans some more, I agree with you.  I am going to
use
> > them as my type for transfer objects as well instead of the strategy I
> > outlined before where I defined my own IInputForm and IDynaInputForm
> > interfaces.
> >
> >
> >>My only gripe with using the commons-beanutils would be that I would
> >
> > perhaps
> >
> >>like to have a couple levels of DynaBean and perhaps at the simplest
level
> >>only have an interface like you describe (i.e. fewer methods in
> >
> > implement).
> >
> > I would like to see an empty interface called
> > org.apache.commons.beanutils.Bean, but I can see that being a huge point
of
> > contention so I'm not going to press for it.
> >
> > Matt
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -- 
> struts 1.1 + tomcat 4.1.27 + java 1.4.2
> Linux 2.4.20 RH9
>
>
> -
> To 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: BeanMapping WAS: [Poll] action mappings

2003-09-27 Thread Adam Hardy
Hey Matt,
do you use different types in your dynaforms or do you stick to just 
strings? I was wondering about using dynaforms as transfer objects like 
you mention, but I only use strings, since incorrect form entries for 
non-string types don't make it back into the form after validation failure.

And I would want to have types in my transfer objects.

Adam

On 09/26/2003 10:44 PM Sgarlata Matt wrote:
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 3:35 PM
Subject: BeanMapping WAS: [Poll] action mappings



I think your way is perfectly acceptable.  I like to try and use the
supplied interfaces (i.e. DynaBean) if they suit my needs and, to date,
DynaBean has served me well.  You can use BeanUtils to map DynaBeans to
POJO's and visa versa (as a matter of fact you can to it to/from  maps
also

I believe).


After working with DynaBeans some more, I agree with you.  I am going to use
them as my type for transfer objects as well instead of the strategy I
outlined before where I defined my own IInputForm and IDynaInputForm
interfaces.

My only gripe with using the commons-beanutils would be that I would
perhaps

like to have a couple levels of DynaBean and perhaps at the simplest level
only have an interface like you describe (i.e. fewer methods in
implement).

I would like to see an empty interface called
org.apache.commons.beanutils.Bean, but I can see that being a huge point of
contention so I'm not going to press for it.
Matt

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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: BeanMapping WAS: [Poll] action mappings

2003-09-26 Thread Sgarlata Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 3:35 PM
Subject: BeanMapping WAS: [Poll] action mappings


> I think your way is perfectly acceptable.  I like to try and use the
> supplied interfaces (i.e. DynaBean) if they suit my needs and, to date,
> DynaBean has served me well.  You can use BeanUtils to map DynaBeans to
> POJO's and visa versa (as a matter of fact you can to it to/from  maps
also
> I believe).

After working with DynaBeans some more, I agree with you.  I am going to use
them as my type for transfer objects as well instead of the strategy I
outlined before where I defined my own IInputForm and IDynaInputForm
interfaces.

> My only gripe with using the commons-beanutils would be that I would
perhaps
> like to have a couple levels of DynaBean and perhaps at the simplest level
> only have an interface like you describe (i.e. fewer methods in
implement).

I would like to see an empty interface called
org.apache.commons.beanutils.Bean, but I can see that being a huge point of
contention so I'm not going to press for it.

Matt


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



Re: [Poll] action mappings

2003-09-25 Thread Adam Hardy
Personally I'd rather declare that validation occurs in an extra mapping 
that have to code it in my action. You lose the whole automation with 
the input as well.

So I have 2 mappings for one action - one for starting (& for when 
validation fails), and one for validation.



On 09/25/2003 11:01 PM Shane Mingins wrote:
-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
Sent: Friday, 26 September 2003 8:55 a.m.
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings
When I am using design #3 my action mappings always specify that
validate="false".  Those methods that do require validation explicitly
call
the validate method of the bean.  Those methods that do not require
validation don't call the method.  So no conditioning is needed in the
form
bean for design #3 :)
Matt


Aha!  That did not cross my mind as I played around with the different
options.  Thanks :-)
Shane

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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [Poll] action mappings

2003-09-25 Thread Shane Mingins

> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Friday, 26 September 2003 8:55 a.m.
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> When I am using design #3 my action mappings always specify that
> validate="false".  Those methods that do require validation explicitly
> call
> the validate method of the bean.  Those methods that do not require
> validation don't call the method.  So no conditioning is needed in the
> form
> bean for design #3 :)
> 
> Matt

Aha!  That did not cross my mind as I played around with the different
options.  Thanks :-)

Shane

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



Re: [Poll] action mappings

2003-09-25 Thread Sgarlata Matt
When I am using design #3 my action mappings always specify that
validate="false".  Those methods that do require validation explicitly call
the validate method of the bean.  Those methods that do not require
validation don't call the method.  So no conditioning is needed in the form
bean for design #3 :)

Matt
- Original Message - 
From: "Shane Mingins" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 4:42 PM
Subject: RE: [Poll] action mappings


> > -Original Message-
> > From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> > Sent: Friday, 26 September 2003 2:14 a.m.
> > To: Struts Users Mailing List
> > Subject: Re: [Poll] action mappings
> >
> > OK, I think I understand #1 now.  However, I still disagree with it ;)
If
> > you are using the same form bean and display components, you can define
a
> > single action mapping and thus eliminate duplicate configuration
> > information
> > in the struts-config file.
>
>
> In my case I am using style #1 because some actions require the form bean
to
> be validated and some do not.  I did not like the idea of conditioning the
> validation in the form bean validate() method.
>
> Anyone have thoughts or comments on that?
>
> Shane
>
> -
> 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: BeanMapping WAS: [Poll] action mappings

2003-09-25 Thread Craig R. McClanahan
Mainguy, Mike wrote:

I think your way is perfectly acceptable.  I like to try and use the
supplied interfaces (i.e. DynaBean) if they suit my needs and, to date,
DynaBean has served me well.  You can use BeanUtils to map DynaBeans to
POJO's and visa versa (as a matter of fact you can to it to/from  maps also
I believe).
My only gripe with using the commons-beanutils would be that I would perhaps
like to have a couple levels of DynaBean and perhaps at the simplest level
only have an interface like you describe (i.e. fewer methods in implement).
 

You'll note that org.apache.commons.beanutils.DynaBean itself is an 
interface with very few methods -- among other reasons to make it simple 
to implement in a wide variety of scenarios.  A few basic 
implementations are provided, but you don't have to feel restricted to 
them.And nothing stops you from creating an ExtendedDynaBean 
interface that adds the typesafe getter/setter APIs for use in DTO type 
applications.  I've found that use to be quite appropriate (I can have 
the type safety that a Map doesn't provide, without the extra work of 
having to write or generate a corresponding POJO class).

However, I'm against adding the extra typesafe getter/setter methods 
onto DynaActionForm itself, because you shouldn't be using them directly 
as a DTO, since it would force your back-end business logic to require 
struts.jar at compile time and run time.

Craig



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


RE: [Poll] action mappings

2003-09-25 Thread Shane Mingins
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Friday, 26 September 2003 2:14 a.m.
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> OK, I think I understand #1 now.  However, I still disagree with it ;)  If
> you are using the same form bean and display components, you can define a
> single action mapping and thus eliminate duplicate configuration
> information
> in the struts-config file. 


In my case I am using style #1 because some actions require the form bean to
be validated and some do not.  I did not like the idea of conditioning the
validation in the form bean validate() method.

Anyone have thoughts or comments on that?

Shane

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



BeanMapping WAS: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
I think your way is perfectly acceptable.  I like to try and use the
supplied interfaces (i.e. DynaBean) if they suit my needs and, to date,
DynaBean has served me well.  You can use BeanUtils to map DynaBeans to
POJO's and visa versa (as a matter of fact you can to it to/from  maps also
I believe).


My only gripe with using the commons-beanutils would be that I would perhaps
like to have a couple levels of DynaBean and perhaps at the simplest level
only have an interface like you describe (i.e. fewer methods in implement).

[OT] I guess I need to start using webmail, the disclaimer at the bottom of
all my messages is exposing all of struts-user to the risk of prosecution
(and me of termination).


-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:53 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings


Very cool :)

However, I am hesitant to depend even on DynaBean.  What if I want to use a
normal POJO bean?  Here's what I'm thinking of doing:

IInputForm.java:
public interface IInputForm { }

IDynaInputForm.java:
public itnerface IDynaInputForm extends IInputForm {
   public Object get(String name);
   public void set(String name, Object object);
   /* and maybe some other getters/setters like the
   ones in DynaActionForm */
}

MyDynaValidatorForm.java:
public MyDynaValidatorForm extends DynaValidatorForm implements
IDynaInputForm { }

Now my execute method becomes (* added for emphasis):
public List execute(*IInputForm* form, ISecurityInfo info)

Now I'm not depending on any APIs other than my own :)

What do you think?  BTW, I like that you have methods that test if a user is
in a role in your WebSecurityHolder class.  I have no clue how this didn't
occur to me earlier, and will be adding this to my API in the next few
minutes.

Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 10:28 AM
Subject: RE: [Poll] action mappings


> That is exactly the method signature I use (well, different names, but 
> exactly the concept).  I actually use
> +++
> Public string commandParameter = "ProjectAction"
> Public List commandFoo(DynaBean bean, WebSecurityHolder security) {
>   ..do stuff..
> return ArrayList (or whatever) with a bunch of DynaBeans
> }
> Public DynaBean commandFoo(DynaBean bean, WebSecurityHolder security) 
> {}
> +++
>
> Where Foo is the name of a request parameter. I have another class 
> that
acts
> as a broker and maps the request parameters to these command objects.
>
> The end result is for a request /servlet.do?ProjectAction=Foo My 
> BaseActionClass will automagically invoke the method Foo.  In 
> addition, the websecurityholder has a simple method to allow you to 
> query if the
user
> is in a specific role.
>
> The cool thing is that if you use DynaForms (or DynaValidatorForms) 
> you
can
> map a sql query straight into a DynaBean (or a list of) using 
> BeanUtils
and
> therefore get automagic form population without a lot of muss and 
> fuss.
>
> I agree that #3 is probably better, but it seems that #1 is pretty 
> popular and I want to make sure I'm not missing some significant 
> advantage to
doing
> it that way.
>
> -----Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 10:14 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
>
>
> OK, I think I understand #1 now.  However, I still disagree with it ;)  
> If you are using the same form bean and display components, you can 
> define a single action mapping and thus eliminate duplicate 
> configuration
information
> in the struts-config file.  I am a zealot when it comes to violations 
> of
the
> DRY (don't repeat yourself) principle, so in my opinion #3 is superior 
> to #1.  Before I get flamed on my strong stance here, let me just 
> mention
that
> I do understand #3 is unworkable if you need to use different form 
> beans
for
> some reason.
>
> I like your variant of DispatchAction, and will likely do something
similar
> myself soon.  So your Command class has a signature something like 
> below, right?
>
> public List execute(ActionForm form, ISecurityInfo info)
>
> One issue I have been grappling with over the last couple days is 
> whether your're really decoupling yourself from the Web by using an 
> ActionForm as your transfer object.  The ActionForm class seems pretty 
> tightly coupled
to
> the servlet API to me.  Sure its methods don't return or take as
parameters
> anything directly from the javax.servlet.* API, but it does return 
> references to things 

Re: [Poll] action mappings

2003-09-25 Thread Adam Hardy
Well to a certain extent yes I 'build the system around each atomic 
transaction the system is designed to support' but the atomic 
transactions aren't necessarily remotely atomic.

Plus they are generally use-case based from the original UML design, 
assuming it was big enough to warrant one, and I have several points 
where I need transactions. I've got one page with a list of nested beans 
where the user can edit the parent bean and copy, move or delete the 
child beans all on the same submit.

So I looked at the forest first, and then once I'd finished looking at 
it, I concentrated on the trees!

On 09/25/2003 04:50 PM Mainguy, Mike wrote:
Right, that's the way I look at it too. I guess you could call it a model or
data centric perspective of the system.   To me personally, any business
system is centered around a logical data model.  I tend to build (grow)
everything from the model out to the view.  

It seems like the perspective you are talking about is to build the system
around each atomic transaction that the system is designed to support.  This
is, to me, also a very valid way of looking at it, but, it seems like you
would end up seeing a whole bunch of trees instead of the entire forest (if
you get my drift).  

I like to be able to start out with a BIG picture and break it down into
smaller pictures until I get the level that I'm comfortable with.  It sounds
like you are more comfortable with a higher level of  (finer grained) detail
in your implementation than I am.  

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:44 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings

I just find it naturally easier to grasp what is going on with one 
Action and one form bean for each object in my model (and normally one 
factory or 'business delegate') plus a host of mappings.

On 09/25/2003 03:59 PM Mainguy, Mike wrote:

You don't have to create a different ActionClass for every Operation 
with the same display/FormBean...  I.E.  If you use the same formbean 
and display component, you don't want to also always create another 
ActionClass...

Similar to dispatchaction except you use the pathmapping instead of 
the request parameters.

I actually wrote a variant of dispatchAction that, instead of calling 
a specific execute method on my ActionClass, it maps the request to 
another Command style class that performs an operation with only the 
FormBean and a security context as the input, and a List or DynaBean 
as the output.  This let me completely decouple my data access layer 
from any web stuff and use request parameters to determine which 
business operation I was performing.

-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 9:54 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings
I think for #3 it would be silly not to use a DispatchAction or 
LookupDispatchAction, right?  It seems like you would also want 
DispatchAction or LookupDispatchAction for #1, but I really don't 
understand why people are using #1 at all.  Is there some reason 
multiple action mappings are needed for the same Action?

Matt
- Original Message -
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:47 AM
Subject: RE: [Poll] action mappings



So far the results are as follows:

#1 5
#2 1
#3 2
#4 0
I added myself to both 1 and 3 as I've done a project both ways...
Now I wonder, how does everyone determine which operation you are 
doing?  As a parameter in the action mapping?  A big case-style (if 
else) statement?

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings
I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations? Are you:
#1  creating a unique Action mapping for each atomic operation
  (potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java
#2  creating a unique Action mapping for each atmoic operation
  with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java
#3  creating an aggregate action class with a unique action mapping with
  multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> Us

RE: [Poll] action mappings

2003-09-25 Thread Richard J. Duncan
>> How is #3 different from #5?

No different if you implement #3 with a DispatchAction rather than rolling your own 
dispatcher in your action class's execute method (a good point raised in another 
comment in this thread).

Regards,
 
Rich


-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:31 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings

How is #3 different from #5?

Matt
- Original Message - 
From: "Richard J. Duncan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 10:29 AM
Subject: RE: [Poll] action mappings


What about:

#5:
A DispatchAction (struts 1.1) with a single action map entry:

/maintainUser.do?action=create ->>  MaintainUserAction.java
/maintainUser.do?action=read ->>  MaintainUserAction.java
/maintainuser.do?action=update ->>  MaintainUserAction.java
/maintainuser.do?action=delete ->>  MaintainUserAction.java


Plus associated dispatched methods to process the server side of page 
events (lookup buttons being pressed, drop down list values changing).

The DispatchAction class acts like a page controller for all events on 
the page (more like coding in a GUI application ala swing).

Regards,

Rich
___
Rich Duncan


-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 8:28 AM
To: Struts Users Mailing List
Subject: RE: [Poll] action mappings

+1. We found that #2 worked best for our current application. 

On 09/25/2003 03:42:52 AM shirishchandra.sakhare wrote:

> My choce would be  #2.
> 
> We are doing a quite a big struts project here and i have seen both the 
> approaches being used here.And from my experience,I thik that apprioach 
2 is 
> definately betetr,maintainable and leads to better code.
> 
> With approach 1, there is a lot of conditional code in action which will 
decide 
> what to do(Whether to read, or update etc. depending upon the parameter 
> passed).But with approach #2, the actions are really very lean handlers 
whic do 
> just one operation and hence immensely easy to understand as well as 
reuse.If I 
> need to show user info afater some save action somewhere else in the 
> application, I can just use ReadUserAction.java again with a different 
mapping 
> if required.
> 
> Regards,
> Shirish
> 
> -Original Message-
> From: Timo Neumann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:37 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> 
> Mainguy, Mike wrote:
> 
> I started with #1 but then switched to #2.
> As this is my first big struts project I might be wrong but I had the
> impression that #2 would be preferrable because with #1 I would have to
> repeat the action mapping as a string in my action classes.
> I saw that most of the respondents went with #1 so I wonder why they
> prefer it?
> 
> cheers,
> 
> Timo
> 
> > What are folks currently doing for action mappings in relation to CRUD
> > operations?
> > Are you:
> >
> > #1  creating a unique Action mapping for each atomic operation
> > (potentially mapped to the same action class)
> > /createUser.do ->>  UserAction.java
> > /readUser.do   ->>  UserAction.java
> > /updateUser.do ->>  UserAction.java
> > /deleteUser.do ->>  UserAction.java
> >
> >
> > #2  creating a unique Action mapping for each atmoic operation
> > with each action having a unique class
> > /createUser.do ->>  CreateUserAction.java
> > /readUser.do   ->>  ReadUserAction.java
> > /updateUser.do ->>  UpdateUserAction.java
> > /deleteUser.do ->>  DeleteUserAction.java
> >
> > #3  creating an aggregate action class with a unique action mapping 
with
> > multiple operations and using form/request variable to accomplish 
CUD
> > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > ?OP=Delete)
> > /displayUser.do->> UserAction.java
> >
> >
> > #4  creating an aggregate action class with a unique action mapping 
with
> > multiple operations
> > /editUser.do   ->> EditUserAction.java
> > /displayUser.do->> DisplayUserAction.java
> >
> >
> > Some other way (or a combination) ...
> 
> --
> F&F Computer AnwendungenTel: +49 89 51727-352
> und Unternehmensberatung GmbH   Fax: +49 89 51727-111
> Westendstr. 195 Mail: [EMAIL PROTECTED]
> D-80686 Muenchenhttp://www.ff-muenchen.de
> 
> 
> ---

RE: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
Whoops!, I goofed up my response, let me clarify.

> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
>I just find it naturally easier to grasp what is going on with one 
>Action and one form bean for each object in my model (and normally one 
>factory or 'business delegate') plus a host of mappings.

Right, that's the way I look at it too. I guess you could call it a model or
data centric perspective of the system.   To me personally, any business
system is centered around a logical data model.  I tend to build (grow)
everything from the model out to the view.  

>From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
>The point of being easy to understand is very important for a big
application especially I think.
>
>And I don't understand why u need code duplication?
>The save action after doing update if needs to read, the forward can point
to readAction ... 
>That's what we have done al over our application.So to get the same screen
, 
>always call same read action from any other save action using proper
forward...
>So this way you have 2 types of action in your system.openActions 
>and save actions .And this approach helps you to solve many other problems
as well.

It seems like the perspective YOU are talking about is to build the system
around each atomic transaction that the system is designed to support.  This
is, to me, also a very valid way of looking at it, but, it seems like you
would end up seeing a whole bunch of trees instead of the entire forest (if
you get my drift).  

I like to be able to start out with a BIG picture and break it down into
smaller pictures until I get the level that I'm comfortable with.  It sounds
like you are more comfortable with a higher level of  (finer grained) detail
in your implementation than I am.  


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




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



Re: [Poll] action mappings

2003-09-25 Thread Sgarlata Matt
Very cool :)

However, I am hesitant to depend even on DynaBean.  What if I want to use a
normal POJO bean?  Here's what I'm thinking of doing:

IInputForm.java:
public interface IInputForm { }

IDynaInputForm.java:
public itnerface IDynaInputForm extends IInputForm {
   public Object get(String name);
   public void set(String name, Object object);
   /* and maybe some other getters/setters like the
   ones in DynaActionForm */
}

MyDynaValidatorForm.java:
public MyDynaValidatorForm extends DynaValidatorForm implements
IDynaInputForm { }

Now my execute method becomes (* added for emphasis):
public List execute(*IInputForm* form, ISecurityInfo info)

Now I'm not depending on any APIs other than my own :)

What do you think?  BTW, I like that you have methods that test if a user is
in a role in your WebSecurityHolder class.  I have no clue how this didn't
occur to me earlier, and will be adding this to my API in the next few
minutes.

Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 10:28 AM
Subject: RE: [Poll] action mappings


> That is exactly the method signature I use (well, different names, but
> exactly the concept).  I actually use
> +++
> Public string commandParameter = "ProjectAction"
> Public List commandFoo(DynaBean bean, WebSecurityHolder security) {
>   ..do stuff..
> return ArrayList (or whatever) with a bunch of DynaBeans
> }
> Public DynaBean commandFoo(DynaBean bean, WebSecurityHolder security) {}
> +++
>
> Where Foo is the name of a request parameter. I have another class that
acts
> as a broker and maps the request parameters to these command objects.
>
> The end result is for a request /servlet.do?ProjectAction=Foo
> My BaseActionClass will automagically invoke the method Foo.  In addition,
> the websecurityholder has a simple method to allow you to query if the
user
> is in a specific role.
>
> The cool thing is that if you use DynaForms (or DynaValidatorForms) you
can
> map a sql query straight into a DynaBean (or a list of) using BeanUtils
and
> therefore get automagic form population without a lot of muss and fuss.
>
> I agree that #3 is probably better, but it seems that #1 is pretty popular
> and I want to make sure I'm not missing some significant advantage to
doing
> it that way.
>
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 10:14 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
>
>
> OK, I think I understand #1 now.  However, I still disagree with it ;)  If
> you are using the same form bean and display components, you can define a
> single action mapping and thus eliminate duplicate configuration
information
> in the struts-config file.  I am a zealot when it comes to violations of
the
> DRY (don't repeat yourself) principle, so in my opinion #3 is superior to
> #1.  Before I get flamed on my strong stance here, let me just mention
that
> I do understand #3 is unworkable if you need to use different form beans
for
> some reason.
>
> I like your variant of DispatchAction, and will likely do something
similar
> myself soon.  So your Command class has a signature something like below,
> right?
>
> public List execute(ActionForm form, ISecurityInfo info)
>
> One issue I have been grappling with over the last couple days is whether
> your're really decoupling yourself from the Web by using an ActionForm as
> your transfer object.  The ActionForm class seems pretty tightly coupled
to
> the servlet API to me.  Sure its methods don't return or take as
parameters
> anything directly from the javax.servlet.* API, but it does return
> references to things like the ActionServlet which clearly are dependent on
> the servlet API.  Thoughts?
>
> Matt
> - Original Message - 
> From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Thursday, September 25, 2003 9:59 AM
> Subject: RE: [Poll] action mappings
>
>
> > You don't have to create a different ActionClass for every Operation
> > with the same display/FormBean...  I.E.  If you use the same formbean
> > and
> display
> > component, you don't want to also always create another ActionClass...
> >
> > Similar to dispatchaction except you use the pathmapping instead of
> > the request parameters.
> >
> > I actually wrote a variant of dispatchAction that, instead of calling
> > a specific execute method on my ActionClass, it maps the request to
> > another Command sty

RE: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
Right, that's the way I look at it too. I guess you could call it a model or
data centric perspective of the system.   To me personally, any business
system is centered around a logical data model.  I tend to build (grow)
everything from the model out to the view.  

It seems like the perspective you are talking about is to build the system
around each atomic transaction that the system is designed to support.  This
is, to me, also a very valid way of looking at it, but, it seems like you
would end up seeing a whole bunch of trees instead of the entire forest (if
you get my drift).  

I like to be able to start out with a BIG picture and break it down into
smaller pictures until I get the level that I'm comfortable with.  It sounds
like you are more comfortable with a higher level of  (finer grained) detail
in your implementation than I am.  


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:44 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings


I just find it naturally easier to grasp what is going on with one 
Action and one form bean for each object in my model (and normally one 
factory or 'business delegate') plus a host of mappings.

On 09/25/2003 03:59 PM Mainguy, Mike wrote:
> You don't have to create a different ActionClass for every Operation 
> with the same display/FormBean...  I.E.  If you use the same formbean 
> and display component, you don't want to also always create another 
> ActionClass...
> 
> Similar to dispatchaction except you use the pathmapping instead of 
> the request parameters.
> 
> I actually wrote a variant of dispatchAction that, instead of calling 
> a specific execute method on my ActionClass, it maps the request to 
> another Command style class that performs an operation with only the 
> FormBean and a security context as the input, and a List or DynaBean 
> as the output.  This let me completely decouple my data access layer 
> from any web stuff and use request parameters to determine which 
> business operation I was performing.
> 
> 
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:54 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> 
> I think for #3 it would be silly not to use a DispatchAction or 
> LookupDispatchAction, right?  It seems like you would also want 
> DispatchAction or LookupDispatchAction for #1, but I really don't 
> understand why people are using #1 at all.  Is there some reason 
> multiple action mappings are needed for the same Action?
> 
> Matt
> - Original Message -
> From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Thursday, September 25, 2003 9:47 AM
> Subject: RE: [Poll] action mappings
> 
> 
> 
>>So far the results are as follows:
>>
>>#1 5
>>#2 1
>>#3 2
>>#4 0
>>
>>I added myself to both 1 and 3 as I've done a project both ways...
>>Now I wonder, how does everyone determine which operation you are 
>>doing?  As a parameter in the action mapping?  A big case-style (if 
>>else) statement?
>>
>>-Original Message-
>>From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
>>Sent: Tuesday, September 23, 2003 11:06 AM
>>To: [EMAIL PROTECTED]
>>Subject: [Poll] action mappings
>>
>>
>>I have yet another opinion poll for struts-user...
>>
>>What are folks currently doing for action mappings in relation to CRUD
>>operations? Are you:
>>
>>#1  creating a unique Action mapping for each atomic operation
>>(potentially mapped to the same action class)
>>/createUser.do ->>  UserAction.java
>>/readUser.do   ->>  UserAction.java
>>/updateUser.do ->>  UserAction.java
>>/deleteUser.do ->>  UserAction.java
>>
>>
>>#2  creating a unique Action mapping for each atmoic operation
>>with each action having a unique class
>>/createUser.do ->>  CreateUserAction.java
>>/readUser.do   ->>  ReadUserAction.java
>>/updateUser.do ->>  UpdateUserAction.java
>>/deleteUser.do ->>  DeleteUserAction.java
>>
>>#3  creating an aggregate action class with a unique action mapping with
>>multiple operations and using form/request variable to accomplish CUD
>>/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
>>?OP=Delete)
>>/displayUser.do->> UserAction.java
>>
>>
>>#4  creating an aggregate action class with a unique action mapping with
>

Re: [Poll] action mappings

2003-09-25 Thread Adam Hardy
I just find it naturally easier to grasp what is going on with one 
Action and one form bean for each object in my model (and normally one 
factory or 'business delegate') plus a host of mappings.

On 09/25/2003 03:59 PM Mainguy, Mike wrote:
You don't have to create a different ActionClass for every Operation with
the same display/FormBean...  I.E.  If you use the same formbean and display
component, you don't want to also always create another ActionClass...
Similar to dispatchaction except you use the pathmapping instead of the
request parameters.  

I actually wrote a variant of dispatchAction that, instead of calling a
specific execute method on my ActionClass, it maps the request to another
Command style class that performs an operation with only the FormBean and a
security context as the input, and a List or DynaBean as the output.  This
let me completely decouple my data access layer from any web stuff and use
request parameters to determine which business operation I was performing.
-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 9:54 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings

I think for #3 it would be silly not to use a DispatchAction or
LookupDispatchAction, right?  It seems like you would also want
DispatchAction or LookupDispatchAction for #1, but I really don't understand
why people are using #1 at all.  Is there some reason multiple action
mappings are needed for the same Action?
Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:47 AM
Subject: RE: [Poll] action mappings



So far the results are as follows:

#1 5
#2 1
#3 2
#4 0
I added myself to both 1 and 3 as I've done a project both ways...  
Now I wonder, how does everyone determine which operation you are 
doing?  As a parameter in the action mapping?  A big case-style (if 
else) statement?

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings
I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD 
operations? Are you:

#1  creating a unique Action mapping for each atomic operation
   (potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java
#2  creating a unique Action mapping for each atmoic operation
   with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java
#3  creating an aggregate action class with a unique action mapping with
   multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> UserAction.java
#4  creating an aggregate action class with a unique action mapping with
   multiple operations
/editUser.do   ->> EditUserAction.java
/displayUser.do->> DisplayUserAction.java
Some other way (or a combination) ...



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

delete this message immediately.



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


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


-
To unsubscr

Re: [Poll] action mappings

2003-09-25 Thread Adam Hardy
Normally a parameter in the action mapping, but other things affect it 
too, such as the cancel button.

And then a big case-style if else in my action superclass.

On 09/25/2003 03:47 PM Mainguy, Mike wrote:
So far the results are as follows:

#1 5
#2 1
#3 2
#4 0
I added myself to both 1 and 3 as I've done a project both ways...  Now I
wonder, how does everyone determine which operation you are doing?  As a
parameter in the action mapping?  A big case-style (if else) statement?
-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings

I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
	/createUser.do ->>  UserAction.java
	/readUser.do   ->>  UserAction.java
	/updateUser.do ->>  UserAction.java
	/deleteUser.do ->>  UserAction.java
	

#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
	/createUser.do ->>  CreateUserAction.java
	/readUser.do   ->>  ReadUserAction.java
	/updateUser.do ->>  UpdateUserAction.java
	/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
	/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
	/displayUser.do->> UserAction.java

#4  creating an aggregate action class with a unique action mapping with 
multiple operations
	/editUser.do   ->> EditUserAction.java   
	/displayUser.do->> DisplayUserAction.java

Some other way (or a combination) ...

  

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


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



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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [Poll] action mappings

2003-09-25 Thread shirishchandra.sakhare
The point of being easy to understand is very important for a big application 
especially I think.

And I don't understand why u need code duplication?The save action after doing update 
if needs to read, the forward can point to readAction ...
That's what we have done al over our application.So to get the same screen , always 
call same read action from any other save action using proper forward...

So this way you have 2 types of action in your system.openActions and save actions 
.And this approach helps you to solve many other problems as well.



-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 4:35 PM
To: 'Struts Users Mailing List'
Subject: RE: [Poll] action mappings


#2 and #3 are, to me, flip sides of the same coin.  Our team is really
divided over which is better.  Currently, we're using #3 and I personally
think it's the best way, but, the argument that has been made that it is
much simpler to understand the application if there is a 1 to 1 mapping and
developers can more readily see the flow of information in a class diagram.
The other advantage that has been proposed is that you can then use your
containers security mechanism to limit access based on Role without
resorting to custom code.

My point of contention is that I don't want to have 4 classes for every
single screen (1 for Create, Read, Update, and Delete) plus 4 action
mappings...  It may be ok for a simple system, but in a large system I can
see that becoming unmanageable very quickly.  Not only that, but I tend to
make my apps very stateless, so, every single request needs to use the Read
operation so I end up with a bunch of duplicate code (i.e. Update and Create
also need to perhaps call read when they are done).




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Thursday, September 25, 2003 10:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [Poll] action mappings


Thats what prompted me to vote for 2...
Why to have unnecessary have this case statement in every action?

HAve the actions as simple handlers.Performing just simple atomic operations
and acting on whatever configuration they are provided to decide navigation

Something like 

execute(){
//Getdata from form bean
//validate(if automatic validation turned off or u have special validation
requirements) //model.getData or model.updateData //may be form.setData
return mapping.findForward("success"); }


And the voing results are wrong..I have seen 2 votes to #2 including
myself..


-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 3:47 PM
To: 'Struts Users Mailing List'
Subject: RE: [Poll] action mappings


So far the results are as follows:

#1 5
#2 1
#3 2
#4 0

I added myself to both 1 and 3 as I've done a project both ways...  Now I
wonder, how does everyone determine which operation you are doing?  As a
parameter in the action mapping?  A big case-style (if else) statement?

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings


I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java


#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> UserAction.java


#4  creating an aggregate action class with a unique action mapping with 
multiple operations
/editUser.do   ->> EditUserAction.java   
/displayUser.do->> DisplayUserAction.java


Some other way (or a combination) ...

  

This message and its contents (to include attachments) are the property of
Kmart Corporation (Kmart) and may contain confidential and proprietary
information. You are hereby notified that any disclosure, copying, or
distribution of this message, or the taking of any action based on
information contained herein is strictly prohibited. Unauthorized use of
info

RE: [Poll] action mappings

2003-09-25 Thread Michael Ruppin
+1 (#3)

--- "Mainguy, Mike" <[EMAIL PROTECTED]> wrote:
> #2 and #3 are, to me, flip sides of the same coin.  Our team is really
> divided over which is better.  Currently, we're using #3 and I personally
> think it's the best way, but, the argument that has been made that it is
> much simpler to understand the application if there is a 1 to 1 mapping and
> developers can more readily see the flow of information in a class diagram.
> The other advantage that has been proposed is that you can then use your
> containers security mechanism to limit access based on Role without
> resorting to custom code.
> 
> My point of contention is that I don't want to have 4 classes for every
> single screen (1 for Create, Read, Update, and Delete) plus 4 action
> mappings...  It may be ok for a simple system, but in a large system I can
> see that becoming unmanageable very quickly.  Not only that, but I tend to
> make my apps very stateless, so, every single request needs to use the Read
> operation so I end up with a bunch of duplicate code (i.e. Update and Create
> also need to perhaps call read when they are done).
> 
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> 
> Sent: Thursday, September 25, 2003 10:25 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [Poll] action mappings
> 
> 
> Thats what prompted me to vote for 2...
> Why to have unnecessary have this case statement in every action?
> 
> HAve the actions as simple handlers.Performing just simple atomic operations
> and acting on whatever configuration they are provided to decide navigation
> 
> Something like 
> 
> execute(){
> //Getdata from form bean
> //validate(if automatic validation turned off or u have special validation
> requirements) //model.getData or model.updateData //may be form.setData
> return mapping.findForward("success"); }
> 
> 
> And the voing results are wrong..I have seen 2 votes to #2 including
> myself..
> 
> 
> -Original Message-
> From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 3:47 PM
> To: 'Struts Users Mailing List'
> Subject: RE: [Poll] action mappings
> 
> 
> So far the results are as follows:
> 
> #1 5
> #2 1
> #3 2
> #4 0
> 
> I added myself to both 1 and 3 as I've done a project both ways...  Now I
> wonder, how does everyone determine which operation you are doing?  As a
> parameter in the action mapping?  A big case-style (if else) statement?
> 
> -Original Message-----
> From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 23, 2003 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: [Poll] action mappings
> 
> 
> I have yet another opinion poll for struts-user...
> 
> What are folks currently doing for action mappings in relation to CRUD
> operations?  
> Are you:
> 
> #1  creating a unique Action mapping for each atomic operation 
> (potentially mapped to the same action class)
>   /createUser.do ->>  UserAction.java
>   /readUser.do   ->>  UserAction.java
>   /updateUser.do ->>  UserAction.java
>   /deleteUser.do ->>  UserAction.java
>   
> 
> #2  creating a unique Action mapping for each atmoic operation 
> with each action having a unique class
>   /createUser.do ->>  CreateUserAction.java
>   /readUser.do   ->>  ReadUserAction.java
>   /updateUser.do ->>  UpdateUserAction.java
>   /deleteUser.do ->>  DeleteUserAction.java
> 
> #3  creating an aggregate action class with a unique action mapping with 
> multiple operations and using form/request variable to accomplish CUD
>   /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> ?OP=Delete)
>   /displayUser.do->> UserAction.java
> 
> 
> #4  creating an aggregate action class with a unique action mapping with 
> multiple operations
>   /editUser.do   ->> EditUserAction.java   
>   /displayUser.do->> DisplayUserAction.java
> 
> 
> Some other way (or a combination) ...
> 
>   
> 
> This message and its contents (to include attachments) are the property of
> Kmart Corporation (Kmart) and may contain confidential and proprietary
> information. You are hereby notified that any disclosure, copying, or
> distribution of this message, or the taking of any action based on
> information contained herein is strictly prohibited. Unauthorized use of
> information contained herein may subject you to civil and criminal
> prosecution and penalties. If you are not the intended recipient, you sh

RE: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
#2 and #3 are, to me, flip sides of the same coin.  Our team is really
divided over which is better.  Currently, we're using #3 and I personally
think it's the best way, but, the argument that has been made that it is
much simpler to understand the application if there is a 1 to 1 mapping and
developers can more readily see the flow of information in a class diagram.
The other advantage that has been proposed is that you can then use your
containers security mechanism to limit access based on Role without
resorting to custom code.

My point of contention is that I don't want to have 4 classes for every
single screen (1 for Create, Read, Update, and Delete) plus 4 action
mappings...  It may be ok for a simple system, but in a large system I can
see that becoming unmanageable very quickly.  Not only that, but I tend to
make my apps very stateless, so, every single request needs to use the Read
operation so I end up with a bunch of duplicate code (i.e. Update and Create
also need to perhaps call read when they are done).




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Thursday, September 25, 2003 10:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [Poll] action mappings


Thats what prompted me to vote for 2...
Why to have unnecessary have this case statement in every action?

HAve the actions as simple handlers.Performing just simple atomic operations
and acting on whatever configuration they are provided to decide navigation

Something like 

execute(){
//Getdata from form bean
//validate(if automatic validation turned off or u have special validation
requirements) //model.getData or model.updateData //may be form.setData
return mapping.findForward("success"); }


And the voing results are wrong..I have seen 2 votes to #2 including
myself..


-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 3:47 PM
To: 'Struts Users Mailing List'
Subject: RE: [Poll] action mappings


So far the results are as follows:

#1 5
#2 1
#3 2
#4 0

I added myself to both 1 and 3 as I've done a project both ways...  Now I
wonder, how does everyone determine which operation you are doing?  As a
parameter in the action mapping?  A big case-style (if else) statement?

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings


I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java


#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> UserAction.java


#4  creating an aggregate action class with a unique action mapping with 
multiple operations
/editUser.do   ->> EditUserAction.java   
/displayUser.do->> DisplayUserAction.java


Some other way (or a combination) ...

  

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




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


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

Re: [Poll] action mappings

2003-09-25 Thread Sgarlata Matt
How is #3 different from #5?

Matt
- Original Message - 
From: "Richard J. Duncan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 10:29 AM
Subject: RE: [Poll] action mappings


What about:

#5:
A DispatchAction (struts 1.1) with a single action map entry:

/maintainUser.do?action=create ->>  MaintainUserAction.java
/maintainUser.do?action=read ->>  MaintainUserAction.java
/maintainuser.do?action=update ->>  MaintainUserAction.java
/maintainuser.do?action=delete ->>  MaintainUserAction.java


Plus associated dispatched methods to process the server side of page 
events (lookup buttons being pressed, drop down list values changing).

The DispatchAction class acts like a page controller for all events on 
the page (more like coding in a GUI application ala swing).

Regards,

Rich
___
Rich Duncan


-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 8:28 AM
To: Struts Users Mailing List
Subject: RE: [Poll] action mappings

+1. We found that #2 worked best for our current application. 

On 09/25/2003 03:42:52 AM shirishchandra.sakhare wrote:

> My choce would be  #2.
> 
> We are doing a quite a big struts project here and i have seen both the 
> approaches being used here.And from my experience,I thik that apprioach 
2 is 
> definately betetr,maintainable and leads to better code.
> 
> With approach 1, there is a lot of conditional code in action which will 
decide 
> what to do(Whether to read, or update etc. depending upon the parameter 
> passed).But with approach #2, the actions are really very lean handlers 
whic do 
> just one operation and hence immensely easy to understand as well as 
reuse.If I 
> need to show user info afater some save action somewhere else in the 
> application, I can just use ReadUserAction.java again with a different 
mapping 
> if required.
> 
> Regards,
> Shirish
> 
> -Original Message-
> From: Timo Neumann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:37 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> 
> Mainguy, Mike wrote:
> 
> I started with #1 but then switched to #2.
> As this is my first big struts project I might be wrong but I had the
> impression that #2 would be preferrable because with #1 I would have to
> repeat the action mapping as a string in my action classes.
> I saw that most of the respondents went with #1 so I wonder why they
> prefer it?
> 
> cheers,
> 
> Timo
> 
> > What are folks currently doing for action mappings in relation to CRUD
> > operations?
> > Are you:
> >
> > #1  creating a unique Action mapping for each atomic operation
> > (potentially mapped to the same action class)
> > /createUser.do ->>  UserAction.java
> > /readUser.do   ->>  UserAction.java
> > /updateUser.do ->>  UserAction.java
> > /deleteUser.do ->>  UserAction.java
> >
> >
> > #2  creating a unique Action mapping for each atmoic operation
> > with each action having a unique class
> > /createUser.do ->>  CreateUserAction.java
> > /readUser.do   ->>  ReadUserAction.java
> > /updateUser.do ->>  UpdateUserAction.java
> > /deleteUser.do ->>  DeleteUserAction.java
> >
> > #3  creating an aggregate action class with a unique action mapping 
with
> > multiple operations and using form/request variable to accomplish 
CUD
> > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > ?OP=Delete)
> > /displayUser.do->> UserAction.java
> >
> >
> > #4  creating an aggregate action class with a unique action mapping 
with
> > multiple operations
> > /editUser.do   ->> EditUserAction.java
> > /displayUser.do->> DisplayUserAction.java
> >
> >
> > Some other way (or a combination) ...
> 
> --
> F&F Computer AnwendungenTel: +49 89 51727-352
> und Unternehmensberatung GmbH   Fax: +49 89 51727-111
> Westendstr. 195 Mail: [EMAIL PROTECTED]
> D-80686 Muenchenhttp://www.ff-muenchen.de
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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


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



RE: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
That is exactly the method signature I use (well, different names, but
exactly the concept).  I actually use
+++
Public string commandParameter = "ProjectAction"
Public List commandFoo(DynaBean bean, WebSecurityHolder security) {
  ..do stuff..
return ArrayList (or whatever) with a bunch of DynaBeans
}
Public DynaBean commandFoo(DynaBean bean, WebSecurityHolder security) {}
+++

Where Foo is the name of a request parameter. I have another class that acts
as a broker and maps the request parameters to these command objects.

The end result is for a request /servlet.do?ProjectAction=Foo  
My BaseActionClass will automagically invoke the method Foo.  In addition,
the websecurityholder has a simple method to allow you to query if the user
is in a specific role.

The cool thing is that if you use DynaForms (or DynaValidatorForms) you can
map a sql query straight into a DynaBean (or a list of) using BeanUtils and
therefore get automagic form population without a lot of muss and fuss.

I agree that #3 is probably better, but it seems that #1 is pretty popular
and I want to make sure I'm not missing some significant advantage to doing
it that way.  

-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 10:14 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings


OK, I think I understand #1 now.  However, I still disagree with it ;)  If
you are using the same form bean and display components, you can define a
single action mapping and thus eliminate duplicate configuration information
in the struts-config file.  I am a zealot when it comes to violations of the
DRY (don't repeat yourself) principle, so in my opinion #3 is superior to
#1.  Before I get flamed on my strong stance here, let me just mention that
I do understand #3 is unworkable if you need to use different form beans for
some reason.

I like your variant of DispatchAction, and will likely do something similar
myself soon.  So your Command class has a signature something like below,
right?

public List execute(ActionForm form, ISecurityInfo info)

One issue I have been grappling with over the last couple days is whether
your're really decoupling yourself from the Web by using an ActionForm as
your transfer object.  The ActionForm class seems pretty tightly coupled to
the servlet API to me.  Sure its methods don't return or take as parameters
anything directly from the javax.servlet.* API, but it does return
references to things like the ActionServlet which clearly are dependent on
the servlet API.  Thoughts?

Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:59 AM
Subject: RE: [Poll] action mappings


> You don't have to create a different ActionClass for every Operation 
> with the same display/FormBean...  I.E.  If you use the same formbean 
> and
display
> component, you don't want to also always create another ActionClass...
>
> Similar to dispatchaction except you use the pathmapping instead of 
> the request parameters.
>
> I actually wrote a variant of dispatchAction that, instead of calling 
> a specific execute method on my ActionClass, it maps the request to 
> another Command style class that performs an operation with only the 
> FormBean and
a
> security context as the input, and a List or DynaBean as the output.  
> This let me completely decouple my data access layer from any web 
> stuff and use request parameters to determine which business operation 
> I was performing.
>
>
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:54 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
>
>
> I think for #3 it would be silly not to use a DispatchAction or 
> LookupDispatchAction, right?  It seems like you would also want 
> DispatchAction or LookupDispatchAction for #1, but I really don't
understand
> why people are using #1 at all.  Is there some reason multiple action 
> mappings are needed for the same Action?
>
> Matt
> - Original Message -----
> From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Thursday, September 25, 2003 9:47 AM
> Subject: RE: [Poll] action mappings
>
>
> > So far the results are as follows:
> >
> > #1 5
> > #2 1
> > #3 2
> > #4 0
> >
> > I added myself to both 1 and 3 as I've done a project both ways... 
> > Now I wonder, how does everyone determine which operation you are 
> > doing?  As a parameter in the action mapping?  A big case-style (if
> > else) statement?
&

RE: [Poll] action mappings

2003-09-25 Thread Richard J. Duncan
What about:

#5:
A DispatchAction (struts 1.1) with a single action map entry:

/maintainUser.do?action=create  ->>  MaintainUserAction.java
/maintainUser.do?action=read->>  MaintainUserAction.java
/maintainuser.do?action=update  ->>  MaintainUserAction.java
/maintainuser.do?action=delete  ->>  MaintainUserAction.java


Plus associated dispatched methods to process the server side of page 
events (lookup buttons being pressed, drop down list values changing).

The DispatchAction class acts like a page controller for all events on 
the page (more like coding in a GUI application ala swing).

Regards,
 
Rich
___
Rich Duncan


-Original Message-
From: Susan Bradeen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 8:28 AM
To: Struts Users Mailing List
Subject: RE: [Poll] action mappings

+1. We found that #2 worked best for our current application. 

On 09/25/2003 03:42:52 AM shirishchandra.sakhare wrote:

> My choce would be  #2.
> 
> We are doing a quite a big struts project here and i have seen both the 
> approaches being used here.And from my experience,I thik that apprioach 
2 is 
> definately betetr,maintainable and leads to better code.
> 
> With approach 1, there is a lot of conditional code in action which will 
decide 
> what to do(Whether to read, or update etc. depending upon the parameter 
> passed).But with approach #2, the actions are really very lean handlers 
whic do 
> just one operation and hence immensely easy to understand as well as 
reuse.If I 
> need to show user info afater some save action somewhere else in the 
> application, I can just use ReadUserAction.java again with a different 
mapping 
> if required.
> 
> Regards,
> Shirish
> 
> -Original Message-
> From: Timo Neumann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:37 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> 
> Mainguy, Mike wrote:
> 
> I started with #1 but then switched to #2.
> As this is my first big struts project I might be wrong but I had the
> impression that #2 would be preferrable because with #1 I would have to
> repeat the action mapping as a string in my action classes.
> I saw that most of the respondents went with #1 so I wonder why they
> prefer it?
> 
> cheers,
> 
> Timo
> 
> > What are folks currently doing for action mappings in relation to CRUD
> > operations?
> > Are you:
> >
> > #1  creating a unique Action mapping for each atomic operation
> > (potentially mapped to the same action class)
> > /createUser.do ->>  UserAction.java
> > /readUser.do   ->>  UserAction.java
> > /updateUser.do ->>  UserAction.java
> > /deleteUser.do ->>  UserAction.java
> >
> >
> > #2  creating a unique Action mapping for each atmoic operation
> > with each action having a unique class
> > /createUser.do ->>  CreateUserAction.java
> > /readUser.do   ->>  ReadUserAction.java
> > /updateUser.do ->>  UpdateUserAction.java
> > /deleteUser.do ->>  DeleteUserAction.java
> >
> > #3  creating an aggregate action class with a unique action mapping 
with
> > multiple operations and using form/request variable to accomplish 
CUD
> > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > ?OP=Delete)
> > /displayUser.do->> UserAction.java
> >
> >
> > #4  creating an aggregate action class with a unique action mapping 
with
> > multiple operations
> > /editUser.do   ->> EditUserAction.java
> > /displayUser.do->> DisplayUserAction.java
> >
> >
> > Some other way (or a combination) ...
> 
> --
> F&F Computer AnwendungenTel: +49 89 51727-352
> und Unternehmensberatung GmbH   Fax: +49 89 51727-111
> Westendstr. 195 Mail: [EMAIL PROTECTED]
> D-80686 Muenchenhttp://www.ff-muenchen.de
> 
> 
> -
> 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: [Poll] action mappings

2003-09-25 Thread shirishchandra.sakhare
Thats what prompted me to vote for 2...
Why to have unnecessary have this case statement in every action?

HAve the actions as simple handlers.Performing just simple atomic operations and 
acting on whatever configuration they are provided to decide navigation

Something like 

execute(){
//Getdata from form bean
//validate(if automatic validation turned off or u have special validation 
requirements)
//model.getData or model.updateData
//may be form.setData
return mapping.findForward("success");
}


And the voing results are wrong..I have seen 2 votes to #2 including myself..


-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 3:47 PM
To: 'Struts Users Mailing List'
Subject: RE: [Poll] action mappings


So far the results are as follows:

#1 5
#2 1
#3 2
#4 0

I added myself to both 1 and 3 as I've done a project both ways...  Now I
wonder, how does everyone determine which operation you are doing?  As a
parameter in the action mapping?  A big case-style (if else) statement?

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings


I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java


#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> UserAction.java


#4  creating an aggregate action class with a unique action mapping with 
multiple operations
/editUser.do   ->> EditUserAction.java   
/displayUser.do->> DisplayUserAction.java


Some other way (or a combination) ...

  

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




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


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



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


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



Re: [Poll] action mappings

2003-09-25 Thread Sgarlata Matt
OK, I think I understand #1 now.  However, I still disagree with it ;)  If
you are using the same form bean and display components, you can define a
single action mapping and thus eliminate duplicate configuration information
in the struts-config file.  I am a zealot when it comes to violations of the
DRY (don't repeat yourself) principle, so in my opinion #3 is superior to
#1.  Before I get flamed on my strong stance here, let me just mention that
I do understand #3 is unworkable if you need to use different form beans for
some reason.

I like your variant of DispatchAction, and will likely do something similar
myself soon.  So your Command class has a signature something like below,
right?

public List execute(ActionForm form, ISecurityInfo info)

One issue I have been grappling with over the last couple days is whether
your're really decoupling yourself from the Web by using an ActionForm as
your transfer object.  The ActionForm class seems pretty tightly coupled to
the servlet API to me.  Sure its methods don't return or take as parameters
anything directly from the javax.servlet.* API, but it does return
references to things like the ActionServlet which clearly are dependent on
the servlet API.  Thoughts?

Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:59 AM
Subject: RE: [Poll] action mappings


> You don't have to create a different ActionClass for every Operation with
> the same display/FormBean...  I.E.  If you use the same formbean and
display
> component, you don't want to also always create another ActionClass...
>
> Similar to dispatchaction except you use the pathmapping instead of the
> request parameters.
>
> I actually wrote a variant of dispatchAction that, instead of calling a
> specific execute method on my ActionClass, it maps the request to another
> Command style class that performs an operation with only the FormBean and
a
> security context as the input, and a List or DynaBean as the output.  This
> let me completely decouple my data access layer from any web stuff and use
> request parameters to determine which business operation I was performing.
>
>
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:54 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
>
>
> I think for #3 it would be silly not to use a DispatchAction or
> LookupDispatchAction, right?  It seems like you would also want
> DispatchAction or LookupDispatchAction for #1, but I really don't
understand
> why people are using #1 at all.  Is there some reason multiple action
> mappings are needed for the same Action?
>
> Matt
> - Original Message - 
> From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Thursday, September 25, 2003 9:47 AM
> Subject: RE: [Poll] action mappings
>
>
> > So far the results are as follows:
> >
> > #1 5
> > #2 1
> > #3 2
> > #4 0
> >
> > I added myself to both 1 and 3 as I've done a project both ways...
> > Now I wonder, how does everyone determine which operation you are
> > doing?  As a parameter in the action mapping?  A big case-style (if
> > else) statement?
> >
> > -----Original Message-
> > From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, September 23, 2003 11:06 AM
> > To: [EMAIL PROTECTED]
> > Subject: [Poll] action mappings
> >
> >
> > I have yet another opinion poll for struts-user...
> >
> > What are folks currently doing for action mappings in relation to CRUD
> > operations? Are you:
> >
> > #1  creating a unique Action mapping for each atomic operation
> > (potentially mapped to the same action class)
> > /createUser.do ->>  UserAction.java
> > /readUser.do   ->>  UserAction.java
> > /updateUser.do ->>  UserAction.java
> > /deleteUser.do ->>  UserAction.java
> >
> >
> > #2  creating a unique Action mapping for each atmoic operation
> > with each action having a unique class
> > /createUser.do ->>  CreateUserAction.java
> > /readUser.do   ->>  ReadUserAction.java
> > /updateUser.do ->>  UpdateUserAction.java
> > /deleteUser.do ->>  DeleteUserAction.java
> >
> > #3  creating an aggregate action class with a unique action mapping with
> > multiple operations and using form/request variable to accomplish
CUD
> > /editUser.d

RE: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
You don't have to create a different ActionClass for every Operation with
the same display/FormBean...  I.E.  If you use the same formbean and display
component, you don't want to also always create another ActionClass...

Similar to dispatchaction except you use the pathmapping instead of the
request parameters.  

I actually wrote a variant of dispatchAction that, instead of calling a
specific execute method on my ActionClass, it maps the request to another
Command style class that performs an operation with only the FormBean and a
security context as the input, and a List or DynaBean as the output.  This
let me completely decouple my data access layer from any web stuff and use
request parameters to determine which business operation I was performing.


-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 25, 2003 9:54 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings


I think for #3 it would be silly not to use a DispatchAction or
LookupDispatchAction, right?  It seems like you would also want
DispatchAction or LookupDispatchAction for #1, but I really don't understand
why people are using #1 at all.  Is there some reason multiple action
mappings are needed for the same Action?

Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:47 AM
Subject: RE: [Poll] action mappings


> So far the results are as follows:
>
> #1 5
> #2 1
> #3 2
> #4 0
>
> I added myself to both 1 and 3 as I've done a project both ways...  
> Now I wonder, how does everyone determine which operation you are 
> doing?  As a parameter in the action mapping?  A big case-style (if 
> else) statement?
>
> -Original Message-
> From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 23, 2003 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: [Poll] action mappings
>
>
> I have yet another opinion poll for struts-user...
>
> What are folks currently doing for action mappings in relation to CRUD 
> operations? Are you:
>
> #1  creating a unique Action mapping for each atomic operation
> (potentially mapped to the same action class)
> /createUser.do ->>  UserAction.java
> /readUser.do   ->>  UserAction.java
> /updateUser.do ->>  UserAction.java
> /deleteUser.do ->>  UserAction.java
>
>
> #2  creating a unique Action mapping for each atmoic operation
> with each action having a unique class
> /createUser.do ->>  CreateUserAction.java
> /readUser.do   ->>  ReadUserAction.java
> /updateUser.do ->>  UpdateUserAction.java
> /deleteUser.do ->>  DeleteUserAction.java
>
> #3  creating an aggregate action class with a unique action mapping with
> multiple operations and using form/request variable to accomplish CUD
> /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> ?OP=Delete)
> /displayUser.do->> UserAction.java
>
>
> #4  creating an aggregate action class with a unique action mapping with
> multiple operations
> /editUser.do   ->> EditUserAction.java
> /displayUser.do->> DisplayUserAction.java
>
>
> Some other way (or a combination) ...
>
>
>
> This message and its contents (to include attachments) are the 
> property of Kmart Corporation (Kmart) and may contain confidential and 
> proprietary information. You are hereby notified that any disclosure, 
> copying, or distribution of this message, or the taking of any action 
> based on information contained herein is strictly prohibited. 
> Unauthorized use of information contained herein may subject you to 
> civil and criminal prosecution and penalties. If you are not the 
> intended recipient, you
should
> delete this message immediately.
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> This message and its contents (to include attachments) are the 
> property of
Kmart Corporation (Kmart) and may contain confidential and proprietary
information. You are hereby notified that any disclosure, copying, or
distribution of this message, or the taking of any action based on
information contained herein is strictly prohibited. Unauthorized use of
information contained herein may subject you to civil and criminal
prosecution and penalties. If you are not the intended recipient, you should
delete this message immediately.
>
>
>
> -
> To unsubscribe, e-mai

Re: [Poll] action mappings

2003-09-25 Thread Sgarlata Matt
I think for #3 it would be silly not to use a DispatchAction or
LookupDispatchAction, right?  It seems like you would also want
DispatchAction or LookupDispatchAction for #1, but I really don't understand
why people are using #1 at all.  Is there some reason multiple action
mappings are needed for the same Action?

Matt
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:47 AM
Subject: RE: [Poll] action mappings


> So far the results are as follows:
>
> #1 5
> #2 1
> #3 2
> #4 0
>
> I added myself to both 1 and 3 as I've done a project both ways...  Now I
> wonder, how does everyone determine which operation you are doing?  As a
> parameter in the action mapping?  A big case-style (if else) statement?
>
> -Original Message-
> From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 23, 2003 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: [Poll] action mappings
>
>
> I have yet another opinion poll for struts-user...
>
> What are folks currently doing for action mappings in relation to CRUD
> operations?
> Are you:
>
> #1  creating a unique Action mapping for each atomic operation
> (potentially mapped to the same action class)
> /createUser.do ->>  UserAction.java
> /readUser.do   ->>  UserAction.java
> /updateUser.do ->>  UserAction.java
> /deleteUser.do ->>  UserAction.java
>
>
> #2  creating a unique Action mapping for each atmoic operation
> with each action having a unique class
> /createUser.do ->>  CreateUserAction.java
> /readUser.do   ->>  ReadUserAction.java
> /updateUser.do ->>  UpdateUserAction.java
> /deleteUser.do ->>  DeleteUserAction.java
>
> #3  creating an aggregate action class with a unique action mapping with
> multiple operations and using form/request variable to accomplish CUD
> /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> ?OP=Delete)
> /displayUser.do->> UserAction.java
>
>
> #4  creating an aggregate action class with a unique action mapping with
> multiple operations
> /editUser.do   ->> EditUserAction.java
> /displayUser.do->> DisplayUserAction.java
>
>
> Some other way (or a combination) ...
>
>
>
> This message and its contents (to include attachments) are the property of
> Kmart Corporation (Kmart) and may contain confidential and proprietary
> information. You are hereby notified that any disclosure, copying, or
> distribution of this message, or the taking of any action based on
> information contained herein is strictly prohibited. Unauthorized use of
> information contained herein may subject you to civil and criminal
> prosecution and penalties. If you are not the intended recipient, you
should
> delete this message immediately.
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> This message and its contents (to include attachments) are the property of
Kmart Corporation (Kmart) and may contain confidential and proprietary
information. You are hereby notified that any disclosure, copying, or
distribution of this message, or the taking of any action based on
information contained herein is strictly prohibited. Unauthorized use of
information contained herein may subject you to civil and criminal
prosecution and penalties. If you are not the intended recipient, you should
delete this message immediately.
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



RE: [Poll] action mappings

2003-09-25 Thread Mainguy, Mike
So far the results are as follows:

#1 5
#2 1
#3 2
#4 0

I added myself to both 1 and 3 as I've done a project both ways...  Now I
wonder, how does everyone determine which operation you are doing?  As a
parameter in the action mapping?  A big case-style (if else) statement?

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 11:06 AM
To: [EMAIL PROTECTED]
Subject: [Poll] action mappings


I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java


#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> UserAction.java


#4  creating an aggregate action class with a unique action mapping with 
multiple operations
/editUser.do   ->> EditUserAction.java   
/displayUser.do->> DisplayUserAction.java


Some other way (or a combination) ...

  

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




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


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



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



RE: [Poll] action mappings

2003-09-25 Thread Susan Bradeen
+1. We found that #2 worked best for our current application. 

On 09/25/2003 03:42:52 AM shirishchandra.sakhare wrote:

> My choce would be  #2.
> 
> We are doing a quite a big struts project here and i have seen both the 
> approaches being used here.And from my experience,I thik that apprioach 
2 is 
> definately betetr,maintainable and leads to better code.
> 
> With approach 1, there is a lot of conditional code in action which will 
decide 
> what to do(Whether to read, or update etc. depending upon the parameter 
> passed).But with approach #2, the actions are really very lean handlers 
whic do 
> just one operation and hence immensely easy to understand as well as 
reuse.If I 
> need to show user info afater some save action somewhere else in the 
> application, I can just use ReadUserAction.java again with a different 
mapping 
> if required.
> 
> Regards,
> Shirish
> 
> -Original Message-
> From: Timo Neumann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 9:37 AM
> To: Struts Users Mailing List
> Subject: Re: [Poll] action mappings
> 
> 
> Mainguy, Mike wrote:
> 
> I started with #1 but then switched to #2.
> As this is my first big struts project I might be wrong but I had the
> impression that #2 would be preferrable because with #1 I would have to
> repeat the action mapping as a string in my action classes.
> I saw that most of the respondents went with #1 so I wonder why they
> prefer it?
> 
> cheers,
> 
> Timo
> 
> > What are folks currently doing for action mappings in relation to CRUD
> > operations?
> > Are you:
> >
> > #1  creating a unique Action mapping for each atomic operation
> > (potentially mapped to the same action class)
> > /createUser.do ->>  UserAction.java
> > /readUser.do   ->>  UserAction.java
> > /updateUser.do ->>  UserAction.java
> > /deleteUser.do ->>  UserAction.java
> >
> >
> > #2  creating a unique Action mapping for each atmoic operation
> > with each action having a unique class
> > /createUser.do ->>  CreateUserAction.java
> > /readUser.do   ->>  ReadUserAction.java
> > /updateUser.do ->>  UpdateUserAction.java
> > /deleteUser.do ->>  DeleteUserAction.java
> >
> > #3  creating an aggregate action class with a unique action mapping 
with
> > multiple operations and using form/request variable to accomplish 
CUD
> > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > ?OP=Delete)
> > /displayUser.do->> UserAction.java
> >
> >
> > #4  creating an aggregate action class with a unique action mapping 
with
> > multiple operations
> > /editUser.do   ->> EditUserAction.java
> > /displayUser.do->> DisplayUserAction.java
> >
> >
> > Some other way (or a combination) ...
> 
> --
> F&F Computer AnwendungenTel: +49 89 51727-352
> und Unternehmensberatung GmbH   Fax: +49 89 51727-111
> Westendstr. 195 Mail: [EMAIL PROTECTED]
> D-80686 Muenchenhttp://www.ff-muenchen.de
> 
> 
> -
> 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: [Poll] action mappings

2003-09-25 Thread shirishchandra.sakhare
My choce would be  #2.

We are doing a quite a big struts project here and i have seen both the approaches 
being used here.And from my experience,I thik that apprioach 2 is definately 
betetr,maintainable and leads to better code.

With approach 1, there is a lot of conditional code in action which will decide what 
to do(Whether to read, or update etc. depending upon the parameter passed).But with 
approach #2, the actions are really very lean handlers whic do just one operation and 
hence immensely easy to understand as well as reuse.If I need to show user info afater 
some save action somewhere else in the application, I can just use ReadUserAction.java 
again with a different mapping if required.

Regards,
Shirish

-Original Message-
From: Timo Neumann [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 9:37 AM
To: Struts Users Mailing List
Subject: Re: [Poll] action mappings


Mainguy, Mike wrote:

I started with #1 but then switched to #2.
As this is my first big struts project I might be wrong but I had the
impression that #2 would be preferrable because with #1 I would have to 
repeat the action mapping as a string in my action classes.
I saw that most of the respondents went with #1 so I wonder why they 
prefer it?

cheers,

Timo

> What are folks currently doing for action mappings in relation to CRUD
> operations?  
> Are you:
> 
> #1  creating a unique Action mapping for each atomic operation 
> (potentially mapped to the same action class)
>   /createUser.do ->>  UserAction.java
>   /readUser.do   ->>  UserAction.java
>   /updateUser.do ->>  UserAction.java
>   /deleteUser.do ->>  UserAction.java
>   
> 
> #2  creating a unique Action mapping for each atmoic operation 
> with each action having a unique class
>   /createUser.do ->>  CreateUserAction.java
>   /readUser.do   ->>  ReadUserAction.java
>   /updateUser.do ->>  UpdateUserAction.java
>   /deleteUser.do ->>  DeleteUserAction.java
> 
> #3  creating an aggregate action class with a unique action mapping with 
> multiple operations and using form/request variable to accomplish CUD
>   /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> ?OP=Delete)
>   /displayUser.do->> UserAction.java
> 
> 
> #4  creating an aggregate action class with a unique action mapping with 
> multiple operations
>   /editUser.do   ->> EditUserAction.java   
>   /displayUser.do->> DisplayUserAction.java
> 
> 
> Some other way (or a combination) ...

-- 
F&F Computer AnwendungenTel: +49 89 51727-352
und Unternehmensberatung GmbH   Fax: +49 89 51727-111
Westendstr. 195 Mail: [EMAIL PROTECTED]
D-80686 Muenchenhttp://www.ff-muenchen.de


-
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: [Poll] action mappings

2003-09-25 Thread Timo Neumann
Mainguy, Mike wrote:

I started with #1 but then switched to #2.
As this is my first big struts project I might be wrong but I had the
impression that #2 would be preferrable because with #1 I would have to 
repeat the action mapping as a string in my action classes.
I saw that most of the respondents went with #1 so I wonder why they 
prefer it?

cheers,

Timo

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
	/createUser.do ->>  UserAction.java
	/readUser.do   ->>  UserAction.java
	/updateUser.do ->>  UserAction.java
	/deleteUser.do ->>  UserAction.java
	

#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
	/createUser.do ->>  CreateUserAction.java
	/readUser.do   ->>  ReadUserAction.java
	/updateUser.do ->>  UpdateUserAction.java
	/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
	/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
	/displayUser.do->> UserAction.java

#4  creating an aggregate action class with a unique action mapping with 
multiple operations
	/editUser.do   ->> EditUserAction.java   
	/displayUser.do->> DisplayUserAction.java

Some other way (or a combination) ...
--
F&F Computer AnwendungenTel: +49 89 51727-352
und Unternehmensberatung GmbH   Fax: +49 89 51727-111
Westendstr. 195 Mail: [EMAIL PROTECTED]
D-80686 Muenchenhttp://www.ff-muenchen.de
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Poll] action mappings

2003-09-24 Thread atta-ur rehman
Yes. I did.

Frankly, I've failed to understand the role of both
ManagedResourceBaseAction and AuthenticatedManagedResourceBaseAction
actions! Are both these action extended from DispatchAction? and
CreateUserAction extended from one of these managed resources action? or I'm
completely lost?

I'd appreicate if you could explain it for me.

ATTA


- Original Message - 
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 10:06 AM
Subject: Re: [Poll] action mappings


> Did you look at the attached text file?
>
>
> --
> James Mitchell
> Software Engineer / Struts Evangelist
> http://www.struts-atlanta.org
> 770.822.3359
> AIM:jmitchtx
>
>
>
> - Original Message - 
> From: "atta-ur rehman" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 23, 2003 12:59 PM
> Subject: Re: [Poll] action mappings
>
>
> > hi james,
> >
> > could you please explain, for a struts newbie, what do you mean by
> >
> > 
> > I'm using DispatchAction with 2 abstract base actions between my actions
> and
> > the dispatch action.  The first one has helper methods for functionality
> not
> > requiring authentication, and the second one (which extends the first)
> does
> > require authentication.
> > 
> >
> > Thanks in advance!
> >
> > ATTA
> > - Original Message - 
> > From: "James Mitchell" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 23, 2003 9:17 AM
> > Subject: Re: [Poll] action mappings
> >
> >
> > > #1 with a twist.
> > >
> > > I'm using DispatchAction with 2 abstract base actions between
> > > my actions and the dispatch action.  The first one has helper
> > > methods for functionality not requiring authentication, and
> > > the second one (which extends the first) does require authentication.
> > >
> > > By overriding the execute in the second one, it allows me
> > > additional base functionality (helper methods) and seamless
> > > session management in one place.
> > >
> > > I've attached a crude example of what I mean.
> > >
> > > --
> > > James Mitchell
> > > Software Engineer / Struts Evangelist
> > > http://www.struts-atlanta.org
> > > 770.822.3359
> > > AIM:jmitchtx
> > >
> > >
> > >
> > > - Original Message - 
> > > From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, September 23, 2003 11:05 AM
> > > Subject: [Poll] action mappings
> > >
> > >
> > > > I have yet another opinion poll for struts-user...
> > > >
> > > > What are folks currently doing for action mappings in relation to
CRUD
> > > > operations?
> > > > Are you:
> > > >
> > > > #1  creating a unique Action mapping for each atomic operation
> > > > (potentially mapped to the same action class)
> > > > /createUser.do ->>  UserAction.java
> > > > /readUser.do   ->>  UserAction.java
> > > > /updateUser.do ->>  UserAction.java
> > > > /deleteUser.do ->>  UserAction.java
> > > >
> > > >
> > > > #2  creating a unique Action mapping for each atmoic operation
> > > > with each action having a unique class
> > > > /createUser.do ->>  CreateUserAction.java
> > > > /readUser.do   ->>  ReadUserAction.java
> > > > /updateUser.do ->>  UpdateUserAction.java
> > > > /deleteUser.do ->>  DeleteUserAction.java
> > > >
> > > > #3  creating an aggregate action class with a unique action mapping
> with
> > > > multiple operations and using form/request variable to
accomplish
> > CUD
> > > > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > > > ?OP=Delete)
> > > > /displayUser.do->> UserAction.java
> > > >
> > > >
> > > > #4  creating an aggregate action class with a unique action mapping
> with
> > &g

Re: [Poll] action mappings

2003-09-24 Thread James Mitchell
Did you look at the attached text file?


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
770.822.3359
AIM:jmitchtx



- Original Message - 
From: "atta-ur rehman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 12:59 PM
Subject: Re: [Poll] action mappings


> hi james,
>
> could you please explain, for a struts newbie, what do you mean by
>
> 
> I'm using DispatchAction with 2 abstract base actions between my actions
and
> the dispatch action.  The first one has helper methods for functionality
not
> requiring authentication, and the second one (which extends the first)
does
> require authentication.
> 
>
> Thanks in advance!
>
> ATTA
> - Original Message - 
> From: "James Mitchell" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 23, 2003 9:17 AM
> Subject: Re: [Poll] action mappings
>
>
> > #1 with a twist.
> >
> > I'm using DispatchAction with 2 abstract base actions between
> > my actions and the dispatch action.  The first one has helper
> > methods for functionality not requiring authentication, and
> > the second one (which extends the first) does require authentication.
> >
> > By overriding the execute in the second one, it allows me
> > additional base functionality (helper methods) and seamless
> > session management in one place.
> >
> > I've attached a crude example of what I mean.
> >
> > --
> > James Mitchell
> > Software Engineer / Struts Evangelist
> > http://www.struts-atlanta.org
> > 770.822.3359
> > AIM:jmitchtx
> >
> >
> >
> > - Original Message ----- 
> > From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 23, 2003 11:05 AM
> > Subject: [Poll] action mappings
> >
> >
> > > I have yet another opinion poll for struts-user...
> > >
> > > What are folks currently doing for action mappings in relation to CRUD
> > > operations?
> > > Are you:
> > >
> > > #1  creating a unique Action mapping for each atomic operation
> > > (potentially mapped to the same action class)
> > > /createUser.do ->>  UserAction.java
> > > /readUser.do   ->>  UserAction.java
> > > /updateUser.do ->>  UserAction.java
> > > /deleteUser.do ->>  UserAction.java
> > >
> > >
> > > #2  creating a unique Action mapping for each atmoic operation
> > > with each action having a unique class
> > > /createUser.do ->>  CreateUserAction.java
> > > /readUser.do   ->>  ReadUserAction.java
> > > /updateUser.do ->>  UpdateUserAction.java
> > > /deleteUser.do ->>  DeleteUserAction.java
> > >
> > > #3  creating an aggregate action class with a unique action mapping
with
> > > multiple operations and using form/request variable to accomplish
> CUD
> > > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > > ?OP=Delete)
> > > /displayUser.do->> UserAction.java
> > >
> > >
> > > #4  creating an aggregate action class with a unique action mapping
with
> > > multiple operations
> > > /editUser.do   ->> EditUserAction.java
> > > /displayUser.do->> DisplayUserAction.java
> > >
> > >
> > > Some other way (or a combination) ...
> > >
> > >
> > >
> > > This message and its contents (to include attachments) are the
property
> of
> > Kmart Corporation (Kmart) and may contain confidential and proprietary
> > information. You are hereby notified that any disclosure, copying, or
> > distribution of this message, or the taking of any action based on
> > information contained herein is strictly prohibited. Unauthorized use of
> > information contained herein may subject you to civil and criminal
> > prosecution and penalties. If you are not the intended recipient, you
> should
> > delete this message immediately.
> > >
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
--
> 
>
>
> > -
> > 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: [Poll] action mappings

2003-09-23 Thread atta-ur rehman
hi james,

could you please explain, for a struts newbie, what do you mean by


I'm using DispatchAction with 2 abstract base actions between my actions and
the dispatch action.  The first one has helper methods for functionality not
requiring authentication, and the second one (which extends the first) does
require authentication.


Thanks in advance!

ATTA
- Original Message - 
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 9:17 AM
Subject: Re: [Poll] action mappings


> #1 with a twist.
>
> I'm using DispatchAction with 2 abstract base actions between
> my actions and the dispatch action.  The first one has helper
> methods for functionality not requiring authentication, and
> the second one (which extends the first) does require authentication.
>
> By overriding the execute in the second one, it allows me
> additional base functionality (helper methods) and seamless
> session management in one place.
>
> I've attached a crude example of what I mean.
>
> --
> James Mitchell
> Software Engineer / Struts Evangelist
> http://www.struts-atlanta.org
> 770.822.3359
> AIM:jmitchtx
>
>
>
> - Original Message - 
> From: "Mainguy, Mike" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 23, 2003 11:05 AM
> Subject: [Poll] action mappings
>
>
> > I have yet another opinion poll for struts-user...
> >
> > What are folks currently doing for action mappings in relation to CRUD
> > operations?
> > Are you:
> >
> > #1  creating a unique Action mapping for each atomic operation
> > (potentially mapped to the same action class)
> > /createUser.do ->>  UserAction.java
> > /readUser.do   ->>  UserAction.java
> > /updateUser.do ->>  UserAction.java
> > /deleteUser.do ->>  UserAction.java
> >
> >
> > #2  creating a unique Action mapping for each atmoic operation
> > with each action having a unique class
> > /createUser.do ->>  CreateUserAction.java
> > /readUser.do   ->>  ReadUserAction.java
> > /updateUser.do ->>  UpdateUserAction.java
> > /deleteUser.do ->>  DeleteUserAction.java
> >
> > #3  creating an aggregate action class with a unique action mapping with
> > multiple operations and using form/request variable to accomplish
CUD
> > /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> > ?OP=Delete)
> > /displayUser.do->> UserAction.java
> >
> >
> > #4  creating an aggregate action class with a unique action mapping with
> > multiple operations
> > /editUser.do   ->> EditUserAction.java
> > /displayUser.do->> DisplayUserAction.java
> >
> >
> > Some other way (or a combination) ...
> >
> >
> >
> > This message and its contents (to include attachments) are the property
of
> Kmart Corporation (Kmart) and may contain confidential and proprietary
> information. You are hereby notified that any disclosure, copying, or
> distribution of this message, or the taking of any action based on
> information contained herein is strictly prohibited. Unauthorized use of
> information contained herein may subject you to civil and criminal
> prosecution and penalties. If you are not the intended recipient, you
should
> delete this message immediately.
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>






> -
> 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: [Poll] action mappings

2003-09-23 Thread Sgarlata Matt
#3 - almost all of my actions descend from DispatchAction
- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 11:05 AM
Subject: [Poll] action mappings


> I have yet another opinion poll for struts-user...
>
> What are folks currently doing for action mappings in relation to CRUD
> operations?
> Are you:
>
> #1  creating a unique Action mapping for each atomic operation
> (potentially mapped to the same action class)
> /createUser.do ->>  UserAction.java
> /readUser.do   ->>  UserAction.java
> /updateUser.do ->>  UserAction.java
> /deleteUser.do ->>  UserAction.java
>
>
> #2  creating a unique Action mapping for each atmoic operation
> with each action having a unique class
> /createUser.do ->>  CreateUserAction.java
> /readUser.do   ->>  ReadUserAction.java
> /updateUser.do ->>  UpdateUserAction.java
> /deleteUser.do ->>  DeleteUserAction.java
>
> #3  creating an aggregate action class with a unique action mapping with
> multiple operations and using form/request variable to accomplish CUD
> /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> ?OP=Delete)
> /displayUser.do->> UserAction.java
>
>
> #4  creating an aggregate action class with a unique action mapping with
> multiple operations
> /editUser.do   ->> EditUserAction.java
> /displayUser.do->> DisplayUserAction.java
>
>
> Some other way (or a combination) ...
>
>
>
> This message and its contents (to include attachments) are the property of
Kmart Corporation (Kmart) and may contain confidential and proprietary
information. You are hereby notified that any disclosure, copying, or
distribution of this message, or the taking of any action based on
information contained herein is strictly prohibited. Unauthorized use of
information contained herein may subject you to civil and criminal
prosecution and penalties. If you are not the intended recipient, you should
delete this message immediately.
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: [Poll] action mappings

2003-09-23 Thread Adam Hardy
#1

On 09/23/2003 05:05 PM Mainguy, Mike wrote:
I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
	/createUser.do ->>  UserAction.java
	/readUser.do   ->>  UserAction.java
	/updateUser.do ->>  UserAction.java
	/deleteUser.do ->>  UserAction.java
	

#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
	/createUser.do ->>  CreateUserAction.java
	/readUser.do   ->>  ReadUserAction.java
	/updateUser.do ->>  UpdateUserAction.java
	/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
	/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
	/displayUser.do->> UserAction.java

#4  creating an aggregate action class with a unique action mapping with 
multiple operations
	/editUser.do   ->> EditUserAction.java   
	/displayUser.do->> DisplayUserAction.java

Some other way (or a combination) ...

  

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



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

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Poll] action mappings

2003-09-23 Thread James Mitchell
#1 with a twist.

I'm using DispatchAction with 2 abstract base actions between
my actions and the dispatch action.  The first one has helper
methods for functionality not requiring authentication, and
the second one (which extends the first) does require authentication.

By overriding the execute in the second one, it allows me
additional base functionality (helper methods) and seamless
session management in one place.

I've attached a crude example of what I mean.

--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
770.822.3359
AIM:jmitchtx



- Original Message - 
From: "Mainguy, Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 11:05 AM
Subject: [Poll] action mappings


> I have yet another opinion poll for struts-user...
>
> What are folks currently doing for action mappings in relation to CRUD
> operations?
> Are you:
>
> #1  creating a unique Action mapping for each atomic operation
> (potentially mapped to the same action class)
> /createUser.do ->>  UserAction.java
> /readUser.do   ->>  UserAction.java
> /updateUser.do ->>  UserAction.java
> /deleteUser.do ->>  UserAction.java
>
>
> #2  creating a unique Action mapping for each atmoic operation
> with each action having a unique class
> /createUser.do ->>  CreateUserAction.java
> /readUser.do   ->>  ReadUserAction.java
> /updateUser.do ->>  UpdateUserAction.java
> /deleteUser.do ->>  DeleteUserAction.java
>
> #3  creating an aggregate action class with a unique action mapping with
> multiple operations and using form/request variable to accomplish CUD
> /editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
> ?OP=Delete)
> /displayUser.do->> UserAction.java
>
>
> #4  creating an aggregate action class with a unique action mapping with
> multiple operations
> /editUser.do   ->> EditUserAction.java
> /displayUser.do->> DisplayUserAction.java
>
>
> Some other way (or a combination) ...
>
>
>
> This message and its contents (to include attachments) are the property of
Kmart Corporation (Kmart) and may contain confidential and proprietary
information. You are hereby notified that any disclosure, copying, or
distribution of this message, or the taking of any action based on
information contained herein is strictly prohibited. Unauthorized use of
information contained herein may subject you to civil and criminal
prosecution and penalties. If you are not the intended recipient, you should
delete this message immediately.
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

MRBA == ManagedResourceBaseAction
AMRBA == AuthenticatedManagedResourceBaseAction


This diagram may seem crude, but I hope you get the idea.
The formatting will most likely be screwed up.
All actions (except login) must extend AMRBA.


So, I have:

/createUser.do

DispatchAction   MRBAAMRBA  ManageUserAction
|
-execute()>|
   |--,
   |  |
   | isLoggedIn?
   |  |
   |<-'
   |
|<-- super.execute() --|
|  
|/createUser-->|
|  |
|  |<--getService()--->|
|  |   |
|  |   |
|  |   |--createUser()-> 
Business
|  | 
Service
|  |   |


*Note* - I do not pass return boolean or some other crappy way of dealing 
 with invalid state.  My application takes advantage of declarative 
 exception handline


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

[Poll] action mappings

2003-09-23 Thread Mainguy, Mike
I have yet another opinion poll for struts-user...

What are folks currently doing for action mappings in relation to CRUD
operations?  
Are you:

#1  creating a unique Action mapping for each atomic operation 
(potentially mapped to the same action class)
/createUser.do ->>  UserAction.java
/readUser.do   ->>  UserAction.java
/updateUser.do ->>  UserAction.java
/deleteUser.do ->>  UserAction.java


#2  creating a unique Action mapping for each atmoic operation 
with each action having a unique class
/createUser.do ->>  CreateUserAction.java
/readUser.do   ->>  ReadUserAction.java
/updateUser.do ->>  UpdateUserAction.java
/deleteUser.do ->>  DeleteUserAction.java

#3  creating an aggregate action class with a unique action mapping with 
multiple operations and using form/request variable to accomplish CUD
/editUser.do   ->> UserAction.java   (?OP=Update, ?OP=Create,
?OP=Delete)
/displayUser.do->> UserAction.java


#4  creating an aggregate action class with a unique action mapping with 
multiple operations
/editUser.do   ->> EditUserAction.java   
/displayUser.do->> DisplayUserAction.java


Some other way (or a combination) ...

  

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




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



declaring 2 'name' attributes in Action-Mappings

2003-09-01 Thread yan
is there a way to declare two 'name' attributes in the Action-Mappings
element?

I want my errors to be displayed on 2 different JSPs and which JSP is used
is dependent which JSP the action was invoked.

thanks
yan

Kickstart e Solutions. - Intelligent Web Services
[EMAIL PROTECTED]



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



Registration and action mappings

2003-08-14 Thread Erez Efrati
I have a registration wizard. In each JSP member of this wizard I have a
. 


  
  
  


Note that the scope is "session". Now I want to write the part of
editing these pages separately. Thing is I want to use the same
SignupAction (subclass of DispatchAction), but I can't use the same
action-mapping cause I need it now to be scope="request". Also, in terms
of security & roles, I need the editing and wizard-creation mode action
mappings to be different in order to set different security settings.
The signup creation is open to all, while the editing is only for logged
on users (role=User).

I don't know if it would work (I will try it) is having two  for wizard creation mode, and
 Or use javascript
to change these dynamically with onclick on the buttons.

I would really appreciate any comment here,
Erez






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



RE: Registration and action mappings

2003-08-14 Thread Bailey, Shane C.





I think I understand what you want.  I would need to know whether you are
using Validator or not (in general how validation is to be performed) to
give a better answer.




-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 6:07 AM
To: 'Struts Users Mailing List'
Subject: Registration and action mappings

I have a registration wizard. In each JSP member of this wizard I have a
. 


  
  
  


Note that the scope is "session". Now I want to write the part of
editing these pages separately. Thing is I want to use the same
SignupAction (subclass of DispatchAction), but I can't use the same
action-mapping cause I need it now to be scope="request". Also, in terms
of security & roles, I need the editing and wizard-creation mode action
mappings to be different in order to set different security settings.
The signup creation is open to all, while the editing is only for logged
on users (role=User).

I don't know if it would work (I will try it) is having two  for wizard creation mode, and
 Or use javascript
to change these dynamically with onclick on the buttons.

I would really appreciate any comment here,
Erez






-
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: login for half my action mappings, leaving other half unsecured

2003-07-17 Thread Craig R. McClanahan


On Thu, 17 Jul 2003, Adam Hardy wrote:

> Date: Thu, 17 Jul 2003 11:34:49 +0200
> From: Adam Hardy <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: login for half my action mappings, leaving other half unsecured
>
> In some of my action mappings I am providing XML output for anybody and
> it shouldn't be protected by any web.xml security-constraint, but for
> the rest, I need login security which I already have set up.
>
> What I have come up with after a slight false start is a plan to have
> all my secured requests go to /secure/*.do
>
> This way I can map the *.do to the action servlet, and I can map the
> security-constraint to the /secure/*
>
> The only doubt I have is that my action mappings in struts-config have a
> path that looks like path="/secure/dostuff" which I am not used to since
> I haven't used a pseudo-directory in my mapping path before. Is this OK,
> or am I barking up the wrong tree again?
>

No, you're doing it right, as long as you continue to map the Struts
controller servlet to the "*.do" pattern, and map your security
constraints to the "/secure/*" pattern.  The place where they overlap
(action paths within the "/secure" area) are exactly the ones that will be
protected by the constraint, while all other actions will continue to be
accessible to anyone.

> Thanks
> Adam

Craig

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



login for half my action mappings, leaving other half unsecured

2003-07-17 Thread Adam Hardy
In some of my action mappings I am providing XML output for anybody and 
it shouldn't be protected by any web.xml security-constraint, but for 
the rest, I need login security which I already have set up.

What I have come up with after a slight false start is a plan to have 
all my secured requests go to /secure/*.do

This way I can map the *.do to the action servlet, and I can map the 
security-constraint to the /secure/*

The only doubt I have is that my action mappings in struts-config have a 
path that looks like path="/secure/dostuff" which I am not used to since 
I haven't used a pseudo-directory in my mapping path before. Is this OK, 
or am I barking up the wrong tree again?

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


Re: security constraints on servlet mappings to struts action mappings

2003-07-16 Thread Adam Hardy
Oh! Well I guess that puts an end to that little plan.

Thanks anyway.

David Graham wrote:
--- Adam Hardy <[EMAIL PROTECTED]> wrote:

I just want to make sure I understand this correctly.

I have 2 different servlet mappings to the struts action servlet, e.g. 
*.do and /xml/*


See the warning here:
http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_mapping
David


If I put a security constraint on one in my web.xml, then an action 
mapping in struts via e.g. library.do would be only 1/2 protected, 
because the same action mapping via /xml/library would not be protected.

Is that always the case? I had assumed, naively it seems, that I could 
protect one half of my action mappings with a security-constraint, while

allowing free access to the other half.

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.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: security constraints on servlet mappings to struts action mappings

2003-07-16 Thread David Graham
--- Adam Hardy <[EMAIL PROTECTED]> wrote:
> I just want to make sure I understand this correctly.
> 
> I have 2 different servlet mappings to the struts action servlet, e.g. 
> *.do and /xml/*

See the warning here:
http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_mapping

David

> 
> If I put a security constraint on one in my web.xml, then an action 
> mapping in struts via e.g. library.do would be only 1/2 protected, 
> because the same action mapping via /xml/library would not be protected.
> 
> Is that always the case? I had assumed, naively it seems, that I could 
> protect one half of my action mappings with a security-constraint, while
> 
> allowing free access to the other half.
> 
> Thanks
> Adam
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



security constraints on servlet mappings to struts action mappings

2003-07-16 Thread Adam Hardy
I just want to make sure I understand this correctly.

I have 2 different servlet mappings to the struts action servlet, e.g. 
*.do and /xml/*

If I put a security constraint on one in my web.xml, then an action 
mapping in struts via e.g. library.do would be only 1/2 protected, 
because the same action mapping via /xml/library would not be protected.

Is that always the case? I had assumed, naively it seems, that I could 
protect one half of my action mappings with a security-constraint, while 
allowing free access to the other half.

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


RE: multi page forms and action mappings

2003-02-27 Thread Larry Zappeterrini
You have to define separate action mappings for each step of you form in
order for the validation to behave properly.

-Original Message-
From: Ryan Kennedy [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:09 PM
To: Struts User (E-mail)
Subject: multi page forms and action mappings


I'm using Struts 1.1 with the Validator plugin on a form with multiple
steps.
Is there a way in the action mapping to have the "input" attribute of the
"action" be based upon which step the request is coming from? If I specify
input="step1", then form validation failures on step2 go back to the step1
page.

I didn't see anything in the Validator documentation or in the list
archives,
but I can't imagine this is a new problem.

Ryan Kennedy
Software Engineer
Jel, Inc.
tel. 916.447.5463 ext. 133
fax. 916.447.5465
web. www.jel.net

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


*** 
This electronic mail transmission contains confidential and/or privileged 
information intended only for the person(s) named.  Any use, distribution, 
copying or disclosure by another person is strictly prohibited. 
*** 



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



Re: multi page forms and action mappings

2003-02-27 Thread Ruud Steeghs

Are you referring to a "whizzard-like" functionality?
In that case, I think you can use the ValidatorActionForm in stead of the 
ValidatorForm (or DynaValidatorActionForm i.s.o. DynaValidatorForm). If I'm informed 
correctly, these classes are designed for the functionality you demand for.
Cheers,
Ruud.
 
 Ryan Kennedy <[EMAIL PROTECTED]> wrote:I'm using Struts 1.1 with the Validator plugin 
on a form with multiple steps.
Is there a way in the action mapping to have the "input" attribute of the
"action" be based upon which step the request is coming from? If I specify
input="step1", then form validation failures on step2 go back to the step1
page.

I didn't see anything in the Validator documentation or in the list archives,
but I can't imagine this is a new problem.

Ryan Kennedy
Software Engineer
Jel, Inc.
tel. 916.447.5463 ext. 133
fax. 916.447.5465
web. www.jel.net

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



-
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

RE: multi page forms and action mappings

2003-02-27 Thread Sri Sankaran
Can you define an action mapping each for the various steps each of which (possibly) 
uses the same Action class.  This will allow you to specify distinct  "input" 
attributes.

Sri

-Original Message-
From: Ryan Kennedy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 2:09 PM
To: Struts User (E-mail)
Subject: multi page forms and action mappings


I'm using Struts 1.1 with the Validator plugin on a form with multiple steps. Is there 
a way in the action mapping to have the "input" attribute of the "action" be based 
upon which step the request is coming from? If I specify input="step1", then form 
validation failures on step2 go back to the step1 page.

I didn't see anything in the Validator documentation or in the list archives, but I 
can't imagine this is a new problem.

Ryan Kennedy
Software Engineer
Jel, Inc.
tel. 916.447.5463 ext. 133
fax. 916.447.5465
web. www.jel.net

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



multi page forms and action mappings

2003-02-27 Thread Ryan Kennedy
I'm using Struts 1.1 with the Validator plugin on a form with multiple steps.
Is there a way in the action mapping to have the "input" attribute of the
"action" be based upon which step the request is coming from? If I specify
input="step1", then form validation failures on step2 go back to the step1
page.

I didn't see anything in the Validator documentation or in the list archives,
but I can't imagine this is a new problem.

Ryan Kennedy
Software Engineer
Jel, Inc.
tel. 916.447.5463 ext. 133
fax. 916.447.5465
web. www.jel.net

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



Re: Action mappings, validation and tiles

2002-12-03 Thread Cedric Dumoulin

 Hello,

 See intermixed.

  Cedric

Max Johnson wrote:


Hi,

My project uses ActionMappings for everything. I want all page access to be
routed via the controller so my JSPs are hidden below /WEB-INF.

I'm using both the tiles and validator packages so a typical action mapping
looks something like this:

	

This works fine. My problem is that I initially need to present a blank form
(which fails the validation criteria set out in validation.xml). I believe
the recommended approach when all activity is routed via the controlled
requires that a second action mapping be defined. Something like:

	

My problem is that org.apache.struts.actions.ForwardAction does not like
tiles definitions as parameters. A request to /admin/UserRegistrationCreate
throws an exception:

javax.servlet.ServletException: Path .mp.userRegistration does not start
with a "/" character


 Do you have setup the TilesRequestProcessor and the TilesPlugin 
correctly ? You need the TilesPlugin, which in turn setup the 
TilesRequestProcessor, in order to catch tiles definitions.


It may be that I'm missing the point entirely here but can anyone tell me
how, when using tiles, I can temporarily disable validation to display the
preliminary entry form.


 I think you should be able to call the validation from within your 
action. So, you can do some logic detecting if you need some validation 
or not.


Regards

Max Johnson


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Action mappings, validation and tiles

2002-11-29 Thread Max Johnson
Hi,

My project uses ActionMappings for everything. I want all page access to be
routed via the controller so my JSPs are hidden below /WEB-INF.

I'm using both the tiles and validator packages so a typical action mapping
looks something like this:



This works fine. My problem is that I initially need to present a blank form
(which fails the validation criteria set out in validation.xml). I believe
the recommended approach when all activity is routed via the controlled
requires that a second action mapping be defined. Something like:



My problem is that org.apache.struts.actions.ForwardAction does not like
tiles definitions as parameters. A request to /admin/UserRegistrationCreate
throws an exception:

javax.servlet.ServletException: Path .mp.userRegistration does not start
with a "/" character

It may be that I'm missing the point entirely here but can anyone tell me
how, when using tiles, I can temporarily disable validation to display the
preliminary entry form.

Regards

Max Johnson


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Action mappings

2002-11-26 Thread Gemes Tibor
2002-11-26, k keltezéssel Mark Minnie ezt írta:
> This saves the customer phone number, but I get an error that the customer
> bean is not found in the scope null.  This is because the "success" forward
> is forwarding to /CustomerView.do with NO GET PARAMETER.  Since this get
> parameter is dynamic depending upon the customer, how do I return to the
> CustomerView.do?customerid=4 

I solve this kind of problem with session scope beans. The CustomerView
action will read from the appropriate ActionForm which is in session
scope, so untill you change the customerid it will be remembered across
requests.

Hth,

Tib


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Action mappings

2002-11-26 Thread Mark Minnie
Maybe I am missing something, but.

I have a customer form (CustomerView.do) that takes a HTTP GET parameter to
show a customer.  (ie. CustomerView.do?customerid=4).  On this customer
form, there are links to JSP pages to modify the data of the customer.  If I
wanted to add a phone number, then I would call addcustomerphonenumber.jsp.
The AddCustomerPhoneNumber.do action mapping is as follows:

 
  
  
  
 

This action populates the customer form (puts a hidden input field
containing the customer number "4") and the addcustomerphonenumber.jsp is
displayed. When the user SUBMITS the addcustomerphonenumber.jsp the
SaveAddedCustomerPhoneNumber action is called.


  
  
  


MY PROBLEM IS:
This saves the customer phone number, but I get an error that the customer
bean is not found in the scope null.  This is because the "success" forward
is forwarding to /CustomerView.do with NO GET PARAMETER.  Since this get
parameter is dynamic depending upon the customer, how do I return to the
CustomerView.do?customerid=4 

Struts is designed to have the action mappings make the MVC design be
easier.  Do I manually have to put code into
SaveAddedCustomerPhoneNumber.java to have the servlet forward the request
back to the HTTP referrer?  I would be surprised is STRUTS does not have a c
lean method to handle something like this.

Thanks for any help in advance.

Mark



RE: input required for action mappings ?

2002-10-22 Thread Andrew Hill
I dont belive its a required attribute.
Input is used to tell the ActionServlet/RequestProcessor where to send you
if your ActionForm's validate() method returns any errors. (Ie: usually back
to the jsp you input the data from)

-Original Message-
From: Marcus Biel [mailto:Marcus.Biel@;bmw.de]
Sent: Tuesday, October 22, 2002 16:07
To: [EMAIL PROTECTED]
Subject: input required for action mappings ?


I got an Action that is creating an ArrayList, when this is done,
I want to show this ArrayList in a jsp file.

In the struts-config.xml,
is input required in the action mappings ?






thanks in advance,

marcus

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




input required for action mappings ?

2002-10-22 Thread Marcus Biel
I got an Action that is creating an ArrayList, when this is done,
I want to show this ArrayList in a jsp file.

In the struts-config.xml,
is input required in the action mappings ?






thanks in advance,

marcus

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




action mappings vs Actions and config files

2002-04-12 Thread @Basebeans.com

Subject: action mappings vs Actions and config files
From: Tom Roche <[EMAIL PROTECTED]>
 ===
This may be a stupid question--it's certainly a matter of opinion--
but it has practical implications. I'm wondering, what's "more
important to Struts": Actions, action mappings, or config files?
Why I ask:

I'm part of a group working on struts tooling for eclipse

http://eclipse.org/

The rest of my group seems to think that Actions are important, and
the config file (e.g. struts-config.xml) is important. Accordingly
we're doing (among several other things) a wizard for generating
Action classes and an editor for interacting with config files. The
latter provides a template view of an action mapping, and can also
behave like a rudimentary wizard for generating new action mappings.
(Note that by "action mapping" I mean the contents of an  tag
in a config file, not the class ActionMapping.) But the thought has
been that mappings themselves aren't that important.

In working on the Action wizard I've come to believe that we've gotten
the priority reversed. It seems to me that the key functionality
provided by struts is really the runtime-configurable (or
deployment-time-configurable) action mapping: that's what links
"request space" (handled/permitted URIs) and business logic. Actions
are important, because they're at least intermediate between the
mapping and the actual business logic. (One suspects that many sites
will embed the business logic in their Actions.) And config files are
important, because they contain action mappings. But IMHO action
mappings are what's "really important."

And IMHO the practical impact of this question is for designers and
coders of UIs for struts development tools. If usability is what's
really important for toolsets, and action mappings are what's really
important to struts, then

* one should have tools (e.g. wizards and editors) "for mappings,"
   i.e. in which the mapping is the central abstraction. All mappings
   for a project could be viewed from such tools, regardless of the
   config file(s) in which they are stored. (I will admit to being
   unsure why one would want to have more than one config file per
   project, but I suspect there are good reasons. For the moment, our
   Struts Project Wizard creates only one config file.)

* mapping tools would provide users with means to generate Action
   classes. E.g. a mapping wizard would prompt the user for a type=.
   The user could browse to an existing class, or enter a new one. If
   the class did not exist, the user would be asked if they wanted to
   create it; if yes, the Action wizard would be launched. Action
   wizards would NOT generate mappings.

* mapping tools would provide users with means to generate config
   files. So, e.g. one's mapping wizard would give the user the
   opportunity to specify the path to a file in which to store a
   mapping (new or existing); if the path did not exist, the user would
   be asked if they wanted to create the file. Config-file editors
   would provide some means to launch a mapping wizard.

But if Actions and config files are what's really important to struts,
then

* one should have tools (e.g. wizards and editors) specialized for
   Actions and config files, and secondarily (if at all) for mappings.
   A mappings should be interacted with only in the context of the config
   file in which it is stored.

* config-file tools should provide some means to generate new action
   mappings to be contained within specific config files. E.g. a config
   file editor would provide a pane or tab for viewing action mappings
   (along with formbeans, global forwards, etc), with a New button that
   would generate a new empty mapping. (Or, given the apparent
   complexity of mappings, call a mapping wizard. But if you need a
   mapping wizard anyway ...)

* Action tools should perhaps provide some means to generate a mapping
   referencing the generated Action, or leave this to be done via an
   editor.

Anyway, that's why I'm wondering. Does either position seem
reasonable? Is another even more compelling? (Does anyone care ?-)

Feel free to respond directly to me, [EMAIL PROTECTED]


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




Re: action mappings and ActionMapping

2002-04-12 Thread @Basebeans.com

Subject: Re: action mappings and ActionMapping
From: Tom Roche <[EMAIL PROTECTED]>
 ===
I should have looked at the DTD first. However, if anyone's got
pointers to documentation that's more usable than

http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd

I'd appreciate such pointers. (It's pretty readable, as DTDs go.)


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




action mappings and ActionMapping

2002-04-12 Thread @Basebeans.com

Subject: action mappings and ActionMapping
From: Tom Roche <[EMAIL PROTECTED]>
 ===
What attributes can an "action mapping" have? Why I ask:

I'm working on an eclipse wizard for doing Action classes. Formerly it
just wrote (a simple) subclass of Action from a template. (Soon I
should do templates for the Direct Known Subclasses.) Now I also write
a simple "action mapping" to a config file (e.g. struts-config.xml).
Note that by "action mapping" I mean the contents of an  tag
in a config file, not the class ActionMapping.

But I suspect they are linked. I formerly thought I understood the
structure of action mappings, because I had read

http://jakarta.apache.org/struts/userGuide/building_controller.html#config

and the preceding section

http://jakarta.apache.org/struts/userGuide/building_controller.html#actionmapping

But then I notice that

http://jakarta.apache.org/struts/userGuide/building_controller.html#actionmapping
 > 
 >path="/logon"
 > type="org.apache.struts.example.LogonAction"
 > name="logonForm"
 >scope="request"
 >input="/logon.jsp"
 >  unknown="false"
 > validate="true" />
 > 

uses two attributes not mentioned above, and that (emphasis added)

http://jakarta.apache.org/struts/userGuide/building_controller.html#config
 > The required knowledge has been encapsulated in a Java interface
 > named ActionMapping, the MOST IMPORTANT properties are as follows:

Then I notice that, because it extends ...config.ActionConfig,
...action.ActionMapping has a bazillion fields. (Also I notice that

http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionMapping.html
 > NOTE - This class would have been deprecated and replaced by
 > org.apache.struts.config.ActionConfig except for the fact that it is
 > part of the public API that existing applications are using.

but that's another issue.)

So I'm wondering:

* Can any field of ActionMapping be used as an attribute of an action
   mapping?

* Is there any better documentation of the structure and use of action
   mappings than the Struts User's Guide?


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




Design question - action mappings

2002-04-09 Thread jfc100

Hi,

I am new to struts and am busy reading the various articles and 
tutorials and have a question regarding relationship between action 
mappings and request/session scopes.

Should an ActionMapping (i.e. a mapping defined in struts-config.xml) 
have a one-to-one relationship with a request or should it be reused 
many times within session scope? Or another way to ask the question 
would be within a storyboard, how many mapping objects should typically 
be designed to support that story.

Is there a design theory about how to do this? Do I have one action 
mapping for inserting a user's registration details and a seperate 
action mapping for editing them?

I am building a typical web app with membership-based users(with 
authentication and authorization) and a catalog/inventory browse/search 
facility as the key modules.

Thanks!
Joe



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




Struts Action Mappings/ Action configuration properties

2002-04-01 Thread @Basebeans.com

Subject: Struts Action Mappings/ Action configuration properties
From: "Jim Poulsen" <[EMAIL PROTECTED]>
 ===
I just completed my first Struts based web application and have a few things
that i would like to bring up to see what people think of them.

I had to override the ActionServlet implementation so that the Action
instances would be mapped by 'path' name and not by 'class name'.  I was
deploying the same Action class several times in my struts-config file and
the original ActionServlet implementation was mapping them over one another
in the Action map.  This seems bad.

Also, it would be very helpful to be able to specify Action instance
specific properties in the struts-config file.  This seems to be a major
hindrance to the re-use of Action classes for different purposes.  I got
around this limitation by adding forward mappings to my actions mappings in
the struts-config file that contained property information in the 'path'
attribute.  This is a nice workaround and seems to work fine.

just my 2 cents worth. anybody else have these issues?




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




RE: Newbie question. Can action mappings intercept requests that are not part of forms?

2002-03-08 Thread Phil Rice

Thank you, that solved the problem

Phil Rice

-Original Message-
From: Kanoza, Douglas (NCI) [mailto:[EMAIL PROTECTED]]
Sent: 07 March 2002 21:23
To: 'Struts Users Mailing List'
Subject: RE: Newbie question. Can action mappings intercept requests
that are not part of forms?


If you've done your *.do extension mapping in web.xml, you just need to
append '.do' to the page parameter:


  


-Original Message-
From: Phil Rice [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 07, 2002 4:21 PM
To: [EMAIL PROTECTED]
Subject: Newbie question. Can action mappings intercept requests that are
not part of forms?

The problem:
I am trying to make a "logout" button work by proving a link:


  


Things I have tried
I have tried a number of variations of the following part of
struts-config.xml:


  


When I try and use the link above, the address browser of the browser shows
"/logout" as the last part of the url and LogoutAction is not executed.
I have managed to get LogoutAction to execute by creating a form, and
submitting the form.
I have fairly sure this is not a simple capitalisation problem
I have looked in the FAQ and the mailing archives.

Summary
Is there a way to intercept a hypertext link, rather than a post?

Thanks

Phil Rice

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


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




RE: Newbie question. Can action mappings intercept requests that are not part of forms?

2002-03-07 Thread Kanoza, Douglas (NCI)

If you've done your *.do extension mapping in web.xml, you just need to
append '.do' to the page parameter:


  


-Original Message-
From: Phil Rice [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, March 07, 2002 4:21 PM
To: [EMAIL PROTECTED]
Subject: Newbie question. Can action mappings intercept requests that are
not part of forms?

The problem:
I am trying to make a "logout" button work by proving a link:


  


Things I have tried
I have tried a number of variations of the following part of
struts-config.xml:


  


When I try and use the link above, the address browser of the browser shows
"/logout" as the last part of the url and LogoutAction is not executed.
I have managed to get LogoutAction to execute by creating a form, and
submitting the form.
I have fairly sure this is not a simple capitalisation problem
I have looked in the FAQ and the mailing archives.

Summary
Is there a way to intercept a hypertext link, rather than a post?

Thanks

Phil Rice

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




Newbie question. Can action mappings intercept requests that are not part of forms?

2002-03-07 Thread Phil Rice

The problem:
I am trying to make a "logout" button work by proving a link:


  


Things I have tried
I have tried a number of variations of the following part of
struts-config.xml:


  


When I try and use the link above, the address browser of the browser shows
"/logout" as the last part of the url and LogoutAction is not executed.
I have managed to get LogoutAction to execute by creating a form, and
submitting the form.
I have fairly sure this is not a simple capitalisation problem
I have looked in the FAQ and the mailing archives.

Summary
Is there a way to intercept a hypertext link, rather than a post?

Thanks

Phil Rice



Re: Action mappings and request parameters

2002-03-03 Thread Muralidhar_BR



Hi,
try using

Regards,
Murali




"yogesh b" <[EMAIL PROTECTED]> on 04/03/2002 05:13:16

Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:(bcc: Muralidhar BR/India/KINDLE)
Subject:  Re: Action mappings and request parameters




Hi,
You can try this in your action class to forward with request param.

  ActionForward forward = mapping.findForward("errNoCurrentObject");
  StringBuffer buffer = new StringBuffer(forward.getPath());
  buffer.append("?type=internal&reason=errNoCurrentObject")
  return new ActionForward(buffer.toString(),
forward.getRedirect());

Yogesh
- Original Message -
From: "Bryan P. Glennon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 03, 2002 10:11 PM
Subject: Action mappings and request parameters


Hi -
I can't seem to specify more that one request parameter in my action
mapping entries in the struts-config.xml file. I want to do something
like this:

 
 
 
...

When my app loads, however, I get a load exception:

org.xml.sax.SAXParseException: Next character must be ";" terminating
reference to entity "reason".

I have tried escaping the ampersand, but no joy there either. Is
there a way to do this? Or a better approach?

Thanks,
Bryan

--
Bryan Glennon (mailto:[EMAIL PROTECTED])
BPG Consulting, Inc. (http://www.bpgc.com)
Tech Question? (mailto:[EMAIL PROTECTED])

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



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









**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.Kindlesystems.com
**

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




Re: Action mappings and request parameters

2002-03-03 Thread yogesh b

Hi,
You can try this in your action class to forward with request param.

  ActionForward forward = mapping.findForward("errNoCurrentObject");
  StringBuffer buffer = new StringBuffer(forward.getPath());
  buffer.append("?type=internal&reason=errNoCurrentObject")
  return new ActionForward(buffer.toString(),
forward.getRedirect());

Yogesh
- Original Message -
From: "Bryan P. Glennon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 03, 2002 10:11 PM
Subject: Action mappings and request parameters


Hi -
I can't seem to specify more that one request parameter in my action
mapping entries in the struts-config.xml file. I want to do something
like this:

 
 
 
...

When my app loads, however, I get a load exception:

org.xml.sax.SAXParseException: Next character must be ";" terminating
reference to entity "reason".

I have tried escaping the ampersand, but no joy there either. Is
there a way to do this? Or a better approach?

Thanks,
Bryan

--
Bryan Glennon (mailto:[EMAIL PROTECTED])
BPG Consulting, Inc. (http://www.bpgc.com)
Tech Question? (mailto:[EMAIL PROTECTED])

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



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




Re: Action mappings and request parameters

2002-03-03 Thread Pavel Kolesnikov

On Sun, 3 Mar 2002, Bryan P. Glennon wrote:

> mapping entries in the struts-config.xml file. I want to do something
> like this:
> 
>   path="/error.jsp?type=internal&reason=errNoCurrentObject"/>
>
> When my app loads, however, I get a load exception:
> 
> org.xml.sax.SAXParseException: Next character must be ";" terminating
> reference to entity "reason".

try to use the entity instead of ampersand:



pavel




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Action mappings and request parameters

2002-03-03 Thread Bryan P. Glennon

Hi -
I can't seem to specify more that one request parameter in my action
mapping entries in the struts-config.xml file. I want to do something
like this:

 
 
 
...

When my app loads, however, I get a load exception:

org.xml.sax.SAXParseException: Next character must be ";" terminating
reference to entity "reason".

I have tried escaping the ampersand, but no joy there either. Is
there a way to do this? Or a better approach?

Thanks,
Bryan

--
Bryan Glennon (mailto:[EMAIL PROTECTED])
BPG Consulting, Inc. (http://www.bpgc.com)
Tech Question? (mailto:[EMAIL PROTECTED])

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Published interfaces for action mappings?

2002-01-30 Thread Jason Stiefel

List-

I'm looking for ideas on implementing a published interface for action
mappings. By publishing an interface, I mean to define (preferably in the
action mapping itself) what parameters the action class is expecting to be
available, to avoid having to scan through the class to determine what
parameters it is expecting in the request. I've recently discovered the
 tag (I'm always the last to know.) for defining attributes of
a mapping outside the struts-config DTD.

After playing around with the idea for a few hours, I came up with the
following:

Extended mapping-
---
First step is to extend the ActionMapping class. In addition to the stand
action mapping properties and method, you will define a bean pattern for
property "params". Because there are N-number of params possible, the
implementation of this property would be something like:

< ExtendedActionMapping.java >
public class ExtendedActionMapping extends ActionMapping {
protected ArrayList params = new ArrayList();
public void setParams(String value) {
params.add(value);
}
public String[] getParams() {
return (params.toArray(new String[params.size()]));
}
}
< / ExtendedActionMapping.java >

The web.xml for your action servlet should be modified to specify this class
for your action mapping. Now that you've got this mapping set, the digester
can process a mapping like:





Dynamic params-
---
Because the set-property interface allows you to specify only a property and
it's string value, it's necessary to provide a means to define more detail
about your params. For example- your param could be expected as a request
parameter, or possibly as a property of a session-scoped form bean
unassociated with the mapping you are defining. It would also be nice if the
actual param values were provided to the action instead of just the name of
the variables.

So- instead of using  to declare just the variable name, we
get a little fancy. We'll use an expression which can be matched to an RE
pattern. For example, my action below is expecting a parameter (in the
request scope) called "locationId":






This string/expression "request{locationId}" will be available as a param in
the mapping instance. What good does that do us you might ask? Well, we'll
need to examine this "expression" and somehow retrieve the value it refers
to. To accomplish this, we'll need to sub-class a base action which has
implemented functionality to deal with these expressions. To help us parse
the expressions we have the following classes:

Params - a collection of Param instances. Params implements a "findParam"
method which matches an expression to a param instance:
findParam(expression) returns a Param

Param - an interface defining 2 methods:
getPattern()- returns a regular expression pattern which matches
expressions this param is capable of handling
getValue(expression, request)- parses the expression and uses the
request scope to retrieve the param value from
whatever source necessary.

Here's a param example:

public class RequestParam implements Param {
protected String pattern = "^request{([A-Za-z]*)}$";
public String getPattern() { return this.pattern; }
public String getName(expression) {
RE re = new RE(getPattern());
re.match(expression);
return (re.getParen(1));
}
public String getValue(String expression, HttpRequest request) {
RE re = new RE(getPattern());
re.match(expression);
String paramName = re.getParen(1);
return (request.getParameter(paramName));
 }
}

The pattern for this class ("^request{([A-Za-z]*)}$") will match an
expression like: "request{locationId}". The responsibility of the Params
instance is to match this class with the defined param. Our RequestParam
class is then capable of parsing this expression to determine the name of
the desired request parameter. A similar implementation of this would be to
retrieve properties of form beans using a pattern like: "form{FORM-NAME,
PROPERTY}". Within the FormBeanParam class we would parse the expression to
determine that form bean name and the desired property. We could then use
the PropertyUtils to retrieve this value.

BaseAction-

So back to our BaseAction implementation. The BaseAction will hold an
instance of the params collection. By placing the base action first in the
execution chain (i.e. by defining execute(mapping, form, request, response))
we have our processing hook. So we perform something like this:

public class BaseAction extends Action {

protected Params params = new Params();
public BaseAction() {
params.addParam(new RequestParam());
params.addParam(new FormBeanParam());
}

public ActionForward execute(mapping, fo

Problem with forward tag in struts-config.xml Action Mappings.

2001-09-25 Thread John Bowen


  Hi,

  I just moved my directory structure around for a previously working Struts
app and am having problems with the action mapping forward tags.

  Previously all of my JSPs and struts-config.xml were running in the same
webapps directory [/webapps/cowboy].

  Now my struts-config.xml is now at the bottom level of the directory
[inside /webapps/cowboy/WEB-INF] and my strut-ized JSP pages are running out
of a subdirectory [/webapps/cowboy/ranch/*.jsp].

  I'm mapping by extension:
  
action
*.do
  

  Here's my revised action mapping [all I changed was adding the /ranch
directories to the input and path]:

  

  

  ... when I try to execute http://www.animalfeed.com/horsey.do I get 404
/gluefactory.jsp was not found on this server.

  I find it odd that the 404 doesn't also include the /ranch in the error.
I've tried removing the /ranch in the  tag but I get the exact same
404.

  Any ideas what else I can try?

  Thanks...
  - John




Re: Extra path info and action mappings

2001-07-30 Thread Craig R. McClanahan

Tim,

What servlet container are you trying this on?  Your assumptions about
what is *supposed* to work are correct (with one minor correction -- the
extra path info will be "/user" instead of "user"), so it could be either
a bug in Struts or a bug in the servlet container you are running on.

Craig McClanahan


On Thu, 12 Jul 2001, Tim Trentham wrote:

> I'm trying to use extra path info as a way to pass parameters to my actions.
> I changed the mapping from the default *.do to something like /execute/*.
> This works fine except that if I add extra information and try to submit, I
> get a 400 error telling me that I have submitted an invalid path.
> 
> For example, I had a mapping called show.do which has now been changed to
> /execute/show. Now, if I try to submit /execute/show/user, expecting to have
> "user" passed to the show servlet as part of the extra path info accessed by
> request.getPathInfo(), I get the invalid path error. It works if I add
> another action mapping in the struts-config.xml that looks like this
> 
> 
>  
> 
> 
> This means that I have to have a separate action mapping for each different
> thing that I'd like an action to perform even though they're using the same
> action.
> 
> I was expecting to be able to have something like this in the
> struts-config.xml:
> 
> 
>  
>  
> 
> 
> Instead, I have to do this:
> 
> 
>  
> 
> 
> 
>  
> 
> 
> The idea behind this is that I can have one action that basically just
> passes through the extra path info and forwards to the correct page based on
> that info.
> 
> Is there another way to set this up so that you don't have to have an action
> mapping that matches the extra path info?
> 
> Thanks.
> 
> Tim
> 
> 
> Tim Trentham
> [EMAIL PROTECTED]
> 
> 




Re: Forwarding/redirecting to action mappings rather than directly to JSPs

2001-07-30 Thread Jim

Matt

Yes I did use global forwards exactly as you say, although it should work
equally well with mapping level forwards. I'm not sure how to advise you
without knowing what you're trying to do. My problem was a sidebar menu
which needed to submit changes on the current page, and then to initialise
and load the new page whose menu link was clicked, so I needed global
forwards as I would not know from which mapping the request came from. My
processing after clicking the menu went like this...

...using Javascipt on menu link...
1.) Populate hidden form field (called 'forward') on current page with
forward name coresponding to clicked link.
2.) Submit current page.
...at the end of each page action...
3.) Remove any current mapping from the request using the following line:
'request.removeAttribute(Action.MAPPING_KEY);' without this, an infinate
loop occurs followed by a stack overflow  - because the setting of the new
action mapping by the action servlet fails (don't ask me why).
4.) Return the global forward as named by th forward field using the
following line: 'return (mapping.findForward(forward))'.




- Original Message -
From: "Matt Raible" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 24, 2001 3:57 PM
Subject: Re: Forwarding/redirecting to action mappings rather than directly
to JSPs


> Jim, did this solution involve using a global forward or just using
something
> like the following:
>
> 
>
> Please post samples - thanks for your help!
>
> Matt
>
> --- Jim <[EMAIL PROTECTED]> wrote:
> > Matt
> >
> > I got my code to work by removing the mapping from the request before
> > forwarding from my action classes with the following line
> >
> > request.removeAttribute(Action.MAPPING_KEY);
> >
> > Prior to that it seemed that the previous mapping was not being
overwritten
> > by the ActionServlet.
> >
> > Hope this helps
> >
> > Jim
> >   - Original Message -
> >   From: Matt Raible
> >   To: [EMAIL PROTECTED]
> >   Sent: Friday, July 20, 2001 4:51 AM
> >   Subject: Forwarding/redirecting to action mappings rather than
directly to
> > JSPs
> >
> >
> >   Jim,
> >
> >
> >
> >   Did you ever get this post figured out - I'm having a similar problem
with
> > iPlanet.
> >
> >
> >
> >
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11046.html
> >
> >
> >
> >   Thanks,
> >
> >
> >
> >   Matt
> >
> >
>
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>



Re: Forwarding/redirecting to action mappings rather than directly to JSPs

2001-07-24 Thread Matt Raible

Jim, did this solution involve using a global forward or just using something
like the following:



Please post samples - thanks for your help!

Matt

--- Jim <[EMAIL PROTECTED]> wrote:
> Matt
> 
> I got my code to work by removing the mapping from the request before
> forwarding from my action classes with the following line
> 
> request.removeAttribute(Action.MAPPING_KEY);
> 
> Prior to that it seemed that the previous mapping was not being overwritten
> by the ActionServlet.
> 
> Hope this helps
> 
> Jim
>   - Original Message - 
>   From: Matt Raible 
>   To: [EMAIL PROTECTED] 
>   Sent: Friday, July 20, 2001 4:51 AM
>   Subject: Forwarding/redirecting to action mappings rather than directly to
> JSPs
> 
> 
>   Jim,
> 
>
> 
>   Did you ever get this post figured out - I'm having a similar problem with
> iPlanet.
> 
>
> 
>   http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11046.html
> 
>
> 
>   Thanks,
> 
>
> 
>   Matt
> 
> 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



Re: Forwarding/redirecting to action mappings rather than directly to JSPs

2001-07-24 Thread Jim



Matt
 
I got my code to work by removing the mapping from 
the request before forwarding from my action classes with the following 
line
 
request.removeAttribute(Action.MAPPING_KEY);
 
Prior to that it seemed that the previous mapping 
was not being overwritten by the ActionServlet.
 
Hope this helps
 
Jim

  - Original Message - 
  From: 
  Matt 
  Raible 
  To: [EMAIL PROTECTED] 
  Sent: Friday, July 20, 2001 4:51 AM
  Subject: Forwarding/redirecting to action 
  mappings rather than directly to JSPs
  
  
  Jim,
   
  Did you ever get this post figured 
  out – I’m having a similar problem with iPlanet.
   
  http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11046.html
   
  Thanks,
   
  Matt


Re: Extra path info and action mappings

2001-07-13 Thread Ted Husted

Here's another approach to followup my earlier reply. 

ActionMappings could be extended so that if an exact match was not
found, and the path contained interior slashes, it would start trimming
the "directories" from right to left. So given /package/action/info it
would first try 

/package/action/info

if no match was found, before returning, it would try

/package/action

if that matched, it would update the mapping with the "info" and return
normally. 

The info could either be placed in the existing "parameters" property,
or ActionMapping could be extended with an "extra" property. Besides
getExtra(), there might also be getExtraCount and getExtras() methods to
help retrieve multiple parameters.

(Which also suggests that maybe we should have getParameterCount() and
getParameters() methods so that the parameter property could
conveniently store more than one parameter.)

-T.



Re: Extra path info and action mappings

2001-07-13 Thread Ted Husted

My recollection is that Web servers try each component on a path to see
if it is a file or directory, stop when a file is found, and pass the
rest as "extra information". Correct me if that is not what we are
talking about.

With query strings, you'd just have something like "/show?user" or
"/show?group", and Struts would render that as "/execute/show?group" or
"/show.do?group" -- but I take it that the point is that query strings
aren't an option here (because of a proxy server or something). 

As it stands, I don't believe the ActionMappings used by the
ActionController can distinguish between URI's with extra information
and those without. Since the Mappings are virtual, there's no way to
tell where the "file path" ends and the extra information begins. 

It's important to note that show in the example is not a Servlet -- it's
a multithreaded Action that is managed by the single ActionServlet in
your application. So, we would need a way for the Controller to pass
extra information along to the Action, perhaps bundled as request
parameters. This way /file/extra/information and /file?extra&information
would be equivalent.

I'm not sure if this would be a good idea or not, but one thing would be
to allow wildcards in Action paths, so that /show/* could match any URI
beginning with show, with the remainder being placed in the request as
parameters. 

Also without stating an opinion, being able to specify */display as an
actin path could address Jonathan's question from the otehr day.

In either case, the ActionMapping could first be checked for an exact
match, with the wildcards being checked when an exact match wasn't
found. 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

Tim Trentham wrote:
> 
> I'm trying to use extra path info as a way to pass parameters to my actions.
> I changed the mapping from the default *.do to something like /execute/*.
> This works fine except that if I add extra information and try to submit, I
> get a 400 error telling me that I have submitted an invalid path.
> 
> For example, I had a mapping called show.do which has now been changed to
> /execute/show. Now, if I try to submit /execute/show/user, expecting to have
> "user" passed to the show servlet as part of the extra path info accessed by
> request.getPathInfo(), I get the invalid path error. It works if I add
> another action mapping in the struts-config.xml that looks like this
> 
> 
>  
> 
> 
> This means that I have to have a separate action mapping for each different
> thing that I'd like an action to perform even though they're using the same
> action.
> 
> I was expecting to be able to have something like this in the
> struts-config.xml:
> 
> 
>  
>  
> 
> 
> Instead, I have to do this:
> 
> 
>  
> 
> 
> 
>  
> 
> 
> The idea behind this is that I can have one action that basically just
> passes through the extra path info and forwards to the correct page based on
> that info.
> 
> Is there another way to set this up so that you don't have to have an action
> mapping that matches the extra path info?
> 
> Thanks.
> 
> Tim



Extra path info and action mappings

2001-07-12 Thread Tim Trentham

I'm trying to use extra path info as a way to pass parameters to my actions.
I changed the mapping from the default *.do to something like /execute/*.
This works fine except that if I add extra information and try to submit, I
get a 400 error telling me that I have submitted an invalid path.

For example, I had a mapping called show.do which has now been changed to
/execute/show. Now, if I try to submit /execute/show/user, expecting to have
"user" passed to the show servlet as part of the extra path info accessed by
request.getPathInfo(), I get the invalid path error. It works if I add
another action mapping in the struts-config.xml that looks like this


 


This means that I have to have a separate action mapping for each different
thing that I'd like an action to perform even though they're using the same
action.

I was expecting to be able to have something like this in the
struts-config.xml:


 
 


Instead, I have to do this:


 



 


The idea behind this is that I can have one action that basically just
passes through the extra path info and forwards to the correct page based on
that info.

Is there another way to set this up so that you don't have to have an action
mapping that matches the extra path info?

Thanks.

Tim


Tim Trentham
[EMAIL PROTECTED]




Re: Forwarding/redirecting to action mappings rather than directly to JSPs

2001-07-04 Thread Jim Quittenton



The relative path redirect issue is likely caused 
by Silverstream (as of 3.7.1) not fully implementing the servlet 2.2 spec. 
If so I'm left with trying to add the forwards to the actionservlet at 
runtime.

  - Original Message - 
  From: 
  Jim 
  Quittenton 
  To: [EMAIL PROTECTED] 
  
  Sent: Wednesday, July 04, 2001 4:55 
  PM
  Subject: Forwarding/redirecting to action 
  mappings rather than directly to JSPs
  
  
  Hi
   
  I have an action class from which I need to 
  forward to another action mapping (rather than directly to a JSP), and I have 
  managed to get this working by setting up a global forward to an absolute path 
  with rediredt set to true as follows:
   
    
      http://myServer/myDB/myApp/myMapping.do" 
  redirect="true"/>  
  Apart from the inconvenience of having to change 
  the path in struts-config.xml for each deployment, this was fine.
   
  Now however I am trying to deploy to a 2 
  different servers (to which requests are forwarded to from a load 
  balancing server). Both these servers share the same database (and therefore 
  the same war file) and so the above forward will fail when accessed from 
  the other server.
   
  The best way to do this would be to use a 
  relative path, but this errors at runtime saying the path must be absolute. 
  Another way would be to add the forward 
  dynamically to the ActionServlet at runtime but I don't know how to get a 
  reference to the servlet instance so I can call its methods.
   
  Any help is appreciated
   
  Jim


Forwarding/redirecting to action mappings rather than directly to JSPs

2001-07-04 Thread Jim Quittenton




Hi
 
I have an action class from which I need to 
forward to another action mapping (rather than directly to a JSP), and I have 
managed to get this working by setting up a global forward to an absolute path 
with rediredt set to true as follows:
 
  
    http://myServer/myDB/myApp/myMapping.do" 
redirect="true"/>  
Apart from the inconvenience of having to change 
the path in struts-config.xml for each deployment, this was fine.
 
Now however I am trying to deploy to a 2 different 
servers (to which requests are forwarded to from a load balancing server). 
Both these servers share the same database (and therefore the same war file) and 
so the above forward will fail when accessed from the other 
server.
 
The best way to do this would be to use a relative 
path, but this errors at runtime saying the path must be absolute. Another way would be to add the forward dynamically to the 
ActionServlet at runtime but I don't know how to get a reference to the servlet 
instance so I can call its methods.
 
Any help is appreciated
 
Jim


RE: Dynamic action mappings

2001-05-29 Thread Deadman, Hal

The ActionForm and Action classes both have a getServlet() method that will
return a reference to the ActionServlet instance.

> -Original Message-
> From: Larry Meadors [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 29, 2001 10:57 AM
> To: [EMAIL PROTECTED]
> Subject: Dynamic action mappings
>
>
> I want to add and remove action mappings/forwards/beans on the fly.
>
> What's the best way to do that?
>
> I saw in the struts-config.xml file some actions at the
> bottom that look promising, but don't understand how those
> would be used.
>
> I'm thinking that I could also use the addMapping(),
> addForward(), addFormBean() functions, if I could get a
> reference to the ActionServlet instance. Is there a way to do that?
>
> Any advice?
>
> Larry
>
>



  1   2   >