Re: Parameters to Actions

2003-07-07 Thread Mark Lowe
I'd also have a look at

org.apache.struts.actions.DispatchAction

as it caters for your situation...

public class MyAction extends DispatchAction {

//instead of execute you use the parameter defined in config

  public final ActionForward confirmDelete(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)

  throws Exception {

  }
}
//struts-config.xml


//jsp


foo

HTH

mark

On Monday, July 7, 2003, at 01:36 PM, Heiko Jürgens wrote:



Hello, i'm using this dynamic link to pass a parameters to an action:

http://localhost:8081/deleteEvent.do?action=confirmDelete

String action = (String) request.getAttribute("action");

Use getParameter instead of getAttribute!

HTH, Heiko

-
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: Parameters to Actions

2003-07-07 Thread Heiko Jürgens


> Hello, i'm using this dynamic link to pass a parameters to an action:
> 
> http://localhost:8081/deleteEvent.do?action=confirmDelete

> String action = (String) request.getAttribute("action");
> 

Use getParameter instead of getAttribute!

HTH, Heiko

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



Re: Parameters to Actions

2003-07-07 Thread Eugen Bushuev
typo in "action" field in input form. maybe...

Jose' Moreira wrote:

Hello, i'm using this dynamic link to pass a parameters to an action:

http://localhost:8081/deleteEvent.do?action=confirmDelete

* code in deleteEventAction :

   try {
   
   String action = (String) request.getAttribute("action");
   
   if (action.equals("confirmDelete")) {
   
   request.setAttribute("action",action);
   
   }
   
   } catch (NullPointerException e) {
   
   
   System.err.println("attribute action onot found");
   }

but i get an NullPointerException :(

* Action mapping :


what can be the problem ?

-
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: Parameters to Actions

2003-07-07 Thread Valery Jacot
When you pass a parameter like you did in your url, use the method
getParameter() of the request...
It will return you a string...

And if you don't want to have a NullPointerException, do your if like this :

String action = request.getParameter("action");
if("confirmDelete".equals(action)){}

Bye..

-Original Message-
From: José Moreira [mailto:[EMAIL PROTECTED]
Sent: lundi, 7. juillet 2003 13:51
To: Struts Users Mailing List
Subject: Parameters to Actions


Hello, i'm using this dynamic link to pass a parameters to an action:

http://localhost:8081/deleteEvent.do?action=confirmDelete

* code in deleteEventAction :

try {

String action = (String) request.getAttribute("action");

if (action.equals("confirmDelete")) {

request.setAttribute("action",action);

}

} catch (NullPointerException e) {


System.err.println("attribute action onot found");
}


but i get an NullPointerException :(


* Action mapping :




what can be the problem ?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [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 to [EMAIL PROTECTED]

***


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



Parameters to Actions

2003-07-07 Thread José Moreira
Hello, i'm using this dynamic link to pass a parameters to an action:

http://localhost:8081/deleteEvent.do?action=confirmDelete

* code in deleteEventAction :

try {

String action = (String) request.getAttribute("action");

if (action.equals("confirmDelete")) {

request.setAttribute("action",action);

}

} catch (NullPointerException e) {


System.err.println("attribute action onot found");
}


but i get an NullPointerException :(


* Action mapping :




what can be the problem ?


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



RE: Passing parameters to Actions

2003-02-25 Thread Andrew Shirk
No need for that either since the superclass constructor is implicitly called.

At 01:38 PM 2/25/2003 -0700, you wrote:
maybe a super() call in the constructor. But you shouldn't need anymore than
that.
Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws
-Original Message-
From: Guido [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 1:32 PM
To: Struts Users Mailing List
Subject: RE: Passing parameters to Actions
I wonder if MyExtendedActionMapping is as simple as:

public class MyExtendedActionMapping extends ActionMapping {
private String xxx;
public void setXXX(String xxx) { this.xxx = xxx; }
public String getXXX() { return xxx; }
}
Should I implement any other method...?

Thanks.


Guido García Bernardo
[EMAIL PROTECTED]
Spain is different.
On Tue, 25 Feb 2003, Brandon Goodin wrote:

} Here is a config sample:
}
} 
} 
} 
} 
} 
-
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: Passing parameters to Actions

2003-02-25 Thread Brandon Goodin
good eye Geeta :-D

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 1:39 PM
To: Struts Users Mailing List
Subject: Re: Passing parameters to Actions


Well, I'm sure it's a typo, but make sure the methods are called
setXxx(String) and getXxx()..! :)
Geeta

Guido wrote:

> I wonder if MyExtendedActionMapping is as simple as:
>
> public class MyExtendedActionMapping extends ActionMapping {
> private String xxx;
> public void setXXX(String xxx) { this.xxx = xxx; }
> public String getXXX() { return xxx; }
> }
>
> Should I implement any other method...?
>
> Thanks.
>
> 
> Guido García Bernardo
> [EMAIL PROTECTED]
> Spain is different.
>
> On Tue, 25 Feb 2003, Brandon Goodin wrote:
>
> } Here is a config sample:
> }
> }  }parameter="submit"
> }type="com.foo.MyAction"
> }name="myForm"
> }scope="request"
> }className="com.foo.MyExtendedActionMapping">
> } 
> } 
> } 
> } 
>
> -
> 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: Passing parameters to Actions

2003-02-25 Thread Geeta Ramani
Well, I'm sure it's a typo, but make sure the methods are called
setXxx(String) and getXxx()..! :)
Geeta

Guido wrote:

> I wonder if MyExtendedActionMapping is as simple as:
>
> public class MyExtendedActionMapping extends ActionMapping {
> private String xxx;
> public void setXXX(String xxx) { this.xxx = xxx; }
> public String getXXX() { return xxx; }
> }
>
> Should I implement any other method...?
>
> Thanks.
>
> 
> Guido García Bernardo
> [EMAIL PROTECTED]
> Spain is different.
>
> On Tue, 25 Feb 2003, Brandon Goodin wrote:
>
> } Here is a config sample:
> }
> }  }parameter="submit"
> }type="com.foo.MyAction"
> }name="myForm"
> }scope="request"
> }className="com.foo.MyExtendedActionMapping">
> } 
> } 
> } 
> } 
>
> -
> 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: Passing parameters to Actions

2003-02-25 Thread James Mitchell
No, that's it.

1. Make your class extending o.a.s.a.ActionMapping
2. Add className="my.package.MyActionMapping" to your 


--
James Mitchell
Software Engineer/Struts Evangelist




> -Original Message-
> From: Guido [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 25, 2003 3:32 PM
> To: Struts Users Mailing List
> Subject: RE: Passing parameters to Actions
> 
> 
> I wonder if MyExtendedActionMapping is as simple as:
> 
> public class MyExtendedActionMapping extends ActionMapping {
>   private String xxx;
>   public void setXXX(String xxx) { this.xxx = xxx; }
>   public String getXXX() { return xxx; }
> }
> 
> Should I implement any other method...?
> 
> Thanks.
> 
> 
> Guido García Bernardo
> [EMAIL PROTECTED]
> Spain is different.
> 
> On Tue, 25 Feb 2003, Brandon Goodin wrote:
> 
> } Here is a config sample:
> }
> }  }  parameter="submit"
> }  type="com.foo.MyAction"
> }  name="myForm"
> }  scope="request"
> }  className="com.foo.MyExtendedActionMapping">
> }   
> } 
> } 
> } 
> 
> 
> -
> 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: Passing parameters to Actions

2003-02-25 Thread Brandon Goodin
maybe a super() call in the constructor. But you shouldn't need anymore than
that.

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Guido [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 1:32 PM
To: Struts Users Mailing List
Subject: RE: Passing parameters to Actions


I wonder if MyExtendedActionMapping is as simple as:

public class MyExtendedActionMapping extends ActionMapping {
private String xxx;
public void setXXX(String xxx) { this.xxx = xxx; }
public String getXXX() { return xxx; }
}

Should I implement any other method...?

Thanks.


Guido García Bernardo
[EMAIL PROTECTED]
Spain is different.

On Tue, 25 Feb 2003, Brandon Goodin wrote:

} Here is a config sample:
}
} 
} 
} 
} 
} 


-
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: Passing parameters to Actions

2003-02-25 Thread Guido
I wonder if MyExtendedActionMapping is as simple as:

public class MyExtendedActionMapping extends ActionMapping {
private String xxx;
public void setXXX(String xxx) { this.xxx = xxx; }
public String getXXX() { return xxx; }
}

Should I implement any other method...?

Thanks.


Guido García Bernardo
[EMAIL PROTECTED]
Spain is different.

On Tue, 25 Feb 2003, Brandon Goodin wrote:

} Here is a config sample:
}
} 
} 
} 
} 
} 


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



Re: Passing parameters to Actions

2003-02-25 Thread Sloan Seaman
Very cool.

Thanks!!!

--
Sloan

- Original Message -
From: "Brandon Goodin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:06 PM
Subject: RE: Passing parameters to Actions


> It is done automagically upon startup of your application. When struts
> processes it's config (struts-config.xml) it generates ActionMapping
> instances for each . When you specify your extended ActionMapping
in
> the className attribute of  struts will populate the related
> property or properties of that class. Your extended Action mapping must
have
> matching getter/setter properties that match you property="" value (i.e.
>  relates to public
> setAProperty(String aValue){};)
>
> One of the issues you might run into is that you cant easily change the
> properties during runtime. If you make role changes to the Action you will
> have to reboot the webapp. This is usually not a major deal.
>
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> -Original Message-
> From: Sloan Seaman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:56 PM
> To: Struts Users Mailing List
> Subject: Re: Passing parameters to Actions
>
>
> Ok.  sounds like a plan.  Question though:
>
> How do I access the  information?  Do I have to parse the
XML
> or something?
>
> Sorry... I'm a bit new to Struts...
>
> --
> Sloan
>
> - Original Message -
> From: "Brandon Goodin" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 25, 2003 2:40 PM
> Subject: RE: Passing parameters to Actions
>
>
> > Here is a config sample:
> >
> >  >  parameter="submit"
> >  type="com.foo.MyAction"
> >  name="myForm"
> >  scope="request"
> >  className="com.foo.MyExtendedActionMapping">
> >   
> > 
> > 
> > 
> >
> > Brandon Goodin
> > Phase Web and Multimedia
> > PO Box 85
> > Whitefish MT 59937
> > P (406) 862-2245
> > F (406) 862-0354
> > [EMAIL PROTECTED]
> > http://www.phase.ws
> >
> >
> > -Original Message-
> > From: Brandon Goodin [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 25, 2003 12:33 PM
> > To: Struts Users Mailing List
> > Subject: RE: Passing parameters to Actions
> >
> >
> > parameter is only used for dispatch actions. If you want to set
properties
> > for an action... you can extend the ActionMapping class and use the
> > set-property in an action element while specifying the className
attribute
> > of the action element.
> >
> > Brandon Goodin
> > Phase Web and Multimedia
> > PO Box 85
> > Whitefish MT 59937
> > P (406) 862-2245
> > F (406) 862-0354
> > [EMAIL PROTECTED]
> > http://www.phase.ws
> >
> >
> > -Original Message-
> > From: Sloan Seaman [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 25, 2003 12:29 PM
> > To: Struts Users Mailing List
> > Subject: Passing parameters to Actions
> >
> >
> > In the struts-config.xml file I want to pass a few parameters to my
> actions
> > but it looks like the DTD only supports one "parameter" tag.
> >
> > I.E.:
> >  >type="com.symbol.mobilecommerce.analysis.actions.app.Main"
> >name="app.main"
> >parameter="admin"
> >>
> >
> >
> > 
> >
> > When I would rather do something like:
> >  >type="com.symbol.mobilecommerce.analysis.actions.app.Main"
> >name="app.main"
> >>
> >
> >
> >
> > 
> >
> > Now,  I know there is a roles attribute but we are doing out own
security
> > model and are not using request.isUserInRole().
> >
> > (BTW: is there any way to write to whatever request.isUserInRole() used
to
> > do its lookup so we can use it?)
> >
> > Is there any way to have parameters passed like how I would like?
> >
> > I could spoof  to something like  > path="admin"/> but I would rather not.
> >
> > Thanks!
> >
> > --
> > Sloan
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: Passing parameters to Actions

2003-02-25 Thread Brandon Goodin
It is done automagically upon startup of your application. When struts
processes it's config (struts-config.xml) it generates ActionMapping
instances for each . When you specify your extended ActionMapping in
the className attribute of  struts will populate the related
property or properties of that class. Your extended Action mapping must have
matching getter/setter properties that match you property="" value (i.e.
 relates to public
setAProperty(String aValue){};)

One of the issues you might run into is that you cant easily change the
properties during runtime. If you make role changes to the Action you will
have to reboot the webapp. This is usually not a major deal.

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Sloan Seaman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 12:56 PM
To: Struts Users Mailing List
Subject: Re: Passing parameters to Actions


Ok.  sounds like a plan.  Question though:

How do I access the  information?  Do I have to parse the XML
or something?

Sorry... I'm a bit new to Struts...

--
Sloan

- Original Message -
From: "Brandon Goodin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 2:40 PM
Subject: RE: Passing parameters to Actions


> Here is a config sample:
>
>   parameter="submit"
>  type="com.foo.MyAction"
>  name="myForm"
>  scope="request"
>  className="com.foo.MyExtendedActionMapping">
>   
> 
> 
> 
>
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> -Original Message-
> From: Brandon Goodin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:33 PM
> To: Struts Users Mailing List
> Subject: RE: Passing parameters to Actions
>
>
> parameter is only used for dispatch actions. If you want to set properties
> for an action... you can extend the ActionMapping class and use the
> set-property in an action element while specifying the className attribute
> of the action element.
>
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> -Original Message-
> From: Sloan Seaman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:29 PM
> To: Struts Users Mailing List
> Subject: Passing parameters to Actions
>
>
> In the struts-config.xml file I want to pass a few parameters to my
actions
> but it looks like the DTD only supports one "parameter" tag.
>
> I.E.:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>parameter="admin"
>>
>
>
> 
>
> When I would rather do something like:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>>
>
>
>
> 
>
> Now,  I know there is a roles attribute but we are doing out own security
> model and are not using request.isUserInRole().
>
> (BTW: is there any way to write to whatever request.isUserInRole() used to
> do its lookup so we can use it?)
>
> Is there any way to have parameters passed like how I would like?
>
> I could spoof  to something like  path="admin"/> but I would rather not.
>
> Thanks!
>
> --
> Sloan
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



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



Re: Passing parameters to Actions

2003-02-25 Thread Sloan Seaman
Ok.  sounds like a plan.  Question though:

How do I access the  information?  Do I have to parse the XML
or something?

Sorry... I'm a bit new to Struts...

--
Sloan

- Original Message -
From: "Brandon Goodin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 2:40 PM
Subject: RE: Passing parameters to Actions


> Here is a config sample:
>
>   parameter="submit"
>  type="com.foo.MyAction"
>  name="myForm"
>  scope="request"
>  className="com.foo.MyExtendedActionMapping">
>   
> 
> 
> 
>
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> -Original Message-
> From: Brandon Goodin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:33 PM
> To: Struts Users Mailing List
> Subject: RE: Passing parameters to Actions
>
>
> parameter is only used for dispatch actions. If you want to set properties
> for an action... you can extend the ActionMapping class and use the
> set-property in an action element while specifying the className attribute
> of the action element.
>
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> -Original Message-
> From: Sloan Seaman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:29 PM
> To: Struts Users Mailing List
> Subject: Passing parameters to Actions
>
>
> In the struts-config.xml file I want to pass a few parameters to my
actions
> but it looks like the DTD only supports one "parameter" tag.
>
> I.E.:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>parameter="admin"
>>
>
>
> 
>
> When I would rather do something like:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>>
>
>
>
> 
>
> Now,  I know there is a roles attribute but we are doing out own security
> model and are not using request.isUserInRole().
>
> (BTW: is there any way to write to whatever request.isUserInRole() used to
> do its lookup so we can use it?)
>
> Is there any way to have parameters passed like how I would like?
>
> I could spoof  to something like  path="admin"/> but I would rather not.
>
> Thanks!
>
> --
> Sloan
>
>
>
> -
> 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: Passing parameters to Actions

2003-02-25 Thread Jarnot Voytek Contr AU HQ/SC
It may be easier for you to extend RequestProcessor and override
processRoles(...) and perform your own authorization there.  I started down
that road, but didn't like the effect of return false from processRoles, so
we always return true and do the real role checking in our base action class
(mapping.getRoleNames() gives us the value of the roles attribute) so that
we can return mapping.getInputForward() when the role check fails...

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


> > -Original Message-
> > From: Sloan Seaman [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, February 25, 2003 2:29 PM
> > To: Struts Users Mailing List
> > Subject: Passing parameters to Actions
> > 
> > 
> > In the struts-config.xml file I want to pass a few parameters 
> > to my actions
> > but it looks like the DTD only supports one "parameter" tag.
> > 
> > I.E.:
> >  >type="com.symbol.mobilecommerce.analysis.actions.app.Main"
> >name="app.main"
> >parameter="admin"
> >>
> >
> >
> > 
> > 
> > When I would rather do something like:
> >  >type="com.symbol.mobilecommerce.analysis.actions.app.Main"
> >name="app.main"
> >>
> >
> >
> >
> > 
> > 
> > Now,  I know there is a roles attribute but we are doing out 
> > own security
> > model and are not using request.isUserInRole().
> > 
> > (BTW: is there any way to write to whatever 
> > request.isUserInRole() used to
> > do its lookup so we can use it?)
> > 
> > Is there any way to have parameters passed like how I would like?
> > 
> > I could spoof  to something like  > name="ROLES_ALLOWED"
> > path="admin"/> but I would rather not.
> > 
> > Thanks!
> > 
> > --
> > Sloan
> >  

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



RE: Passing parameters to Actions

2003-02-25 Thread Derek Richardson
parameter is also used for ForwardAction. Actually, any action can access its 
parameter using mapping.getParameter() and use it however it wants. We do this in 
several actions.

>From the ActionConfig javadoc:

parameter

protected java.lang.String parameter
General purpose configuration parameter that can be used to pass extra iunformation to 
the Action instance selected by this Action. Struts does not itself use this value in 
any way. 

However, Sloan, you ar right that it is limited to passing one parameter and that the 
parameter's intended use is unclear if it is simply called "parameter". Brandon's 
solution to subclass ActionMapping is probably the best (only reasonable?) alternative.

Derek Richardson

> -Original Message-
> From: Brandon Goodin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 2:33 PM
> To: Struts Users Mailing List
> Subject: RE: Passing parameters to Actions
> 
> 
> parameter is only used for dispatch actions. If you want to 
> set properties
> for an action... you can extend the ActionMapping class and use the
> set-property in an action element while specifying the 
> className attribute
> of the action element.
> 
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
> 
> 
> -Original Message-
> From: Sloan Seaman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:29 PM
> To: Struts Users Mailing List
> Subject: Passing parameters to Actions
> 
> 
> In the struts-config.xml file I want to pass a few parameters 
> to my actions
> but it looks like the DTD only supports one "parameter" tag.
> 
> I.E.:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>parameter="admin"
>>
>
>
> 
> 
> When I would rather do something like:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>>
>
>
>
> 
> 
> Now,  I know there is a roles attribute but we are doing out 
> own security
> model and are not using request.isUserInRole().
> 
> (BTW: is there any way to write to whatever 
> request.isUserInRole() used to
> do its lookup so we can use it?)
> 
> Is there any way to have parameters passed like how I would like?
> 
> I could spoof  to something like  name="ROLES_ALLOWED"
> path="admin"/> but I would rather not.
> 
> Thanks!
> 
> --
> Sloan
> 
> 
> 
> -
> 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: Passing parameters to Actions

2003-02-25 Thread Brandon Goodin
Here is a config sample:


  




Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws
 

-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 12:33 PM
To: Struts Users Mailing List
Subject: RE: Passing parameters to Actions


parameter is only used for dispatch actions. If you want to set properties
for an action... you can extend the ActionMapping class and use the
set-property in an action element while specifying the className attribute
of the action element.

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Sloan Seaman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 12:29 PM
To: Struts Users Mailing List
Subject: Passing parameters to Actions


In the struts-config.xml file I want to pass a few parameters to my actions
but it looks like the DTD only supports one "parameter" tag.

I.E.:

   
   


When I would rather do something like:

   
   
   


Now,  I know there is a roles attribute but we are doing out own security
model and are not using request.isUserInRole().

(BTW: is there any way to write to whatever request.isUserInRole() used to
do its lookup so we can use it?)

Is there any way to have parameters passed like how I would like?

I could spoof  to something like  but I would rather not.

Thanks!

--
Sloan



-
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: Passing parameters to Actions

2003-02-25 Thread James Mitchell
Have looked at extending ActionConfig?

You could add a field for assigning roles.  
If you wanted to allow more than one, it would let you do:






 


The rest is really up to you.  Just giving you some ideas.




--
James Mitchell
Software Engineer/Struts Evangelist




> -Original Message-
> From: Sloan Seaman [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 25, 2003 2:29 PM
> To: Struts Users Mailing List
> Subject: Passing parameters to Actions
> 
> 
> In the struts-config.xml file I want to pass a few parameters 
> to my actions
> but it looks like the DTD only supports one "parameter" tag.
> 
> I.E.:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>parameter="admin"
>>
>
>
> 
> 
> When I would rather do something like:
> type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>name="app.main"
>>
>
>
>
> 
> 
> Now,  I know there is a roles attribute but we are doing out 
> own security
> model and are not using request.isUserInRole().
> 
> (BTW: is there any way to write to whatever 
> request.isUserInRole() used to
> do its lookup so we can use it?)
> 
> Is there any way to have parameters passed like how I would like?
> 
> I could spoof  to something like  name="ROLES_ALLOWED"
> path="admin"/> but I would rather not.
> 
> Thanks!
> 
> --
> Sloan
> 
> 
> 
> -
> 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: Passing parameters to Actions

2003-02-25 Thread Brandon Goodin
parameter is only used for dispatch actions. If you want to set properties
for an action... you can extend the ActionMapping class and use the
set-property in an action element while specifying the className attribute
of the action element.

Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Sloan Seaman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 12:29 PM
To: Struts Users Mailing List
Subject: Passing parameters to Actions


In the struts-config.xml file I want to pass a few parameters to my actions
but it looks like the DTD only supports one "parameter" tag.

I.E.:

   
   


When I would rather do something like:

   
   
   


Now,  I know there is a roles attribute but we are doing out own security
model and are not using request.isUserInRole().

(BTW: is there any way to write to whatever request.isUserInRole() used to
do its lookup so we can use it?)

Is there any way to have parameters passed like how I would like?

I could spoof  to something like  but I would rather not.

Thanks!

--
Sloan



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



Passing parameters to Actions

2003-02-25 Thread Sloan Seaman
In the struts-config.xml file I want to pass a few parameters to my actions
but it looks like the DTD only supports one "parameter" tag.

I.E.:

   
   


When I would rather do something like:

   
   
   


Now,  I know there is a roles attribute but we are doing out own security
model and are not using request.isUserInRole().

(BTW: is there any way to write to whatever request.isUserInRole() used to
do its lookup so we can use it?)

Is there any way to have parameters passed like how I would like?

I could spoof  to something like  but I would rather not.

Thanks!

--
Sloan



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



RE: How to pass parameters to actions ? action.do?variable=value

2002-03-11 Thread Klaus Bucka-Lassen

Hi Maris

Yes, you can pass parameters in different ways:

1) The most straight forward way is the one that you
   suggested:
   
 Touch me!
   

2) You can also use the  tag, which is easy
   if you only want to pass one parameter (see paramId,
   paramName & paramProperty). For multiple parameters
   you'll have to define a property on your action-form 
   (something like a 'getParameters' method) that
   returns a Map consisting of the key-value pairs you
   want to pass.

3) If you want buttons instead of links use hidden
   fields to pass parameters [use the 'method'
   attribute to specify whether you want to use POST
   (default) or GET]

I don't think it makes sense to talk about using the POST method in context with links 
- these always resolve to a GET-request.

Hope that helps & with regards,
Klaus Bucka-Lassen
aragost ag
Zurich, Switzerland


-Original Message-
From: struts-user-digest-help
[mailto:[EMAIL PROTECTED]]
Sent: Freitag, 8. März 2002 20:35
To: struts-user
Cc: M.Orbidans
Subject: How to pass parameters to actions ? action.do?variable=value


hello

I need to create links with different parameters. Can I pass them
directly to actions ?

like this action.do?variable=value

Does the Struts servlet do POST and GET ?

thanx
Maris Orbidan


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




RE: How to pass parameters to actions ? action.do?variable=value

2002-03-08 Thread Juan Alvarado \(Struts List\)

I have succesfully done this.

Give it a try!!!

**
Juan Alvarado
Internet Developer -- Manduca Management
(786)552-0504
[EMAIL PROTECTED]
AOL Instant Messenger: [EMAIL PROTECTED]

-Original Message-
From: Mâris Orbidâns [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 2:35 PM
To: Struts Users Mailing List
Subject: How to pass parameters to actions ? action.do?variable=value


hello

I need to create links with different parameters. Can I pass them
directly to actions ?

like this action.do?variable=value

Does the Struts servlet do POST and GET ?

thanx
Maris Orbidans


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




How to pass parameters to actions ? action.do?variable=value

2002-03-08 Thread Mâris Orbidâns

hello

I need to create links with different parameters. Can I pass them
directly to actions ?

like this action.do?variable=value

Does the Struts servlet do POST and GET ?

thanx
Maris Orbidans


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