RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Menke, John
i found this class a while ago on this list it works great, just create a
parameter action forward and then add
params

forward.addParameter("name", "value");
return forward;



import java.util.HashMap;
import java.util.Iterator;



public final class ParameterActionForward extends ActionForward {

private static final String questionMark = "?";
private static final String ampersand = "&";
private static final String equals = "=";
private HashMap parameters = new HashMap();
private String path;


public ParameterActionForward(ActionForward forward) {
setName(forward.getName());
setPath(forward.getPath());
setRedirect(forward.getRedirect());

}


public void setPath(String path) {
this.path = path;

}



public String getPath() {

StringBuffer sb = new StringBuffer();

sb.append(path);

boolean firstTimeThrough = true;

if (parameters != null && !parameters.isEmpty()) {
sb.append(questionMark);

Iterator it = parameters.keySet()
.iterator();

while (it.hasNext()) {

String paramName = (String)it.next();
String paramValue = (String)parameters.get(paramName);

if (firstTimeThrough) {
firstTimeThrough = false;
} else {
sb.append(ampersand);
}

sb.append(paramName);
sb.append(equals);
sb.append(paramValue);

}
}

return sb.toString();
}


   
public void addParameter(String paramName, Object paramValue) {
addParameter(
paramName,
paramValue.toString());

}

public void addParameter(String paramName, String paramValue) {
parameters.put(paramName, paramValue);

}
}

-Original Message-
From: Jay Glanville [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 2:12 PM
To: 'Struts Users Mailing List'
Subject: RE: What is the best way to pass a parameter to a forward?


Latest stable release: 1.1

--
Jay Glanville


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper
> Sent: Tuesday, March 16, 2004 1:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: What is the best way to pass a parameter to a forward?
> 
> 
> 
> "Jay Glanville" <[EMAIL PROTECTED]> wrote 
> in message
> news:[EMAIL PROTECTED]
> > It's funny that you say that it will not work, because it 
> does for me,
> > and without throwing any exceptions.
> 
> What version of Struts are you using? It's not supposed to 
> work, at least
> with the latest code, so I'd like to find out whether we have 
> a bug, or
> you're using a version prior to the forwards being frozen.
> 
> --
> Martin Cooper
> 
> 
> >
> > That being said, your point about modifying an action 
> mappings forwards
> > is a good one.  It is unfortunate that the ActionForward 
> class doesn't
> > have a copy constructor 
> >
> > --
> > Jay Glanville
> >


-
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: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Jay Glanville
Latest stable release: 1.1

--
Jay Glanville


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper
> Sent: Tuesday, March 16, 2004 1:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: What is the best way to pass a parameter to a forward?
> 
> 
> 
> "Jay Glanville" <[EMAIL PROTECTED]> wrote 
> in message
> news:[EMAIL PROTECTED]
> > It's funny that you say that it will not work, because it 
> does for me,
> > and without throwing any exceptions.
> 
> What version of Struts are you using? It's not supposed to 
> work, at least
> with the latest code, so I'd like to find out whether we have 
> a bug, or
> you're using a version prior to the forwards being frozen.
> 
> --
> Martin Cooper
> 
> 
> >
> > That being said, your point about modifying an action 
> mappings forwards
> > is a good one.  It is unfortunate that the ActionForward 
> class doesn't
> > have a copy constructor 
> >
> > --
> > Jay Glanville
> >


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



Re: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Martin Cooper

"Jay Glanville" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's funny that you say that it will not work, because it does for me,
> and without throwing any exceptions.

What version of Struts are you using? It's not supposed to work, at least
with the latest code, so I'd like to find out whether we have a bug, or
you're using a version prior to the forwards being frozen.

--
Martin Cooper


>
> That being said, your point about modifying an action mappings forwards
> is a good one.  It is unfortunate that the ActionForward class doesn't
> have a copy constructor 
>
> --
> Jay Glanville
>
>
> > -Original Message-
> > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper
> > Sent: Monday, March 15, 2004 8:30 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: What is the best way to pass a parameter to a forward?
> >
> >
> > What you are doing will not work - at least, not the way you
> > are doing it.
> > You are trying to modify the ActionForward instance that is
> > owned by Struts,
> > and calling setPath() on that instance will result in an
> > IllegalStateException.
> >
> > You need to create your own ActionForward instance, instead
> > of trying to
> > modify Struts' one. You can do that with something like this:
> >
> > ActionForward goto = mapping.findForward( "success" );
> > String path = ...; // Put together your new path
> > ActionForward myGoto = new ActionForward(path,
> > goto.getRedirect());
> > return myGoto;
> >
> > --
> > Martin Cooper
> >
> >
> > "Glanville, Jay" <[EMAIL PROTECTED]> wrote
> > in message
> > news:[EMAIL PROTECTED]
> > I'm trying to solve a problem, but I'm not sure my solution
> > is the best
> > way.  Basically, I want to set a parameter on a forward within the
> > action's execute.
> >
> > I'm in my action's execute method.  I've just successfully performed
> > some work, and I now want to forward/redirect to the next page.  So,
> > I've got some code that looks like this:
> >
> >public ActionForward execute(ActionMapping.) {
> >   // do some work
> >   ActionForward goto = mapping.findForward( "success" );
> >   return goto;
> >}
> >
> > With an action mapping that looks like this:
> >
> > >   path="/EntrySave"
> >   type="com.package.EntrySaveAction"
> >   name="EntryForm"
> >   validate="true"
> >   input="/Entry.do">
> >   
> >   
> >
> >
> > Basically, if I left the EntrySaveAction.execute do what's doing right
> > now, then upon successful completion, it would redirect to
> > "/Container.do".  However, what I want it to do is redirect to
> > "/Container.do?id=45", where 45 is the id of the container that I want
> > to go to.  The value of "45" is dynamic, and is know at the
> > time of the
> > EntrySaveAction.execute command.
> >
> > The way I'm currently doing it is something like this:
> >
> >public ActionForward execute(ActionMapping.) {
> >   // do some work
> >   ActionForward goto = mapping.findForward( "success" );
> >   String path = goto.getPath();
> >   path += "?id=" + container.getId();
> >   goto.setPath( path );
> >   return goto;
> >}
> >
> > Is this the correct way to do this?  Is there a better way?
> >
> > Thanks in advance
> >
> > JDG
> >
> >
> > --
> > Jay Glanville
> >
> >
> >
> >
> > -
> > 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: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Hubert Rabago
I wrote an extension to help me do this.  I use this in all my projects.
http://www.rabago.net/struts/redirect

hth,
Hubert

--- Jay Glanville <[EMAIL PROTECTED]> wrote:>
> I'm trying to solve a problem, but I'm not sure my solution 
> is the best
> way.  Basically, I want to set a parameter on a forward within the
> action's execute.
> 
> I'm in my action's execute method.  I've just successfully performed
> some work, and I now want to forward/redirect to the next page.  So,
> I've got some code that looks like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   return goto;
>}
> 
> With an action mapping that looks like this:
> 
>   path="/EntrySave"
>   type="com.package.EntrySaveAction"
>   name="EntryForm"
>   validate="true"
>   input="/Entry.do">
>   
>   
>
> 
> Basically, if I left the EntrySaveAction.execute do what's doing right
> now, then upon successful completion, it would redirect to
> "/Container.do".  However, what I want it to do is redirect to
> "/Container.do?id=45", where 45 is the id of the container that I want
> to go to.  The value of "45" is dynamic, and is know at the 
> time of the
> EntrySaveAction.execute command.
> 
> The way I'm currently doing it is something like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   String path = goto.getPath();
>   path += "?id=" + container.getId();
>   goto.setPath( path );
>   return goto;
>}
> 
> Is this the correct way to do this?  Is there a better way?
> 
> Thanks in advance
> 
> JDG
> 
> 
> --
> Jay Glanville


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



SV: What is the best way to pass a parameter to a forward? Create a utility class .Client code

2004-03-16 Thread Tommy Holm - TELMORE
Forgot to show the code how to use it!
In your action you should not return 
return mapping.findForward("bla") 
but 
Hashtable a = new Hashtable();//add what ever key/value pairs you need
return new
ActionForwardParameters().add(a).forward(mapping.findForward("success"))
;

-Oprindelig meddelelse-
Fra: Tommy Holm - TELMORE 
Sendt: 16. marts 2004 13:48
Til: Struts Users Mailing List
Emne: SV: What is the best way to pass a parameter to a forward? Create
a utility class


Some time ago this question has been asked before and someone showed
some utility class code. I used the code and created a class like this:
import java.util.HashMap; import java.util.Hashtable; import
java.util.Iterator; import java.util.Map;

import org.apache.struts.action.ActionForward;

/**
 * Simple utility class to add parameters to an ActionForward 
 * from within an action. This action is useful when you from 
 * within an action need to pass parameters to the jsp page or another
action 
 * you are forwarding to.
 */
public class ActionForwardParameters {

/**
*  Encupsulates parameters for ActionForward.
*/

private Map params = new HashMap();

/**
 * add all the parameters and values from the hashtable to the
actionforward
 * @param parametersValues a hastable with key value pairs
 * @return ActionForwardParameters object
 */
public ActionForwardParameters add(Hashtable parametersValues) {
for(Iterator i =
parametersValues.keySet().iterator();i.hasNext();){
String key = (String) i.next();
params.put(key,(String) parametersValues.get(key));
}

return this;
}

/**
* Add parameters to provided ActionForward
* @param forward ActionForward to add parameters to
* @return ActionForward with added parameters to URL
*/
public ActionForward forward(ActionForward forward) {
StringBuffer path = new StringBuffer(forward.getPath());
Iterator iter = params.entrySet().iterator();
if (iter.hasNext()) {
//add first parameter, if avaliable
Map.Entry entry = (Map.Entry) iter.next();
path.append("?" + entry.getKey() + "=" + entry.getValue());
//add other parameters 
while (iter.hasNext()) {
entry = (Map.Entry) iter.next();
path.append("&" + entry.getKey() + "=" +
entry.getValue());
}
}

return new ActionForward(path.toString());
}

}


Please note that I didn't come up with the idea of this class, I simply
created the class after reading the information that a fellow programmer

Provided.!


-Oprindelig meddelelse-
Fra: Jay Glanville [mailto:[EMAIL PROTECTED] 
Sendt: 16. marts 2004 13:13
Til: 'Struts Users Mailing List'
Emne: RE: What is the best way to pass a parameter to a forward?


It's funny that you say that it will not work, because it does for me,
and without throwing any exceptions.

That being said, your point about modifying an action mappings forwards
is a good one.  It is unfortunate that the ActionForward class doesn't
have a copy constructor 

--
Jay Glanville


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper
> Sent: Monday, March 15, 2004 8:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: What is the best way to pass a parameter to a forward?
> 
> 
> What you are doing will not work - at least, not the way you are doing

> it. You are trying to modify the ActionForward instance that is
> owned by Struts,
> and calling setPath() on that instance will result in an
> IllegalStateException.
> 
> You need to create your own ActionForward instance, instead of trying 
> to modify Struts' one. You can do that with something like this:
> 
> ActionForward goto = mapping.findForward( "success" );
> String path = ...; // Put together your new path
> ActionForward myGoto = new ActionForward(path, 
> goto.getRedirect());
> return myGoto;
> 
> --
> Martin Cooper
> 
> 
> "Glanville, Jay" <[EMAIL PROTECTED]> wrote in 
> message 
> news:[EMAIL PROTECTED]
> I'm trying to solve a problem, but I'm not sure my solution
> is the best
> way.  Basically, I want to set a parameter on a forward within the
> action's execute.
> 
> I'm in my action's execute method.  I've just successfully performed
> some work, and I now want to forward/redirect to the next page.  So, 
> I've got some code that looks like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   return goto;
>}
> 
> With an action mapping th

SV: What is the best way to pass a parameter to a forward? Create a utility class

2004-03-16 Thread Tommy Holm - TELMORE
Some time ago this question has been asked before and someone showed
some utility class code. I used the code and created a class like this:
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

import org.apache.struts.action.ActionForward;

/**
 * Simple utility class to add parameters to an ActionForward 
 * from within an action. This action is useful when you from 
 * within an action need to pass parameters to the jsp page or another
action 
 * you are forwarding to.
 */
public class ActionForwardParameters {

/**
*  Encupsulates parameters for ActionForward.
*/

private Map params = new HashMap();

/**
 * add all the parameters and values from the hashtable to the
actionforward
 * @param parametersValues a hastable with key value pairs
 * @return ActionForwardParameters object
 */
public ActionForwardParameters add(Hashtable parametersValues) {
for(Iterator i =
parametersValues.keySet().iterator();i.hasNext();){
String key = (String) i.next();
params.put(key,(String) parametersValues.get(key));
}

return this;
}

/**
* Add parameters to provided ActionForward
* @param forward ActionForward to add parameters to
* @return ActionForward with added parameters to URL
*/
public ActionForward forward(ActionForward forward) {
StringBuffer path = new StringBuffer(forward.getPath());
Iterator iter = params.entrySet().iterator();
if (iter.hasNext()) {
//add first parameter, if avaliable
Map.Entry entry = (Map.Entry) iter.next();
path.append("?" + entry.getKey() + "=" + entry.getValue());
//add other parameters 
while (iter.hasNext()) {
entry = (Map.Entry) iter.next();
path.append("&" + entry.getKey() + "=" +
entry.getValue());
}
}

return new ActionForward(path.toString());
}

}


Please note that I didn't come up with the idea of this class, I simply
created the class after reading the information that a fellow programmer

Provided.!


-Oprindelig meddelelse-
Fra: Jay Glanville [mailto:[EMAIL PROTECTED] 
Sendt: 16. marts 2004 13:13
Til: 'Struts Users Mailing List'
Emne: RE: What is the best way to pass a parameter to a forward?


It's funny that you say that it will not work, because it does for me,
and without throwing any exceptions.

That being said, your point about modifying an action mappings forwards
is a good one.  It is unfortunate that the ActionForward class doesn't
have a copy constructor 

--
Jay Glanville


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper
> Sent: Monday, March 15, 2004 8:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: What is the best way to pass a parameter to a forward?
> 
> 
> What you are doing will not work - at least, not the way you
> are doing it.
> You are trying to modify the ActionForward instance that is 
> owned by Struts,
> and calling setPath() on that instance will result in an
> IllegalStateException.
> 
> You need to create your own ActionForward instance, instead
> of trying to
> modify Struts' one. You can do that with something like this:
> 
> ActionForward goto = mapping.findForward( "success" );
> String path = ...; // Put together your new path
> ActionForward myGoto = new ActionForward(path,
> goto.getRedirect());
> return myGoto;
> 
> --
> Martin Cooper
> 
> 
> "Glanville, Jay" <[EMAIL PROTECTED]> wrote
> in message
> news:[EMAIL PROTECTED]
> I'm trying to solve a problem, but I'm not sure my solution 
> is the best
> way.  Basically, I want to set a parameter on a forward within the
> action's execute.
> 
> I'm in my action's execute method.  I've just successfully performed 
> some work, and I now want to forward/redirect to the next page.  So, 
> I've got some code that looks like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   return goto;
>}
> 
> With an action mapping that looks like this:
> 
>   path="/EntrySave"
>   type="com.package.EntrySaveAction"
>   name="EntryForm"
>   validate="true"
>   input="/Entry.do">
>   
>   
>
> 
> Basically, if I left the EntrySaveAction.execute do what's doing right

> now, then upon successful completion, it would redirect to 
> "/Container.do".  However, what I want it to do is redir

RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Jay Glanville
It's funny that you say that it will not work, because it does for me,
and without throwing any exceptions.

That being said, your point about modifying an action mappings forwards
is a good one.  It is unfortunate that the ActionForward class doesn't
have a copy constructor 

--
Jay Glanville


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Martin Cooper
> Sent: Monday, March 15, 2004 8:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: What is the best way to pass a parameter to a forward?
> 
> 
> What you are doing will not work - at least, not the way you 
> are doing it.
> You are trying to modify the ActionForward instance that is 
> owned by Struts,
> and calling setPath() on that instance will result in an
> IllegalStateException.
> 
> You need to create your own ActionForward instance, instead 
> of trying to
> modify Struts' one. You can do that with something like this:
> 
> ActionForward goto = mapping.findForward( "success" );
> String path = ...; // Put together your new path
> ActionForward myGoto = new ActionForward(path, 
> goto.getRedirect());
> return myGoto;
> 
> --
> Martin Cooper
> 
> 
> "Glanville, Jay" <[EMAIL PROTECTED]> wrote 
> in message
> news:[EMAIL PROTECTED]
> I'm trying to solve a problem, but I'm not sure my solution 
> is the best
> way.  Basically, I want to set a parameter on a forward within the
> action's execute.
> 
> I'm in my action's execute method.  I've just successfully performed
> some work, and I now want to forward/redirect to the next page.  So,
> I've got some code that looks like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   return goto;
>}
> 
> With an action mapping that looks like this:
> 
>   path="/EntrySave"
>   type="com.package.EntrySaveAction"
>   name="EntryForm"
>   validate="true"
>   input="/Entry.do">
>   
>   
>
> 
> Basically, if I left the EntrySaveAction.execute do what's doing right
> now, then upon successful completion, it would redirect to
> "/Container.do".  However, what I want it to do is redirect to
> "/Container.do?id=45", where 45 is the id of the container that I want
> to go to.  The value of "45" is dynamic, and is know at the 
> time of the
> EntrySaveAction.execute command.
> 
> The way I'm currently doing it is something like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   String path = goto.getPath();
>   path += "?id=" + container.getId();
>   goto.setPath( path );
>   return goto;
>}
> 
> Is this the correct way to do this?  Is there a better way?
> 
> Thanks in advance
> 
> JDG
> 
> 
> --
> Jay Glanville
> 
> 
> 
> 
> -
> 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: What is the best way to pass a parameter to a forward?

2004-03-15 Thread Martin Cooper
What you are doing will not work - at least, not the way you are doing it.
You are trying to modify the ActionForward instance that is owned by Struts,
and calling setPath() on that instance will result in an
IllegalStateException.

You need to create your own ActionForward instance, instead of trying to
modify Struts' one. You can do that with something like this:

ActionForward goto = mapping.findForward( "success" );
String path = ...; // Put together your new path
ActionForward myGoto = new ActionForward(path, goto.getRedirect());
return myGoto;

--
Martin Cooper


"Glanville, Jay" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I'm trying to solve a problem, but I'm not sure my solution is the best
way.  Basically, I want to set a parameter on a forward within the
action's execute.

I'm in my action's execute method.  I've just successfully performed
some work, and I now want to forward/redirect to the next page.  So,
I've got some code that looks like this:

   public ActionForward execute(ActionMapping.) {
  // do some work
  ActionForward goto = mapping.findForward( "success" );
  return goto;
   }

With an action mapping that looks like this:

   
  
  
   

Basically, if I left the EntrySaveAction.execute do what's doing right
now, then upon successful completion, it would redirect to
"/Container.do".  However, what I want it to do is redirect to
"/Container.do?id=45", where 45 is the id of the container that I want
to go to.  The value of "45" is dynamic, and is know at the time of the
EntrySaveAction.execute command.

The way I'm currently doing it is something like this:

   public ActionForward execute(ActionMapping.) {
  // do some work
  ActionForward goto = mapping.findForward( "success" );
  String path = goto.getPath();
  path += "?id=" + container.getId();
  goto.setPath( path );
  return goto;
   }

Is this the correct way to do this?  Is there a better way?

Thanks in advance

JDG


--
Jay Glanville




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



Re: What is the best way to pass a parameter to a forward?

2004-03-15 Thread Joshua Tuberville
Jay,

Since Struts does not differentiate between a POST and a GET, passing
data as query parameters is the same as form data.  You could create a
form that has only the one field "id" which would be populated if you
called a URL of "/someAction?id=foo".  This is what I use when I create
dynamic links.  This is when I want this id to come from a link on a
page.

However when I am chaining Actions and need to pass values I usually set
values like that in the request scope using 

request.setAttribute(SOME_CONSTANT, idObject);

then just forward to the new action

Hope this helps,

Joshua

On Mon, 2004-03-15 at 16:46, Glanville, Jay wrote:
> I'm trying to solve a problem, but I'm not sure my solution is the best
> way.  Basically, I want to set a parameter on a forward within the
> action's execute.
> 
> I'm in my action's execute method.  I've just successfully performed
> some work, and I now want to forward/redirect to the next page.  So,
> I've got some code that looks like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   return goto;
>}
> 
> With an action mapping that looks like this:
> 
>   path="/EntrySave"
>   type="com.package.EntrySaveAction"
>   name="EntryForm"
>   validate="true"
>   input="/Entry.do">
>   
>   
>
> 
> Basically, if I left the EntrySaveAction.execute do what's doing right
> now, then upon successful completion, it would redirect to
> "/Container.do".  However, what I want it to do is redirect to
> "/Container.do?id=45", where 45 is the id of the container that I want
> to go to.  The value of "45" is dynamic, and is know at the time of the
> EntrySaveAction.execute command.
> 
> The way I'm currently doing it is something like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   String path = goto.getPath();
>   path += "?id=" + container.getId();
>   goto.setPath( path );
>   return goto;
>}
> 
> Is this the correct way to do this?  Is there a better way?
> 
> Thanks in advance
> 
> JDG
> 
> 
> --
> Jay Glanville
> 
> -
> 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: What is the best way to pass a parameter to a forward?

2004-03-15 Thread Gopalakrishnan, Jayesh
I have used this technique and it seems to be the only
way to have the name/value pair be passed as request parameters.
Don't think there's a request.setParameter() !!

But request.Attribute() would be the 'ideal' way to go.


-jayash



-Original Message-
From: Glanville, Jay [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 4:47 PM
To: Struts User List
Subject: What is the best way to pass a parameter to a forward?


I'm trying to solve a problem, but I'm not sure my solution is the best
way.  Basically, I want to set a parameter on a forward within the
action's execute.

I'm in my action's execute method.  I've just successfully performed
some work, and I now want to forward/redirect to the next page.  So,
I've got some code that looks like this:

   public ActionForward execute(ActionMapping.) {
  // do some work
  ActionForward goto = mapping.findForward( "success" );
  return goto;
   }

With an action mapping that looks like this:

   
  
  
   

Basically, if I left the EntrySaveAction.execute do what's doing right
now, then upon successful completion, it would redirect to
"/Container.do".  However, what I want it to do is redirect to
"/Container.do?id=45", where 45 is the id of the container that I want
to go to.  The value of "45" is dynamic, and is know at the time of the
EntrySaveAction.execute command.

The way I'm currently doing it is something like this:

   public ActionForward execute(ActionMapping.) {
  // do some work
  ActionForward goto = mapping.findForward( "success" );
  String path = goto.getPath();
  path += "?id=" + container.getId();
  goto.setPath( path );
  return goto;
   }

Is this the correct way to do this?  Is there a better way?

Thanks in advance

JDG


--
Jay Glanville

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



What is the best way to pass a parameter to a forward?

2004-03-15 Thread Glanville, Jay
I'm trying to solve a problem, but I'm not sure my solution is the best
way.  Basically, I want to set a parameter on a forward within the
action's execute.

I'm in my action's execute method.  I've just successfully performed
some work, and I now want to forward/redirect to the next page.  So,
I've got some code that looks like this:

   public ActionForward execute(ActionMapping.) {
  // do some work
  ActionForward goto = mapping.findForward( "success" );
  return goto;
   }

With an action mapping that looks like this:

   
  
  
   

Basically, if I left the EntrySaveAction.execute do what's doing right
now, then upon successful completion, it would redirect to
"/Container.do".  However, what I want it to do is redirect to
"/Container.do?id=45", where 45 is the id of the container that I want
to go to.  The value of "45" is dynamic, and is know at the time of the
EntrySaveAction.execute command.

The way I'm currently doing it is something like this:

   public ActionForward execute(ActionMapping.) {
  // do some work
  ActionForward goto = mapping.findForward( "success" );
  String path = goto.getPath();
  path += "?id=" + container.getId();
  goto.setPath( path );
  return goto;
   }

Is this the correct way to do this?  Is there a better way?

Thanks in advance

JDG


--
Jay Glanville

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



Re: Extending Request Processor to append request parameter

2004-03-06 Thread Michael McGrady
If it does not prevent the browser from going to its cache, which is 
different than preventing caching,  I guess, the browser would be badly 
malfunctioning, since it would be going to the cache to get a request which 
is not there.  Isn't this right?

Michael

At 05:50 PM 3/6/2004, you wrote:
It is isn't it. Struts 1.1 introduced some great features (thanks guys!) -
our Struts 1.0 app had a whole load of customizations including
ActionServlet but with 1.1 they are no longer needed. I love the plugins and
the RequestProcessor and the fact that you can configure it.
On this caching issue - whats peoples opinion of adding the a unique number
to every request - is this a 100% surefire way of preventing caching?
I researched caching on a couple of lists and I found somewhere the
following headers recommended.
   // HTTP/1.1 No Cache Headers
   response.setHeader("Cache-Control", "no-cache, no-store,
must-revalidate")
   // IE Extended HTTP/1.1 No Cache Headers
   response.addHeader("Cache-Control", "post-check=0, pre-check=0")
   // HTTP/1.0 No Cache Headers
   response.setHeader("Pragma", "no-cache")
   // Set expired
   response.setHeader("Expires", "0")
The standard Struts RequestProcessor sets the following headers (if noCache
is configured in the )
   response.setHeader("Cache-Control", "no-cache")
   response.setHeader("Pragma", "No-cache")
   response.setDateHeader("Expires", "1")
Comments welcome.

Niall

- Original Message -
From: "Geeta Ramani" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, March 07, 2004 1:12 AM
Subject: Re: Extending Request Processor to append request parameter
> *Sweet*!!  Thank you, Craig and Niall (got your name right this time,
huh?)...
> Struts gets to be any more fun, the department of homeland security is
gonna
> declare it an act of terrorism..
>
> Geeta
>
> Niall Pemberton wrote:
>
> > Geeta
> >
> > You don't need to subclass ActionServlet - you can set the
RequestProcessor
> > class in the  element in the struts-config.xml
> >
> > 
> >
> > Full details for the configuring the controller are in the user guide:
> >
> > http://jakarta.apache.org/struts/userGuide/configuration.html
> >
> > Niall
> >
> > - Original Message -
> > From: "Geeta Ramani" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Saturday, March 06, 2004 10:15 PM
> > Subject: Re: Extending Request Processor to append request parameter
> >
> > > Brad:
> > >
> > > I looked at the API and noticed the RequestProcessor is a 1.1
feature..
> > Your
> > > solution seems nice and clear!  I only have one question for you
though:
> > How
> > > do you "connect" the subclass of RequestProcessor that you wrote with
the
> > > struts ActionServlet..?  Do you have to subclass the ACtionServlet too
and
> > > then join the dots there? How do you do that?   There is a "
processor"
> > method
> > > in ActionServlet which returns the processor..but I don't see a
> > setProcessor
> > > method..?
> > >
> > > thanks for posting your solution: I learnt something new today..:)
> > > Geeta
> > >
> > > Brad Balmer wrote:
> > >
> > > > Well, I searched through the archives with no luck on
> > > > 'ParameterActionForward' or similar.  I ended up trying to ovveride
the
> > > > ActionForward class but couldn't get it to work well.  Then I
noticed in
> > > > the RequestProcessor there is a doForward() that can be ovveridden.
I
> > > > wrote the following and it seems to work.
> > > >
> > > > Is there a better way/place to do this than the RequestProcessor?
This
> > > > seems like a prettly locical/central place to do this.
> > > >
> > > > protected void doForward(
> > > > String path,
> > > > HttpServletRequest request,
> > > > HttpServletResponse response)
> > > > throws IOException, ServletException {
> > > > super.doForward(addUniqueParameterToURL(path), request,
> > response);
> > > > }
> > > >
> > > > private String addUniqueParameterToURL(String url) {
> > > > if(url == null) {
> > > > return url;
> > > > }
> > > > String newURL =  url
> 

Re: Extending Request Processor to append request parameter

2004-03-06 Thread Niall Pemberton
It is isn't it. Struts 1.1 introduced some great features (thanks guys!) -
our Struts 1.0 app had a whole load of customizations including
ActionServlet but with 1.1 they are no longer needed. I love the plugins and
the RequestProcessor and the fact that you can configure it.

On this caching issue - whats peoples opinion of adding the a unique number
to every request - is this a 100% surefire way of preventing caching?

I researched caching on a couple of lists and I found somewhere the
following headers recommended.

   // HTTP/1.1 No Cache Headers
   response.setHeader("Cache-Control", "no-cache, no-store,
must-revalidate")

   // IE Extended HTTP/1.1 No Cache Headers
   response.addHeader("Cache-Control", "post-check=0, pre-check=0")

   // HTTP/1.0 No Cache Headers
   response.setHeader("Pragma", "no-cache")

   // Set expired
   response.setHeader("Expires", "0")

The standard Struts RequestProcessor sets the following headers (if noCache
is configured in the )

   response.setHeader("Cache-Control", "no-cache")
   response.setHeader("Pragma", "No-cache")
   response.setDateHeader("Expires", "1")

Comments welcome.

Niall

- Original Message - 
From: "Geeta Ramani" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, March 07, 2004 1:12 AM
Subject: Re: Extending Request Processor to append request parameter


> *Sweet*!!  Thank you, Craig and Niall (got your name right this time,
huh?)...
> Struts gets to be any more fun, the department of homeland security is
gonna
> declare it an act of terrorism..
>
> Geeta
>
> Niall Pemberton wrote:
>
> > Geeta
> >
> > You don't need to subclass ActionServlet - you can set the
RequestProcessor
> > class in the  element in the struts-config.xml
> >
> > 
> >
> > Full details for the configuring the controller are in the user guide:
> >
> > http://jakarta.apache.org/struts/userGuide/configuration.html
> >
> > Niall
> >
> > - Original Message -
> > From: "Geeta Ramani" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Saturday, March 06, 2004 10:15 PM
> > Subject: Re: Extending Request Processor to append request parameter
> >
> > > Brad:
> > >
> > > I looked at the API and noticed the RequestProcessor is a 1.1
feature..
> > Your
> > > solution seems nice and clear!  I only have one question for you
though:
> > How
> > > do you "connect" the subclass of RequestProcessor that you wrote with
the
> > > struts ActionServlet..?  Do you have to subclass the ACtionServlet too
and
> > > then join the dots there? How do you do that?   There is a "
processor"
> > method
> > > in ActionServlet which returns the processor..but I don't see a
> > setProcessor
> > > method..?
> > >
> > > thanks for posting your solution: I learnt something new today..:)
> > > Geeta
> > >
> > > Brad Balmer wrote:
> > >
> > > > Well, I searched through the archives with no luck on
> > > > 'ParameterActionForward' or similar.  I ended up trying to ovveride
the
> > > > ActionForward class but couldn't get it to work well.  Then I
noticed in
> > > > the RequestProcessor there is a doForward() that can be ovveridden.
I
> > > > wrote the following and it seems to work.
> > > >
> > > > Is there a better way/place to do this than the RequestProcessor?
This
> > > > seems like a prettly locical/central place to do this.
> > > >
> > > > protected void doForward(
> > > > String path,
> > > > HttpServletRequest request,
> > > > HttpServletResponse response)
> > > > throws IOException, ServletException {
> > > > super.doForward(addUniqueParameterToURL(path), request,
> > response);
> > > > }
> > > >
> > > > private String addUniqueParameterToURL(String url) {
> > > > if(url == null) {
> > > > return url;
> > > > }
> > > > String newURL =  url
> > > > + ((url.indexOf("?") == -1) ? "?" : "&")
> > > > + "uid"
> > > > + "="
> > > > + Long.toString(System.currentTimeMillis());
> > > >

Re: Extending Request Processor to append request parameter

2004-03-06 Thread Geeta Ramani
*Sweet*!!  Thank you, Craig and Niall (got your name right this time, huh?)...
Struts gets to be any more fun, the department of homeland security is gonna
declare it an act of terrorism..

Geeta

Niall Pemberton wrote:

> Geeta
>
> You don't need to subclass ActionServlet - you can set the RequestProcessor
> class in the  element in the struts-config.xml
>
> 
>
> Full details for the configuring the controller are in the user guide:
>
> http://jakarta.apache.org/struts/userGuide/configuration.html
>
> Niall
>
> - Original Message -
> From: "Geeta Ramani" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Saturday, March 06, 2004 10:15 PM
> Subject: Re: Extending Request Processor to append request parameter
>
> > Brad:
> >
> > I looked at the API and noticed the RequestProcessor is a 1.1 feature..
> Your
> > solution seems nice and clear!  I only have one question for you though:
> How
> > do you "connect" the subclass of RequestProcessor that you wrote with the
> > struts ActionServlet..?  Do you have to subclass the ACtionServlet too and
> > then join the dots there? How do you do that?   There is a " processor"
> method
> > in ActionServlet which returns the processor..but I don't see a
> setProcessor
> > method..?
> >
> > thanks for posting your solution: I learnt something new today..:)
> > Geeta
> >
> > Brad Balmer wrote:
> >
> > > Well, I searched through the archives with no luck on
> > > 'ParameterActionForward' or similar.  I ended up trying to ovveride the
> > > ActionForward class but couldn't get it to work well.  Then I noticed in
> > > the RequestProcessor there is a doForward() that can be ovveridden.  I
> > > wrote the following and it seems to work.
> > >
> > > Is there a better way/place to do this than the RequestProcessor?  This
> > > seems like a prettly locical/central place to do this.
> > >
> > > protected void doForward(
> > > String path,
> > > HttpServletRequest request,
> > > HttpServletResponse response)
> > > throws IOException, ServletException {
> > > super.doForward(addUniqueParameterToURL(path), request,
> response);
> > > }
> > >
> > > private String addUniqueParameterToURL(String url) {
> > > if(url == null) {
> > > return url;
> > > }
> > > String newURL =  url
> > > + ((url.indexOf("?") == -1) ? "?" : "&")
> > > + "uid"
> > > + "="
> > > + Long.toString(System.currentTimeMillis());
> > > return newURL;
> > > }
> > >
> > > Curtis Taylor wrote:
> > >
> > > > Hi Brad,
> > > >
> > > > Someone on this list (sorry; can't remember who) subclassed
> > > > ActionForward to do exactly this. Search the archives for
> > > > ParameterActionForward.
> > > >
> > > > If you can't find it, email me off-list & I'll send you the Java file
> > > > (I have it stashed away somewhere.
> > > >
> > > > Curtis
> > > > --
> > > > c dot tee at verizon dot net
> > > >
> > > > Brad Balmer wrote:
> > > >
> > > >> I've been looking into this for a while and can't figure out how to
> > > >> do this easily.
> > > >>
> > > >> I would like to append a unique number to each request in an attempt
> > > >> to defeat caching (setting all the normal META tags as well as the
> > > >> 'nocache' in the controller doesn't seem to ALWAYS work).
> > > >>
> > > >> Therefore I wanted to append a Parameter to each request and add a
> > > >> unique number so that the server would not look in the cache. (Having
> > > >> the user change their browser caching mechanism isn't an option).
> > > >>
> > > >> I see where I can SEE the different request parameters, but where can
> > > >> I append a new parameter?  I would like to do this in a central
> > > >> location.
> > > >>
> > > >> Any ideas?  Has anybody else come up with a good way of doing this?
> > > >>
> > > >> Thanks.
> > &

Re: Extending Request Processor to append request parameter

2004-03-06 Thread Niall Pemberton
Geeta

You don't need to subclass ActionServlet - you can set the RequestProcessor
class in the  element in the struts-config.xml



Full details for the configuring the controller are in the user guide:

http://jakarta.apache.org/struts/userGuide/configuration.html

Niall

- Original Message - 
From: "Geeta Ramani" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 06, 2004 10:15 PM
Subject: Re: Extending Request Processor to append request parameter


> Brad:
>
> I looked at the API and noticed the RequestProcessor is a 1.1 feature..
Your
> solution seems nice and clear!  I only have one question for you though:
How
> do you "connect" the subclass of RequestProcessor that you wrote with the
> struts ActionServlet..?  Do you have to subclass the ACtionServlet too and
> then join the dots there? How do you do that?   There is a " processor"
method
> in ActionServlet which returns the processor..but I don't see a
setProcessor
> method..?
>
> thanks for posting your solution: I learnt something new today..:)
> Geeta
>
> Brad Balmer wrote:
>
> > Well, I searched through the archives with no luck on
> > 'ParameterActionForward' or similar.  I ended up trying to ovveride the
> > ActionForward class but couldn't get it to work well.  Then I noticed in
> > the RequestProcessor there is a doForward() that can be ovveridden.  I
> > wrote the following and it seems to work.
> >
> > Is there a better way/place to do this than the RequestProcessor?  This
> > seems like a prettly locical/central place to do this.
> >
> > protected void doForward(
> > String path,
> > HttpServletRequest request,
> > HttpServletResponse response)
> > throws IOException, ServletException {
> > super.doForward(addUniqueParameterToURL(path), request,
response);
> > }
> >
> > private String addUniqueParameterToURL(String url) {
> > if(url == null) {
> > return url;
> > }
> > String newURL =  url
> > + ((url.indexOf("?") == -1) ? "?" : "&")
> > + "uid"
> > + "="
> > + Long.toString(System.currentTimeMillis());
> > return newURL;
> > }
> >
> > Curtis Taylor wrote:
> >
> > > Hi Brad,
> > >
> > > Someone on this list (sorry; can't remember who) subclassed
> > > ActionForward to do exactly this. Search the archives for
> > > ParameterActionForward.
> > >
> > > If you can't find it, email me off-list & I'll send you the Java file
> > > (I have it stashed away somewhere.
> > >
> > > Curtis
> > > --
> > > c dot tee at verizon dot net
> > >
> > > Brad Balmer wrote:
> > >
> > >> I've been looking into this for a while and can't figure out how to
> > >> do this easily.
> > >>
> > >> I would like to append a unique number to each request in an attempt
> > >> to defeat caching (setting all the normal META tags as well as the
> > >> 'nocache' in the controller doesn't seem to ALWAYS work).
> > >>
> > >> Therefore I wanted to append a Parameter to each request and add a
> > >> unique number so that the server would not look in the cache. (Having
> > >> the user change their browser caching mechanism isn't an option).
> > >>
> > >> I see where I can SEE the different request parameters, but where can
> > >> I append a new parameter?  I would like to do this in a central
> > >> location.
> > >>
> > >> Any ideas?  Has anybody else come up with a good way of doing this?
> > >>
> > >> Thanks.
> > >>
> > >>
> > >> -
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > -
> > 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: Extending Request Processor to append request parameter

2004-03-06 Thread Craig R. McClanahan
Quoting Geeta Ramani <[EMAIL PROTECTED]>:

> Brad:
> 
> I looked at the API and noticed the RequestProcessor is a 1.1 feature.. Your
> solution seems nice and clear!  I only have one question for you though: How
> do you "connect" the subclass of RequestProcessor that you wrote with the
> struts ActionServlet..?  Do you have to subclass the ACtionServlet too and
> then join the dots there? How do you do that?   There is a " processor"
> method
> in ActionServlet which returns the processor..but I don't see a setProcessor
> method..?

This is done in your struts-config.xml file:

  

so that each module (in a multi-module app) can have its own custom
RequestProcessor if need be.

See the documentation in the DTD file itself (lib/struts-config_1_1.dtd) for
documentation on all the things you can configure here.

Craig


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



Re: Extending Request Processor to append request parameter

2004-03-06 Thread Geeta Ramani
Brad:

I looked at the API and noticed the RequestProcessor is a 1.1 feature.. Your
solution seems nice and clear!  I only have one question for you though: How
do you "connect" the subclass of RequestProcessor that you wrote with the
struts ActionServlet..?  Do you have to subclass the ACtionServlet too and
then join the dots there? How do you do that?   There is a " processor" method
in ActionServlet which returns the processor..but I don't see a setProcessor
method..?

thanks for posting your solution: I learnt something new today..:)
Geeta

Brad Balmer wrote:

> Well, I searched through the archives with no luck on
> 'ParameterActionForward' or similar.  I ended up trying to ovveride the
> ActionForward class but couldn't get it to work well.  Then I noticed in
> the RequestProcessor there is a doForward() that can be ovveridden.  I
> wrote the following and it seems to work.
>
> Is there a better way/place to do this than the RequestProcessor?  This
> seems like a prettly locical/central place to do this.
>
> protected void doForward(
> String path,
> HttpServletRequest request,
> HttpServletResponse response)
> throws IOException, ServletException {
> super.doForward(addUniqueParameterToURL(path), request, response);
> }
>
> private String addUniqueParameterToURL(String url) {
> if(url == null) {
> return url;
> }
> String newURL =  url
> + ((url.indexOf("?") == -1) ? "?" : "&")
> + "uid"
> + "="
> + Long.toString(System.currentTimeMillis());
> return newURL;
> }
>
> Curtis Taylor wrote:
>
> > Hi Brad,
> >
> > Someone on this list (sorry; can't remember who) subclassed
> > ActionForward to do exactly this. Search the archives for
> > ParameterActionForward.
> >
> > If you can't find it, email me off-list & I'll send you the Java file
> > (I have it stashed away somewhere.
> >
> > Curtis
> > --
> > c dot tee at verizon dot net
> >
> > Brad Balmer wrote:
> >
> >> I've been looking into this for a while and can't figure out how to
> >> do this easily.
> >>
> >> I would like to append a unique number to each request in an attempt
> >> to defeat caching (setting all the normal META tags as well as the
> >> 'nocache' in the controller doesn't seem to ALWAYS work).
> >>
> >> Therefore I wanted to append a Parameter to each request and add a
> >> unique number so that the server would not look in the cache. (Having
> >> the user change their browser caching mechanism isn't an option).
> >>
> >> I see where I can SEE the different request parameters, but where can
> >> I append a new parameter?  I would like to do this in a central
> >> location.
> >>
> >> Any ideas?  Has anybody else come up with a good way of doing this?
> >>
> >> Thanks.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> -
> 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: Extending Request Processor to append request parameter

2004-03-06 Thread Michael McGrady
I am failing to see what the problem is.  Just create a new parameter and 
give it a new number.  Why is that a problem?

At 09:23 AM 3/6/2004, you wrote:
Hi Brad,

Someone on this list (sorry; can't remember who) subclassed ActionForward 
to do exactly this. Search the archives for ParameterActionForward.

If you can't find it, email me off-list & I'll send you the Java file (I 
have it stashed away somewhere.

Curtis
--
c dot tee at verizon dot net
Brad Balmer wrote:
I've been looking into this for a while and can't figure out how to do 
this easily.
I would like to append a unique number to each request in an attempt to 
defeat caching (setting all the normal META tags as well as the 'nocache' 
in the controller doesn't seem to ALWAYS work).
Therefore I wanted to append a Parameter to each request and add a unique 
number so that the server would not look in the cache. (Having the user 
change their browser caching mechanism isn't an option).
I see where I can SEE the different request parameters, but where can I 
append a new parameter?  I would like to do this in a central location.
Any ideas?  Has anybody else come up with a good way of doing this?
Thanks.

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



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


Re: Extending Request Processor to append request parameter

2004-03-06 Thread Craig R. McClanahan
Quoting Brad Balmer <[EMAIL PROTECTED]>:

> Well, I searched through the archives with no luck on 
> 'ParameterActionForward' or similar.  I ended up trying to ovveride the 
> ActionForward class but couldn't get it to work well.  Then I noticed in 
> the RequestProcessor there is a doForward() that can be ovveridden.  I 
> wrote the following and it seems to work.
> 
> Is there a better way/place to do this than the RequestProcessor?  This 
> seems like a prettly locical/central place to do this.

That is indeed a pretty logical place for this kind of thing.

Craig McClanahan


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



Re: Extending Request Processor to append request parameter

2004-03-06 Thread Brad Balmer
Well, I searched through the archives with no luck on 
'ParameterActionForward' or similar.  I ended up trying to ovveride the 
ActionForward class but couldn't get it to work well.  Then I noticed in 
the RequestProcessor there is a doForward() that can be ovveridden.  I 
wrote the following and it seems to work.

Is there a better way/place to do this than the RequestProcessor?  This 
seems like a prettly locical/central place to do this.

   protected void doForward(
   String path,
   HttpServletRequest request,
   HttpServletResponse response)
   throws IOException, ServletException {   
   super.doForward(addUniqueParameterToURL(path), request, response);
   }

   private String addUniqueParameterToURL(String url) {
   if(url == null) {
   return url;
   }
   String newURL =  url
   + ((url.indexOf("?") == -1) ? "?" : "&")
   + "uid"
   + "="
   + Long.toString(System.currentTimeMillis());
   return newURL;
   }
Curtis Taylor wrote:

Hi Brad,

Someone on this list (sorry; can't remember who) subclassed 
ActionForward to do exactly this. Search the archives for 
ParameterActionForward.

If you can't find it, email me off-list & I'll send you the Java file 
(I have it stashed away somewhere.

Curtis
--
c dot tee at verizon dot net
Brad Balmer wrote:

I've been looking into this for a while and can't figure out how to 
do this easily.

I would like to append a unique number to each request in an attempt 
to defeat caching (setting all the normal META tags as well as the 
'nocache' in the controller doesn't seem to ALWAYS work).

Therefore I wanted to append a Parameter to each request and add a 
unique number so that the server would not look in the cache. (Having 
the user change their browser caching mechanism isn't an option).

I see where I can SEE the different request parameters, but where can 
I append a new parameter?  I would like to do this in a central 
location.

Any ideas?  Has anybody else come up with a good way of doing this?

Thanks.

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

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


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


Re: Extending Request Processor to append request parameter

2004-03-06 Thread Curtis Taylor
Hi Brad,

Someone on this list (sorry; can't remember who) subclassed ActionForward to do 
exactly this. Search the archives for ParameterActionForward.

If you can't find it, email me off-list & I'll send you the Java file (I have it 
stashed away somewhere.

Curtis
--
c dot tee at verizon dot net
Brad Balmer wrote:
I've been looking into this for a while and can't figure out how to do 
this easily.

I would like to append a unique number to each request in an attempt to 
defeat caching (setting all the normal META tags as well as the 
'nocache' in the controller doesn't seem to ALWAYS work).

Therefore I wanted to append a Parameter to each request and add a 
unique number so that the server would not look in the cache. (Having 
the user change their browser caching mechanism isn't an option).

I see where I can SEE the different request parameters, but where can I 
append a new parameter?  I would like to do this in a central location.

Any ideas?  Has anybody else come up with a good way of doing this?

Thanks.

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

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


Re: Extending Request Processor to append request parameter

2004-03-06 Thread Geeta Ramani
Oops, typo..

> In your Action classes, where you usually have something like:
> return mapping.findForward("success")
>
> you instead could have:
>
> return (Util.makeUnique("success"));

I meant:
return (Util.makeUnique(mapping.findForward("success")));

Geeta


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



Re: Extending Request Processor to append request parameter

2004-03-06 Thread Geeta Ramani
Brad:

Here's one very simple way of achieving your objective, but I am quite
certain other people will have better ones, but since this is kind of a
cute problem, I want to offer this as well..:)

First write a simple "util" method (I always have a Util class in my apps
where I gather stuff which seems to belong nowhere else..).  Anyways, write
a method with signature as follows:

private static String makeUnique(String)

which essentially takes a String (which will be a path) and will append a
"?random=aRandomNumber" (or "&random=aRandomNumber") to the end of the
input string  and returns it.

In Util, also write a public method as follows:

public static ActionForward makeUnique(ActionForward actionForward) {
return new ActionForward(makeUnique(actionForward.getPath()));
}

In your Action classes, where you usually have something like:
return mapping.findForward("success")

you instead could have:

return (Util.makeUnique("success"));

I think this is an ok solution and will work.. But like I said, I think the
gurus in this list will have better ideas (perhaps more in keeping with OO
principles) ..:)
Regards,
Geeta

Brad Balmer wrote:

> I've been looking into this for a while and can't figure out how to do
> this easily.
>
> I would like to append a unique number to each request in an attempt to
> defeat caching (setting all the normal META tags as well as the
> 'nocache' in the controller doesn't seem to ALWAYS work).
>
> Therefore I wanted to append a Parameter to each request and add a
> unique number so that the server would not look in the cache. (Having
> the user change their browser caching mechanism isn't an option).
>
> I see where I can SEE the different request parameters, but where can I
> append a new parameter?  I would like to do this in a central location.
>
> Any ideas?  Has anybody else come up with a good way of doing this?
>
> Thanks.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Extending Request Processor to append request parameter

2004-03-06 Thread Brad Balmer
I've been looking into this for a while and can't figure out how to do 
this easily.

I would like to append a unique number to each request in an attempt to 
defeat caching (setting all the normal META tags as well as the 
'nocache' in the controller doesn't seem to ALWAYS work).

Therefore I wanted to append a Parameter to each request and add a 
unique number so that the server would not look in the cache. (Having 
the user change their browser caching mechanism isn't an option).

I see where I can SEE the different request parameters, but where can I 
append a new parameter?  I would like to do this in a central location.

Any ideas?  Has anybody else come up with a good way of doing this?

Thanks.

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


RE: JavaScript Parameter

2004-02-26 Thread Andrew Hill
Mozilla has a JavaScript debugger that is very very useful for stepping
through the code to see where the error crops up. Worth downloading and
learning to use. Has saved many hours time for me I can say!

(alerts() are still very useful though. Espcially for bugs that only come up
in IE!)

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, 26 February 2004 18:58
To: Struts Users Mailing List
Subject: Re: JavaScript Parameter



First when debuging javascript alert boxes are handy.

alert(this.form,'<%= val %>')

or

alert(this.form,'')

or on tc 5

alert(this.form,'${val}')

if that does what you want start debuging the functions by using alert
boxes.

function myfunction(form,val) {
alert(form.name);
alert(val);
}

onclick="myfunction(this.form,'<%= val %>')"

if you use double quotes like you seem to be you may have to escape
them, generally easier to use ' rather than " when calling functions in
the html (in the actual script I prefer to stick to " as more
readable).

and so on. You should get to the bottom of your problem soon enough.

On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote:

> Hi,
> I have a scriptlet
> <% String val=obj.getValue("Key"); %>
> I need to use this value to be passed as a javascript parameter inorder
> to set a property value.
>
>  onclick="jsFunction(form,"<%=val%>")" />
> The parameter value is not being passed to jsFunction
>
> This works when I use a hardcoded value
>  />
>
> I have tried these variations aswell
>  onclick="jsFunction(form,<%=val%>)" />
>  onclick="jsFunction(form,'<%=val%>')" />
>
> Cud somebody please tell me the correct way to do this.
> Regards,
> Anirudh
>
>
>
>
> -
> 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]



[ot]Re: JavaScript Parameter

2004-02-26 Thread Mark Lowe
IE on PC (when i have to test) seems to also like complaining about 
javascript where it says it doesn't find object but then the script 
proceed to work anyway. And I thought id'ed document objects were 
loaded into an array when the page loads to.

I seem to recall that you can install a script debugger on windoze but 
i never really played with it long enough to see if it was useful or 
not.

I haven't played with mozilla js debugger I'll have to give it a go. 
But the only one available when i used to do a lot of dhtml development 
was in the old ns4 vs ie4 days and the two doms were too far apart for 
them to be useful.

On 26 Feb 2004, at 13:18, Andrew Hill wrote:

Mozilla has a JavaScript debugger that is very very useful for stepping
through the code to see where the error crops up. Worth downloading and
learning to use. Has saved many hours time for me I can say!
(alerts() are still very useful though. Espcially for bugs that only 
come up
in IE!)

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, 26 February 2004 18:58
To: Struts Users Mailing List
Subject: Re: JavaScript Parameter


First when debuging javascript alert boxes are handy.

alert(this.form,'<%= val %>')

or

alert(this.form,'')

or on tc 5

alert(this.form,'${val}')

if that does what you want start debuging the functions by using alert
boxes.
function myfunction(form,val) {
alert(form.name);
alert(val);
}
onclick="myfunction(this.form,'<%= val %>')"

if you use double quotes like you seem to be you may have to escape
them, generally easier to use ' rather than " when calling functions in
the html (in the actual script I prefer to stick to " as more
readable).
and so on. You should get to the bottom of your problem soon enough.

On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote:

Hi,
I have a scriptlet
<% String val=obj.getValue("Key"); %>
I need to use this value to be passed as a javascript parameter 
inorder
to set a property value.

")" />
The parameter value is not being passed to jsFunction
This works when I use a hardcoded value

/>

I have tried these variations aswell


Cud somebody please tell me the correct way to do this.
Regards,
Anirudh


-
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: [ot]Re: JavaScript Parameter

2004-02-26 Thread Jim Theodoridis
Another solution is to to see the source of the page 
ie->View->source


- Original Message - 
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 26, 2004 3:22 PM
Subject: [ot]Re: JavaScript Parameter


> IE on PC (when i have to test) seems to also like complaining about 
> javascript where it says it doesn't find object but then the script 
> proceed to work anyway. And I thought id'ed document objects were 
> loaded into an array when the page loads to.
> 
> I seem to recall that you can install a script debugger on windoze but 
> i never really played with it long enough to see if it was useful or 
> not.
> 
> I haven't played with mozilla js debugger I'll have to give it a go. 
> But the only one available when i used to do a lot of dhtml development 
> was in the old ns4 vs ie4 days and the two doms were too far apart for 
> them to be useful.
> 
> On 26 Feb 2004, at 13:18, Andrew Hill wrote:
> 
> > Mozilla has a JavaScript debugger that is very very useful for stepping
> > through the code to see where the error crops up. Worth downloading and
> > learning to use. Has saved many hours time for me I can say!
> >
> > (alerts() are still very useful though. Espcially for bugs that only 
> > come up
> > in IE!)
> >
> > -Original Message-
> > From: Mark Lowe [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, 26 February 2004 18:58
> > To: Struts Users Mailing List
> > Subject: Re: JavaScript Parameter
> >
> >
> >
> > First when debuging javascript alert boxes are handy.
> >
> > alert(this.form,'<%= val %>')
> >
> > or
> >
> > alert(this.form,'')
> >
> > or on tc 5
> >
> > alert(this.form,'${val}')
> >
> > if that does what you want start debuging the functions by using alert
> > boxes.
> >
> > function myfunction(form,val) {
> > alert(form.name);
> > alert(val);
> > }
> >
> > onclick="myfunction(this.form,'<%= val %>')"
> >
> > if you use double quotes like you seem to be you may have to escape
> > them, generally easier to use ' rather than " when calling functions in
> > the html (in the actual script I prefer to stick to " as more
> > readable).
> >
> > and so on. You should get to the bottom of your problem soon enough.
> >
> > On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote:
> >
> >> Hi,
> >> I have a scriptlet
> >> <% String val=obj.getValue("Key"); %>
> >> I need to use this value to be passed as a javascript parameter 
> >> inorder
> >> to set a property value.
> >>
> >>  >> onclick="jsFunction(form,"<%=val%>")" />
> >> The parameter value is not being passed to jsFunction
> >>
> >> This works when I use a hardcoded value
> >>  >> onclick="jsFunction(form,"1234")"
> >> />
> >>
> >> I have tried these variations aswell
> >>  >> onclick="jsFunction(form,<%=val%>)" />
> >>  >> onclick="jsFunction(form,'<%=val%>')" />
> >>
> >> Cud somebody please tell me the correct way to do this.
> >> Regards,
> >> Anirudh
> >>
> >>
> >>
> >>
> >> -
> >> 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: [ot]Re: JavaScript Parameter

2004-02-26 Thread Mark Lowe
yeah thanks..

you know, i'd never thought of that..



On 26 Feb 2004, at 15:39, Jim Theodoridis wrote:

Another solution is to to see the source of the page
ie->View->source
- Original Message -
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 26, 2004 3:22 PM
Subject: [ot]Re: JavaScript Parameter

IE on PC (when i have to test) seems to also like complaining about
javascript where it says it doesn't find object but then the script
proceed to work anyway. And I thought id'ed document objects were
loaded into an array when the page loads to.
I seem to recall that you can install a script debugger on windoze but
i never really played with it long enough to see if it was useful or
not.
I haven't played with mozilla js debugger I'll have to give it a go.
But the only one available when i used to do a lot of dhtml  
development
was in the old ns4 vs ie4 days and the two doms were too far apart for
them to be useful.

On 26 Feb 2004, at 13:18, Andrew Hill wrote:

Mozilla has a JavaScript debugger that is very very useful for  
stepping
through the code to see where the error crops up. Worth downloading  
and
learning to use. Has saved many hours time for me I can say!

(alerts() are still very useful though. Espcially for bugs that only
come up
in IE!)
-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, 26 February 2004 18:58
To: Struts Users Mailing List
Subject: Re: JavaScript Parameter


First when debuging javascript alert boxes are handy.

alert(this.form,'<%= val %>')

or

alert(this.form,'')

or on tc 5

alert(this.form,'${val}')

if that does what you want start debuging the functions by using  
alert
boxes.

function myfunction(form,val) {
alert(form.name);
alert(val);
}
onclick="myfunction(this.form,'<%= val %>')"

if you use double quotes like you seem to be you may have to escape
them, generally easier to use ' rather than " when calling functions  
in
the html (in the actual script I prefer to stick to " as more
readable).

and so on. You should get to the bottom of your problem soon enough.

On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote:

Hi,
I have a scriptlet
<% String val=obj.getValue("Key"); %>
I need to use this value to be passed as a javascript parameter
inorder
to set a property value.
")" />
The parameter value is not being passed to jsFunction
This works when I use a hardcoded value

I have tried these variations aswell


Cud somebody please tell me the correct way to do this.
Regards,
Anirudh


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


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


RE: JavaScript Parameter

2004-02-26 Thread Randy Dillon
Have you tried:




:-> -Original Message-
:-> From: Anirudh Jayanth [mailto:[EMAIL PROTECTED]
:-> Sent: Wednesday, February 25, 2004 10:32 PM
:-> To: 'Struts Users Mailing List'
:-> Subject: JavaScript Parameter
:-> 
:-> 
:-> Hi,
:-> I have a scriptlet
:-> <% String val=obj.getValue("Key"); %>
:-> I need to use this value to be passed as a javascript 
:-> parameter inorder
:-> to set a property value.
:-> 
:->  onclick="jsFunction(form,"<%=val%>")" />
:-> The parameter value is not being passed to jsFunction
:-> 
:-> This works when I use a hardcoded value
:->  onclick="jsFunction(form,"1234")"
:-> />
:-> 
:-> I have tried these variations aswell
:->  onclick="jsFunction(form,<%=val%>)" />
:->  onclick="jsFunction(form,'<%=val%>')" />
:-> 
:-> Cud somebody please tell me the correct way to do this.
:-> Regards,
:-> Anirudh
:-> 
:-> 
:-> 
:-> 
:-> 
:-> -
:-> 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: JavaScript Parameter

2004-02-26 Thread Anirudh Jayanth
Hi,
The solution that Randy suggested works perfectly. Another possible
solution is to use the scriptlet as a declaration. ie
<%! String val=obj.getValue("Key"); %>
Then val can be used within the javascript function directly without
have to pass it as a parameter. Ie
Function jsFunction() 
{
 alert(<%= val%>);
}

Thanks n Regards.


Anirudh Jayanth
SysArris Software 
120A, Elephant Rock Road, 
3rd Block, Jayanagar, 
Bangalore - 560011 
Tel: 6655165 / 052 [ ext - 244 ] 
[EMAIL PROTECTED] 


-Original Message-
From: Randy Dillon [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 26, 2004 8:27 PM
To: Struts Users Mailing List
Subject: RE: JavaScript Parameter


Have you tried:

 

:-> -Original Message-
:-> From: Anirudh Jayanth [mailto:[EMAIL PROTECTED]
:-> Sent: Wednesday, February 25, 2004 10:32 PM
:-> To: 'Struts Users Mailing List'
:-> Subject: JavaScript Parameter
:-> 
:-> 
:-> Hi,
:-> I have a scriptlet
:-> <% String val=obj.getValue("Key"); %>
:-> I need to use this value to be passed as a javascript 
:-> parameter inorder
:-> to set a property value.
:-> 
:->  onclick="jsFunction(form,"<%=val%>")" />
:-> The parameter value is not being passed to jsFunction
:-> 
:-> This works when I use a hardcoded value
:->  onclick="jsFunction(form,"1234")"
:-> />
:-> 
:-> I have tried these variations aswell
:->  onclick="jsFunction(form,<%=val%>)" />
:->  onclick="jsFunction(form,'<%=val%>')" />
:-> 
:-> Cud somebody please tell me the correct way to do this.
:-> Regards,
:-> Anirudh
:-> 
:-> 
:-> 
:-> 
:-> 
:-> -
:-> 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: JavaScript Parameter

2004-02-26 Thread Mark Lowe
First when debuging javascript alert boxes are handy.

alert(this.form,'<%= val %>')

or

alert(this.form,'')

or on tc 5

alert(this.form,'${val}')

if that does what you want start debuging the functions by using alert 
boxes.

function myfunction(form,val) {
alert(form.name);
alert(val);
}
onclick="myfunction(this.form,'<%= val %>')"

if you use double quotes like you seem to be you may have to escape 
them, generally easier to use ' rather than " when calling functions in 
the html (in the actual script I prefer to stick to " as more 
readable).

and so on. You should get to the bottom of your problem soon enough.

On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote:

Hi,
I have a scriptlet
<% String val=obj.getValue("Key"); %>
I need to use this value to be passed as a javascript parameter inorder
to set a property value.
")" />
The parameter value is not being passed to jsFunction
This works when I use a hardcoded value

I have tried these variations aswell


Cud somebody please tell me the correct way to do this.
Regards,
Anirudh


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


JavaScript Parameter

2004-02-25 Thread Anirudh Jayanth
Hi,
I have a scriptlet
<% String val=obj.getValue("Key"); %>
I need to use this value to be passed as a javascript parameter inorder
to set a property value.

")" />
The parameter value is not being passed to jsFunction

This works when I use a hardcoded value


I have tried these variations aswell



Cud somebody please tell me the correct way to do this.
Regards,
Anirudh




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



Re: Global Forward with parameter not giving expected results

2004-02-24 Thread Niall Pemberton
You are confusing your forward called "display" and your action "/display"

Clicking on the link in your jsp goes to your action - not your forward. The
process goes along the lines:

Request>Action->Forward

As far as I can see, your global forward is not being used (unless you are
returning the "display" forward in your SelectItemAction class).

If you had:

   HW

in your jsp - then you should see a value for type.


Niall

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 24, 2004 11:19 PM
Subject: Global Forward with parameter not giving expected results


> Hi,
>
> I am trying to use global forwards as suggested in the struts patterns on
> husted dot com but I am not seeing the request parameter (type) in the
> Action class. Here are the relevant pieces from different files.
>
> JSP Code
>
> HW
>
> struts-config
>
> 
> 
>
> 
>
> ...
>
>type="SelectItemAction" >
> 
> 
> 
> 
> 
>
> I get null for request parameter 'type' in the Action class
> SelectItemAction. What am I doing wrong here? Is my path defined properly
in
> the forward and in the action? Any pointers will be appreciated.
>
> Thanks
>
> AJ
>



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



Global Forward with parameter not giving expected results

2004-02-24 Thread asif . jiwani
Hi,

I am trying to use global forwards as suggested in the struts patterns on
husted dot com but I am not seeing the request parameter (type) in the
Action class. Here are the relevant pieces from different files.

JSP Code

HW

struts-config






...








I get null for request parameter 'type' in the Action class
SelectItemAction. What am I doing wrong here? Is my path defined properly in
the forward and in the action? Any pointers will be appreciated.

Thanks

AJ


Setter method signature when using the 'indexed' parameter of 'ht ml:checkbox'

2004-02-10 Thread Markus . Malmqvist
   Hi,

 

I have a checkbox inside a collection which is iterated inside JSP page.
Thus I must index the checkboxes to be able to tell which ones are checked.
However, I have been unable to find out which signature the corresponding
setter method of the actionform should have. I think I have tried all the
obvious ones and more... Could you please help?

 

  --markus

 



RE: Using Parameter in Action via the struts-config.xml

2004-02-05 Thread Anand Patil
It worked!!!

Thanks a lot 

Anand

-Original Message-
From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 04, 2004 1:49 PM
To: Struts Users Mailing List
Subject: RE: Using Parameter in Action via the struts-config.xml


There's a mapping.getParameter() method to 
fetch the parameter value.

I remember reading that its mostly used while 
using LookupDispatchAction.

Personally, I have used this parameter attibute 
to represent a flag/indicator to my action 
& it works fine.


-jayash


-Original Message-
From: Anand Patil [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 04, 2004 1:06 PM
To: [EMAIL PROTECTED]
Subject: Using Parameter in Action via the struts-config.xml


Hi All,
  The struts configuration DTD supports having a "parameter" attribute
to a "action". But how can I get the value specified in the "parameter"
attribute in my action class. Also using "set-property" inside a
"action" tag does not work? Anyone have any idea about this? 


Regards
Anand Patil

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


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



RE: Using Parameter in Action via the struts-config.xml

2004-02-04 Thread Gopalakrishnan, Jayesh
There's a mapping.getParameter() method to 
fetch the parameter value.

I remember reading that its mostly used while 
using LookupDispatchAction.

Personally, I have used this parameter attibute 
to represent a flag/indicator to my action 
& it works fine.


-jayash


-Original Message-
From: Anand Patil [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 04, 2004 1:06 PM
To: [EMAIL PROTECTED]
Subject: Using Parameter in Action via the struts-config.xml


Hi All,
  The struts configuration DTD supports having a "parameter" attribute
to a "action". But how can I get the value specified in the "parameter"
attribute in my action class. Also using "set-property" inside a
"action" tag does not work? Anyone have any idea about this? 


Regards
Anand Patil

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



RE: Using Parameter in Action via the struts-config.xml

2004-02-04 Thread Robert Taylor
>  But how can I get the value specified in the "parameter"
> attribute in my action class.
ActionMapping.getParameter() will get you the value of the parameter
attribute.

>  Also using "set-property" inside a
> "action" tag does not work?
It works for me. You have to subclass ActionMapping and declare it in your
struts-config file.




So when you use set-property, Struts can set those values using reflection.
My guess as to why
its not working is that it silently fails to set those properties because
they don't exist
in the default ActionMapping class.



robert


> -Original Message-
> From: Anand Patil [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 04, 2004 4:06 PM
> To: [EMAIL PROTECTED]
> Subject: Using Parameter in Action via the struts-config.xml
>
>
> Hi All,
>   The struts configuration DTD supports having a "parameter" attribute
> to a "action". But how can I get the value specified in the "parameter"
> attribute in my action class. Also using "set-property" inside a
> "action" tag does not work? Anyone have any idea about this?
>
>
> Regards
> Anand Patil
>


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



Using Parameter in Action via the struts-config.xml

2004-02-04 Thread Anand Patil
Hi All,
  The struts configuration DTD supports having a "parameter" attribute
to a "action". But how can I get the value specified in the "parameter"
attribute in my action class. Also using "set-property" inside a
"action" tag does not work? Anyone have any idea about this? 


Regards
Anand Patil


Re: Parameter ???

2004-01-31 Thread Otávio Augusto
Don't use the "ção" expression. Is that possible?

HTH
Otávio Augusto

On Thu, 29 Jan 2004 19:42:51 -0200
"Mauricio T. Ferraz" <[EMAIL PROTECTED]> wrote:

> How can I compare a parameter in my URL (someAction.do?type=Alteração) with
> the tag  do something
> 
> 
> The problem is the "ção" . How can I sove this ???
> 
> thanks
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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



RE: parameter

2004-01-30 Thread Matthias Wessendorf
oh...
saw the special char...
sorry...

-Original Message-
From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 30, 2004 11:25 AM
To: Struts Users Mailing List
Subject: parameter


How can I compare a parameter in my URL (someAction.do?type=Alteração)
with the tag  do something


The problem is the "ção" . How can I sove this ???

thanks



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



RE: parameter

2004-01-30 Thread Matthias Wessendorf
hi Mauricio,

yes it is Alteração :-)


cheers,

-Original Message-
From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 30, 2004 11:25 AM
To: Struts Users Mailing List
Subject: parameter


How can I compare a parameter in my URL (someAction.do?type=Alteração)
with the tag  do something


The problem is the "ção" . How can I sove this ???

thanks



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



parameter

2004-01-30 Thread Mauricio T. Ferraz
How can I compare a parameter in my URL (someAction.do?type=Alteração) with
the tag  do something


The problem is the "ção" . How can I sove this ???

thanks



Parameter ???

2004-01-30 Thread Mauricio T. Ferraz
How can I compare a parameter in my URL (someAction.do?type=Alteração) with
the tag  do something


The problem is the "ção" . How can I sove this ???

thanks


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



{ICICICARE#005-218-242}frame encode parameter in UTF-8

2004-01-29 Thread NRI Cell
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your 
mail and assure you of a response shortly.To help us serve you better, we would 
request you to kindly mention your account number or any reference number you may have 
in your future correspondence.  Kindly visit our website www.icicibank.com\nri to know 
more on our products and services.  With regards,Customer Care 
ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and 
confidential, and is directed to and for the use of the addressee only. If this 
message reaches anyone other than the intended recipient, we request the reader not to 
reproduce, copy, disseminate or in any manner distribute it. We further request such 
recipient to notify us immediately by return email and delete the original message. 
ICICI Bank Ltd. does not guarantee the security of any information transmitted 
electronically and is not liable for the proper, timely and complete transmission 
thereof. Before opening any attachments please check them for viruses and defects.



frame encode parameter in UTF-8

2004-01-29 Thread dutrieux
Hello,

I do that on my JSP:



The problem is that the parameter is encode in UTF-8 and all my page is 
in ISO-8859-1.
How can solve my problem.

Best regards

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


frame encode parameter in UTF-8

2004-01-29 Thread dutrieux
Hello,

I do that on my JSP:


The problem is that the parameter is encode in UTF-8 and all my page is
in ISO-8859-1.
How can solve my problem.
Best regards



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


RE: [DisplayTag] Use of ID= Parameter

2004-01-23 Thread Jerry Jalenak
Once I get this next release out I intend to begin converting over to JSTL.
I'll revisit the dynamic Id attribute at that time; until then, I can work
with a patched version of 

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


> -Original Message-
> From: Paul McCulloch [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 23, 2004 9:00 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [DisplayTag] Use of ID= Parameter
> 
> 
> Another thought. I believe that EL support has been added to 
> the CVS version
> of the taglib (or at least a special EL version) - maybe the 
> standard EL
> version supports a dynamic Id attribute?
> 
> > -Original Message-
> > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> > Sent: 23 January 2004 14:29
> > To: 'Struts Users Mailing List'
> > Subject: RE: [DisplayTag] Use of ID= Parameter
> > 
> > 
> > Paul -
> > 
> > Thanks!  I modifed the TLD, added the get/set methods for the 
> > tableId parm,
> > and modified the encodeParameter() method as suggested, and 
> > everything is
> > working as I expected.  Thanks again!
> > 
> > Jerry Jalenak
> > Development Manager, Web Publishing
> > LabOne, Inc.
> > 10101 Renner Blvd.
> > Lenexa, KS  66219
> > (913) 577-1496
> > 
> > [EMAIL PROTECTED]
> > 
> > 
> > > -Original Message-
> > > From: Paul McCulloch [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, January 23, 2004 4:20 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: RE: [DisplayTag] Use of ID= Parameter
> > > 
> > > 
> > > This has been raised before. See 
> > > 
> > > http://sourceforge.net/tracker/index.php?func=detail&aid=81300
> > > 6&group_id=730
> > > 68&atid=536613
> > > 
> > > I've patched the taglib to support an additional tableId 
> > > attribute which can
> > > be dynamic. This is a simple change to TableTag.java & the 
> > > supporting TLD.
> > > The other change is to encodeParameter() to use the new 
> > attribute for
> > > pagination and sorting URL generation.
> > > 
> > >   change
> > > 
> > > String stringIdentifier = "x-" + getId() + this.name;
> > > 
> > > to
> > > 
> > > String stringIdentifier = "x-" + getId() + 
> > this.tableid +
> > > this.name;
> > > 
> > > Paul
> > > 
> > > > -Original Message-
> > > > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> > > > Sent: 22 January 2004 16:27
> > > > To: '[EMAIL PROTECTED]'
> > > > Subject: [DisplayTag] Use of ID= Parameter
> > > > 
> > > > 
> > > > All,
> > > > 
> > > > I'm in the process of implementing the new  taglib, 
> > > > and am really
> > > > excited about the ability to have multiple, independent, 
> > > > tables on the same
> > > > page.  In order to make this work, though, the ID= parameter 
> > > > for each table
> > > > has to be different.  This is where I'm running into 
> > > > problems.  I've got my
> > > >  inside of a  so I can 
> > > > generate 1-n tables
> > > > - this works fine.  However, when I try to vary the ID= 
> > > > parameter, I get
> > > > ClassCastExceptions in 
> > org.displaytag.tags.TableTagExtraInfo on the
> > > > following line:
> > > > 
> > > > Object tagId = 
> data.getAttributeString(TagAttributeInfo.ID);
> > > > 
> > > > I've tried to define a page-scope variable and include it in 
> > > > a small chunk
> > > > of scriptlet code, but I just can't seem to get around this.  
> > > > Does anyone
> > > > have any ideas?
> > > > 
> > > > Thanks!
> > > > 
> > > > Jerry Jalenak
> > > > Development Manager, Web Publishing
> > > > LabOne, Inc.
> > > > 10101 Renner Blvd.
> > > > Lenexa, KS  66219
> > > > (913) 577-1496
> > > > 
> > > > [EMAIL PROTECTED]
> > > > 
> > > > 
> > > > This transmission (and any information attached to it) may be 
> > > > confidential and
> > &

RE: [DisplayTag] Use of ID= Parameter

2004-01-23 Thread Paul McCulloch
Another thought. I believe that EL support has been added to the CVS version
of the taglib (or at least a special EL version) - maybe the standard EL
version supports a dynamic Id attribute?

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> Sent: 23 January 2004 14:29
> To: 'Struts Users Mailing List'
> Subject: RE: [DisplayTag] Use of ID= Parameter
> 
> 
> Paul -
> 
> Thanks!  I modifed the TLD, added the get/set methods for the 
> tableId parm,
> and modified the encodeParameter() method as suggested, and 
> everything is
> working as I expected.  Thanks again!
> 
> Jerry Jalenak
> Development Manager, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> > -Original Message-
> > From: Paul McCulloch [mailto:[EMAIL PROTECTED]
> > Sent: Friday, January 23, 2004 4:20 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: [DisplayTag] Use of ID= Parameter
> > 
> > 
> > This has been raised before. See 
> > 
> > http://sourceforge.net/tracker/index.php?func=detail&aid=81300
> > 6&group_id=730
> > 68&atid=536613
> > 
> > I've patched the taglib to support an additional tableId 
> > attribute which can
> > be dynamic. This is a simple change to TableTag.java & the 
> > supporting TLD.
> > The other change is to encodeParameter() to use the new 
> attribute for
> > pagination and sorting URL generation.
> > 
> > change
> > 
> > String stringIdentifier = "x-" + getId() + this.name;
> > 
> > to
> > 
> > String stringIdentifier = "x-" + getId() + 
> this.tableid +
> > this.name;
> > 
> > Paul
> > 
> > > -Original Message-
> > > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> > > Sent: 22 January 2004 16:27
> > > To: '[EMAIL PROTECTED]'
> > > Subject: [DisplayTag] Use of ID= Parameter
> > > 
> > > 
> > > All,
> > > 
> > > I'm in the process of implementing the new  taglib, 
> > > and am really
> > > excited about the ability to have multiple, independent, 
> > > tables on the same
> > > page.  In order to make this work, though, the ID= parameter 
> > > for each table
> > > has to be different.  This is where I'm running into 
> > > problems.  I've got my
> > >  inside of a  so I can 
> > > generate 1-n tables
> > > - this works fine.  However, when I try to vary the ID= 
> > > parameter, I get
> > > ClassCastExceptions in 
> org.displaytag.tags.TableTagExtraInfo on the
> > > following line:
> > > 
> > >   Object tagId = data.getAttributeString(TagAttributeInfo.ID);
> > > 
> > > I've tried to define a page-scope variable and include it in 
> > > a small chunk
> > > of scriptlet code, but I just can't seem to get around this.  
> > > Does anyone
> > > have any ideas?
> > > 
> > > Thanks!
> > > 
> > > Jerry Jalenak
> > > Development Manager, Web Publishing
> > > LabOne, Inc.
> > > 10101 Renner Blvd.
> > > Lenexa, KS  66219
> > > (913) 577-1496
> > > 
> > > [EMAIL PROTECTED]
> > > 
> > > 
> > > This transmission (and any information attached to it) may be 
> > > confidential and
> > > is intended solely for the use of the individual or entity to 
> > > which it is
> > > addressed. If you are not the intended recipient or the 
> > > person responsible for
> > > delivering the transmission to the intended recipient, be 
> > > advised that you
> > > have received this transmission in error and that any use, 
> > > dissemination,
> > > forwarding, printing, or copying of this information is 
> > > strictly prohibited.
> > > If you have received this transmission in error, please 
> > > immediately notify
> > > LabOne at the following email address: 
> > > [EMAIL PROTECTED]
> > > 
> > > 
> > > 
> > 
> -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > > 
> > 
> > 
> > **
> > Axios Email Confidentiality Footer
> > Privileged/Confi

RE: [DisplayTag] Use of ID= Parameter

2004-01-23 Thread Paul McCulloch
It's just a pity I don't have time right now to produce patches for all the
mods I've made to the taglib. As it is I have to reapply my chnages every
release :-(

Paul

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> Sent: 23 January 2004 14:29
> To: 'Struts Users Mailing List'
> Subject: RE: [DisplayTag] Use of ID= Parameter
> 
> 
> Paul -
> 
> Thanks!  I modifed the TLD, added the get/set methods for the 
> tableId parm,
> and modified the encodeParameter() method as suggested, and 
> everything is
> working as I expected.  Thanks again!
> 
> Jerry Jalenak
> Development Manager, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> > -Original Message-
> > From: Paul McCulloch [mailto:[EMAIL PROTECTED]
> > Sent: Friday, January 23, 2004 4:20 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: [DisplayTag] Use of ID= Parameter
> > 
> > 
> > This has been raised before. See 
> > 
> > http://sourceforge.net/tracker/index.php?func=detail&aid=81300
> > 6&group_id=730
> > 68&atid=536613
> > 
> > I've patched the taglib to support an additional tableId 
> > attribute which can
> > be dynamic. This is a simple change to TableTag.java & the 
> > supporting TLD.
> > The other change is to encodeParameter() to use the new 
> attribute for
> > pagination and sorting URL generation.
> > 
> > change
> > 
> > String stringIdentifier = "x-" + getId() + this.name;
> > 
> > to
> > 
> > String stringIdentifier = "x-" + getId() + 
> this.tableid +
> > this.name;
> > 
> > Paul
> > 
> > > -Original Message-
> > > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> > > Sent: 22 January 2004 16:27
> > > To: '[EMAIL PROTECTED]'
> > > Subject: [DisplayTag] Use of ID= Parameter
> > > 
> > > 
> > > All,
> > > 
> > > I'm in the process of implementing the new  taglib, 
> > > and am really
> > > excited about the ability to have multiple, independent, 
> > > tables on the same
> > > page.  In order to make this work, though, the ID= parameter 
> > > for each table
> > > has to be different.  This is where I'm running into 
> > > problems.  I've got my
> > >  inside of a  so I can 
> > > generate 1-n tables
> > > - this works fine.  However, when I try to vary the ID= 
> > > parameter, I get
> > > ClassCastExceptions in 
> org.displaytag.tags.TableTagExtraInfo on the
> > > following line:
> > > 
> > >   Object tagId = data.getAttributeString(TagAttributeInfo.ID);
> > > 
> > > I've tried to define a page-scope variable and include it in 
> > > a small chunk
> > > of scriptlet code, but I just can't seem to get around this.  
> > > Does anyone
> > > have any ideas?
> > > 
> > > Thanks!
> > > 
> > > Jerry Jalenak
> > > Development Manager, Web Publishing
> > > LabOne, Inc.
> > > 10101 Renner Blvd.
> > > Lenexa, KS  66219
> > > (913) 577-1496
> > > 
> > > [EMAIL PROTECTED]
> > > 
> > > 
> > > This transmission (and any information attached to it) may be 
> > > confidential and
> > > is intended solely for the use of the individual or entity to 
> > > which it is
> > > addressed. If you are not the intended recipient or the 
> > > person responsible for
> > > delivering the transmission to the intended recipient, be 
> > > advised that you
> > > have received this transmission in error and that any use, 
> > > dissemination,
> > > forwarding, printing, or copying of this information is 
> > > strictly prohibited.
> > > If you have received this transmission in error, please 
> > > immediately notify
> > > LabOne at the following email address: 
> > > [EMAIL PROTECTED]
> > > 
> > > 
> > > 
> > 
> -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > > 
> > 
> > 
> > **
> > Axios Email Confidentiality Footer
> > Privileged/Confidential I

RE: [DisplayTag] Use of ID= Parameter

2004-01-23 Thread Jerry Jalenak
Paul -

Thanks!  I modifed the TLD, added the get/set methods for the tableId parm,
and modified the encodeParameter() method as suggested, and everything is
working as I expected.  Thanks again!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


> -Original Message-
> From: Paul McCulloch [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 23, 2004 4:20 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [DisplayTag] Use of ID= Parameter
> 
> 
> This has been raised before. See 
> 
> http://sourceforge.net/tracker/index.php?func=detail&aid=81300
> 6&group_id=730
> 68&atid=536613
> 
> I've patched the taglib to support an additional tableId 
> attribute which can
> be dynamic. This is a simple change to TableTag.java & the 
> supporting TLD.
> The other change is to encodeParameter() to use the new attribute for
> pagination and sorting URL generation.
> 
>   change
> 
> String stringIdentifier = "x-" + getId() + this.name;
> 
> to
> 
> String stringIdentifier = "x-" + getId() + this.tableid +
> this.name;
> 
> Paul
> 
> > -Original Message-----
> > From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> > Sent: 22 January 2004 16:27
> > To: '[EMAIL PROTECTED]'
> > Subject: [DisplayTag] Use of ID= Parameter
> > 
> > 
> > All,
> > 
> > I'm in the process of implementing the new  taglib, 
> > and am really
> > excited about the ability to have multiple, independent, 
> > tables on the same
> > page.  In order to make this work, though, the ID= parameter 
> > for each table
> > has to be different.  This is where I'm running into 
> > problems.  I've got my
> >  inside of a  so I can 
> > generate 1-n tables
> > - this works fine.  However, when I try to vary the ID= 
> > parameter, I get
> > ClassCastExceptions in org.displaytag.tags.TableTagExtraInfo on the
> > following line:
> > 
> > Object tagId = data.getAttributeString(TagAttributeInfo.ID);
> > 
> > I've tried to define a page-scope variable and include it in 
> > a small chunk
> > of scriptlet code, but I just can't seem to get around this.  
> > Does anyone
> > have any ideas?
> > 
> > Thanks!
> > 
> > Jerry Jalenak
> > Development Manager, Web Publishing
> > LabOne, Inc.
> > 10101 Renner Blvd.
> > Lenexa, KS  66219
> > (913) 577-1496
> > 
> > [EMAIL PROTECTED]
> > 
> > 
> > This transmission (and any information attached to it) may be 
> > confidential and
> > is intended solely for the use of the individual or entity to 
> > which it is
> > addressed. If you are not the intended recipient or the 
> > person responsible for
> > delivering the transmission to the intended recipient, be 
> > advised that you
> > have received this transmission in error and that any use, 
> > dissemination,
> > forwarding, printing, or copying of this information is 
> > strictly prohibited.
> > If you have received this transmission in error, please 
> > immediately notify
> > LabOne at the following email address: 
> > [EMAIL PROTECTED]
> > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> **
> Axios Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this 
> message. If you are not the addressee indicated in this 
> message (or responsible for delivery of the message to such 
> person), you may not copy or deliver this message to anyone. 
> In such case, you should destroy this message, and notify us 
> immediately. If you or your employer does not consent to 
> Internet email messages of this kind, please advise us 
> immediately. Opinions, conclusions and other information 
> expressed in this message are not given or endorsed by my 
> Company or employer unless otherwise indicated by an 
> authorised representative independent of this message.
> WARNING:
> While Axios Systems Ltd takes steps to prevent computer 
> viruses from being transmitted via electronic mail 
> attachments we cannot guarantee that attachments do not 
> contain computer virus code.  You are therefore strongly 
> advised to undertake anti virus checks prior to accessing the 
> attachment to this electronic mail.  Axi

RE: [DisplayTag] Use of ID= Parameter

2004-01-23 Thread Paul McCulloch
This has been raised before. See 

http://sourceforge.net/tracker/index.php?func=detail&aid=813006&group_id=730
68&atid=536613

I've patched the taglib to support an additional tableId attribute which can
be dynamic. This is a simple change to TableTag.java & the supporting TLD.
The other change is to encodeParameter() to use the new attribute for
pagination and sorting URL generation.

change

String stringIdentifier = "x-" + getId() + this.name;

to

String stringIdentifier = "x-" + getId() + this.tableid +
this.name;

Paul

> -Original Message-
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
> Sent: 22 January 2004 16:27
> To: '[EMAIL PROTECTED]'
> Subject: [DisplayTag] Use of ID= Parameter
> 
> 
> All,
> 
> I'm in the process of implementing the new  taglib, 
> and am really
> excited about the ability to have multiple, independent, 
> tables on the same
> page.  In order to make this work, though, the ID= parameter 
> for each table
> has to be different.  This is where I'm running into 
> problems.  I've got my
>  inside of a  so I can 
> generate 1-n tables
> - this works fine.  However, when I try to vary the ID= 
> parameter, I get
> ClassCastExceptions in org.displaytag.tags.TableTagExtraInfo on the
> following line:
> 
>   Object tagId = data.getAttributeString(TagAttributeInfo.ID);
> 
> I've tried to define a page-scope variable and include it in 
> a small chunk
> of scriptlet code, but I just can't seem to get around this.  
> Does anyone
> have any ideas?
> 
> Thanks!
> 
> Jerry Jalenak
> Development Manager, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be 
> confidential and
> is intended solely for the use of the individual or entity to 
> which it is
> addressed. If you are not the intended recipient or the 
> person responsible for
> delivering the transmission to the intended recipient, be 
> advised that you
> have received this transmission in error and that any use, 
> dissemination,
> forwarding, printing, or copying of this information is 
> strictly prohibited.
> If you have received this transmission in error, please 
> immediately notify
> LabOne at the following email address: 
> [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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


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



[DisplayTag] Use of ID= Parameter

2004-01-22 Thread Jerry Jalenak
All,

I'm in the process of implementing the new  taglib, and am really
excited about the ability to have multiple, independent, tables on the same
page.  In order to make this work, though, the ID= parameter for each table
has to be different.  This is where I'm running into problems.  I've got my
 inside of a  so I can generate 1-n tables
- this works fine.  However, when I try to vary the ID= parameter, I get
ClassCastExceptions in org.displaytag.tags.TableTagExtraInfo on the
following line:

Object tagId = data.getAttributeString(TagAttributeInfo.ID);

I've tried to define a page-scope variable and include it in a small chunk
of scriptlet code, but I just can't seem to get around this.  Does anyone
have any ideas?

Thanks!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [EMAIL PROTECTED]


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



RE: passing request parameter to mapping.findForward(alias)

2004-01-08 Thread Richard Hightower
I am sure there are more than two ways... but those are the two I could
think of.

Rick Hightower
Developer

Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm

Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring

-Original Message-
From: Richard Hightower [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 12:20 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: passing request parameter to mapping.findForward(alias)


there are at least two ways

static parameter?



dynamic? (in execute method)

ActionForward forward = mapping.findForward("success");

return new ActionForward(forward.getPath() + "?foo=" + bar);


[check the java docs on the second one... i am doing it from memory, i've
done it before... it is the basic idea]

-Original Message-
From: N.N.S.S Ravi Krishna [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 11:13 PM
To: 'struts users'
Subject: passing request parameter to mapping.findForward(alias)


Hi All,
how to send a parameter along with the forward alias name in mapping
.findForward(xyz).any help is appreciated

thanks in advance,
ravi


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



RE: passing request parameter to mapping.findForward(alias)

2004-01-08 Thread Richard Hightower
there are at least two ways

static parameter?



dynamic? (in execute method)

ActionForward forward = mapping.findForward("success");

return new ActionForward(forward.getPath() + "?foo=" + bar);


[check the java docs on the second one... i am doing it from memory, i've
done it before... it is the basic idea]

-Original Message-
From: N.N.S.S Ravi Krishna [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 11:13 PM
To: 'struts users'
Subject: passing request parameter to mapping.findForward(alias)


Hi All,
how to send a parameter along with the forward alias name in mapping
.findForward(xyz).any help is appreciated

thanks in advance,
ravi


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



passing request parameter to mapping.findForward(alias)

2004-01-07 Thread N.N.S.S Ravi Krishna
Hi All,
how to send a parameter along with the forward alias name in mapping
.findForward(xyz).any help is appreciated

thanks in advance,
ravi


Bean As A Parameter In A Method - Compilation Error

2003-12-31 Thread Caroline Jen
I followed the MVC design.  I give the data access
activity (insertThread) to the ThreadHandler class. 
And a bean is passed as a parameter of the
insertThread method.  However, I got compilation error
saying that 

insertThread(java.lang.String, java.lang.String, ... ,
java.sql.Timastamp, int, ... ) cannto be applied to
the ThreadBean.
and the error complains the statement in my action
class:
threadID = thandler.insertThread( threadBean );

This is what I did in the action class:

ThreadHandler thandler = new ThreadHandler();
ThreadBean threadBean = new ThreadBean();
BeanUtils.copyProperties( threadBean, postForm );

if (parentPostID == 0 ) // new topic
{
   threadBean.setLastPostMemberName( memberName );
   threadBean.setThreadCreationDate( now );
   threadBean.setThreadViewCount( 0 );
   threadBean.setThreadReplyCount( 0 );

   threadID = thandler.insertThread( threadBean );
}

and this is what I did in the ThreadHandler class:

class ThreadHandler extends ThreadBean 
{
   String receiver = getReceiver();
   String sender = getSender();
   String title = getTitle();
   String lastPostMemberName =
getLastPostMemberName();
   String threadTopic = getThreadTopic();
   String threadBody = getThreadBody();
   Timestamp threadCreationDate =
getThreadCreationDate();
   int threadViewCount = getThreadViewCount();
   int threadReplyCount = getThreadReplyCount();

   public ThreadHandler() {}

   public int insertThread( String receiver, String
sender, String title, String lastPostMemberName,
String threadTopic, String threadBody, Timestamp
threadCreationDate, int threadViewCount, int
threadReplyCount ) throws MessageDAOSysException
   {  }
}

__
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

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



Re: findByProperty() in the scaffold.sql.AccessBase - Need One Additional Parameter to the Pair of Property/Value

2003-10-31 Thread Caroline Jen
Please help.  Need your clever ideas.  Thank you.
--- Caroline Jen <[EMAIL PROTECTED]> wrote:
> I am using the findByProperty method in the
> org.apache.commons.scaffold.sql.AccessBase.  The
> findByProperty method takes "one" pair of
> property/value as it parameters.  As such, visitors
> of
> the web site can query all articles in the database
> by
> providing 'author' as the property and supply the
> name
> of the author (xyz) as value.
> 
> public static final Collection findByProperty
> (
> Object target,
> String property,
> String value
> ) throws ParameterException, PopulateException,
> ResourceException
> 
> I have this field "category" in my database.  I want
> to search and get all the articles written by
> author(property) with name xyz (value) within the
> HISTORY category.  The value of the category will be
> supplied by the application developer (NOT BY THE
> VISITOR of the web site via selecting from a
> drop-down
> list and fill out the value in the text field).
> 
> I need help in handling this kind of situation. 
> Thanks in advance.
> 
> -Caroline
> 
> __
> Do you Yahoo!?
> Exclusive Video Premiere - Britney Spears
> http://launch.yahoo.com/promos/britneyspears/
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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



findByProperty() in the scaffold.sql.AccessBase - Need One Additional Parameter to the Pair of Property/Value

2003-10-30 Thread Caroline Jen
I am using the findByProperty method in the
org.apache.commons.scaffold.sql.AccessBase.  The
findByProperty method takes "one" pair of
property/value as it parameters.  As such, visitors of
the web site can query all articles in the database by
providing 'author' as the property and supply the name
of the author (xyz) as value.

public static final Collection findByProperty
(
Object target,
String property,
String value
) throws ParameterException, PopulateException,
ResourceException

I have this field "category" in my database.  I want
to search and get all the articles written by
author(property) with name xyz (value) within the
HISTORY category.  The value of the category will be
supplied by the application developer (NOT BY THE
VISITOR of the web site via selecting from a drop-down
list and fill out the value in the text field).

I need help in handling this kind of situation. 
Thanks in advance.

-Caroline

__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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



Re: Redirect w. generic parameter using action forward

2003-10-14 Thread Morten
Robert Taylor wrote:
You can do this in your action class manually:

ActionForward forward = mapping.findForward("success");
String path = forward.getPath();
path += "?file=" + fileName; // url encoded file name
return new ActionForward(path, true); // redirect
Ooh, thanks.

There are more slick ways to do this, but this should put you
on the right track.
What do you mean "more slick ways"? By configuration? I've looked at the
API but don't really see any shortcuts.
Thanks for the help,

Morten



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


RE: Redirect w. generic parameter using action forward

2003-10-13 Thread Robert Taylor
You can do this in your action class manually:

ActionForward forward = mapping.findForward("success");
String path = forward.getPath();
path += "?file=" + fileName; // url encoded file name
return new ActionForward(path, true); // redirect

There are more slick ways to do this, but this should put you
on the right track.

robert


> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Morten
> Sent: Monday, October 13, 2003 12:37 PM
> To: [EMAIL PROTECTED]
> Subject: Redirect w. generic parameter using action forward
> 
> 
> 
> Hi,
> 
> Is it possible to add a parameter to the redirect when redirecting
> via an action forward?
> 
> Eg.
> 
> 
>    
> 
> 
> In my.struts.Action I wish to set the parameter file=foo.txt parameter
> in the redirect request, ie. effectively, I want the following to
> happen:
> 
>response.sendRedirect("/streamingservlet/?file="+fileName);
> 
> Can (should) this be done with actionMapping.findForward("success");
> or do I need to forward to a JSP which in turn reads the fileName as
> a request attribute and does the forward?
> 
> Thanks in advance,
> 
> Morten
> 
> 
> 
> 
> -
> 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]



Redirect w. generic parameter using action forward

2003-10-13 Thread Morten
Hi,

Is it possible to add a parameter to the redirect when redirecting
via an action forward?
Eg.


  

In my.struts.Action I wish to set the parameter file=foo.txt parameter
in the redirect request, ie. effectively, I want the following to
happen:
  response.sendRedirect("/streamingservlet/?file="+fileName);

Can (should) this be done with actionMapping.findForward("success");
or do I need to forward to a JSP which in turn reads the fileName as
a request attribute and does the forward?
Thanks in advance,

Morten



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


RE: Can I get parameter using bean tag?

2003-10-03 Thread Richard J. Duncan
Try 

Regards,
 
Rich


-Original Message-
From: Barry Volpe [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 03, 2003 2:11 PM
To: Struts Users Mailing List
Subject: Can I get parameter using bean tag?

I have the following fowarding jsp's

myjsp.jsp?type=type1

myjsp.jsp?type=type2

I'm not sure if this is valid but I would like to use a tag(bean tag?)
in my jsp to identify if type = type1 or type = type 2.

I wanted to use this information to set radio button default values.
One default when type=type1 and the other default value 
when type = type2 (calling the same jsp, myjsp.jsp).

Can a bean tag grab a name/value pair like above?


Any suggestions?

Thanks,
Barry

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



RE: Can I get parameter using bean tag?

2003-10-03 Thread Wendy Smoak

> I wanted to use this information to set radio button default values.
One default when
> type=type1 and the other default value 
> when type = type2 (calling the same jsp, myjsp.jsp).

Make your decisions in the Action code, set the appropriate property of
the ActionForm to the correct value, then forward to the JSP.  Struts
will take care of pre-selecting the value based on what you put in the
ActionForm.

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

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



RE: Can I get parameter using bean tag?

2003-10-03 Thread Hibbs, David
Yep.  See the bean:parameter tag at
http://jakarta.apache.org/struts/userGuide/struts-bean.html#parameter

David Hibbs
Staff Programmer / Analyst
American National Insurance Company

> -Original Message-
> From: Barry Volpe [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 03, 2003 1:11 PM
> To: Struts Users Mailing List
> Subject: Can I get parameter using bean tag?
> 
> 
> I have the following fowarding jsp's
> 
> myjsp.jsp?type=type1
> 
> myjsp.jsp?type=type2
> 
> I'm not sure if this is valid but I would like to use a tag(bean tag?)
> in my jsp to identify if type = type1 or type = type 2.
> 
> I wanted to use this information to set radio button default values.
> One default when type=type1 and the other default value 
> when type = type2 (calling the same jsp, myjsp.jsp).
> 
> Can a bean tag grab a name/value pair like above?
> 
> 
> Any suggestions?
> 
> Thanks,
> Barry
> 

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



Can I get parameter using bean tag?

2003-10-03 Thread Barry Volpe
I have the following fowarding jsp's

myjsp.jsp?type=type1

myjsp.jsp?type=type2

I'm not sure if this is valid but I would like to use a tag(bean tag?)
in my jsp to identify if type = type1 or type = type 2.

I wanted to use this information to set radio button default values.
One default when type=type1 and the other default value 
when type = type2 (calling the same jsp, myjsp.jsp).

Can a bean tag grab a name/value pair like above?


Any suggestions?

Thanks,
Barry

RE: How can I place a parameter back on the URL

2003-10-02 Thread Menke, John
Use JSTL:




 

">
Link Text



-Original Message-
From: John Habbouche [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 12:51 PM
To: Struts Users Mailing List
Subject: How can I place a parameter back on the URL


I have invoking a JSP with a parameter appended to the jsp name (i.e.
jsname.jsp?from=main) using Struts and Tag  libraries.  This parameter is
specified as part of the struts-config.xml forward element.  When I enter my
jsp, I check to see if my parameter is there by invoking:



This statement evaluates to true.  When I click on my submit button, my
form's validate method gets called which is what I expect since I have
requested validation in my action in struts-config.xml file.  Now if the
form fails to validate, the same JSP is invoked since this is what is
specified as part of my "input" element in my action.  The
question is:

How can I place the parameter back on the URL (i.e. from=main) in my JSP
prior to pressing the submit button using an elegant way (i.e. Tags) without
using scriplets.  I am using a form:



and I need to be able to append a parameter to the action value
(/editUser.do) except the parameter  must be dynamic (i.e. the "from" must
be dynamic, extrated from the request with request.getParameter("from").
The value can change depending on where I am coming from.   The end result
should look like this:



Any help would be greatly appreciated.



-
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: default for parameter

2003-09-29 Thread Steve Raeburn
http://jakarta.apache.org/struts/api/org/apache/struts/actions/DispatchActio
n.html

Take a look at the 'unspecfied' method.

Steve

> -Original Message-
> From: deepaksawdekar [mailto:[EMAIL PROTECTED]
> Sent: September 29, 2003 5:17 AM
> To: Struts Users Mailing List
> Subject: default for parameter
>
>
> Hi,
> I have a action class extended for DispatchAction class.
> Is there any way if the parameter value is not define it will
> call some predefine method.
>
> e.g
> my strut config is as follows
>  path="/Project"
> type="com.ft.pmp.gui.action.local.ProjectAction"
> name="ProjectForm"
> scope="session"
> parameter="dispatch"
> validate="false">
>
>  path="/pages/localadmin/locCreateProject.jsp"/>
> 
>
>
> Now if there is no dispatch variable in any scope, is there any
> way by which a some defalut method will be called.
>
>
> Thanks and regards
> Deepak
>
>
>
> -
> 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]



default for parameter

2003-09-29 Thread deepaksawdekar
Hi,
I have a action class extended for DispatchAction class.
Is there any way if the parameter value is not define it will call some predefine 
method.

e.g
my strut config is as follows






Now if there is no dispatch variable in any scope, is there any way by which a some 
defalut method will be called.


Thanks and regards
Deepak 



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



Action parameter field

2003-09-19 Thread Gregory F. March

I have an  tag that is passing paramId, paramName and
paramProperty to a LookupDispatchAction action.

How can I set the parameter so the LookupDispatchAction functions
properly?  I know I can do it with javascript, but I don't like
hardcoding the parameter in the jsp.  I also know that the html:link tag
can take a map, but I don't know how to build that in my jsp.

I was thinking of having the link call a forward action and that action
could specify a parameter in addition to the one that I set, but I'm not
sure if this can be done, and I can't find any reference as to the
syntax of the parameter attribute of an action in the struts-config.xml
file.  Is it something like:

   parameter="my.forward.location;myAction=processrequest" ?

Thanks,

/greg

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

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



RE: REPOST: IMP :: Defining a single parameter when returning Col lection of F orm Beans as Request Attribute

2003-09-18 Thread Chawla, Yogesh
Thanks Matt.
Not able to find relevant info for what to do for Search in the archives
too..

-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 18, 2003 8:27 PM
To: Struts Users Mailing List
Subject: Re: REPOST: IMP :: Defining a single parameter when returning
Collection of F orm Beans as Request Attribute


If you are using  then the hidden parameter you are passing
MUST be a property of the form bean.  A simple work-around is to just use
 directly instead of using the Struts HTML taglib.

Search results is a long discussion, and I'm not sure what the best
practices are.  There's no info in the archives?

Matt
- Original Message - 
From: "Chawla, Yogesh" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 18, 2003 10:45 AM
Subject: REPOST: IMP :: Defining a single parameter when returning
Collection of F orm Beans as Request Attribute


>
> Hi,
> I am returning a collection of Form Beans form where I iterate and get the
> results of my serach page. This collection I put into the request
attribute.
>
> However, I have some common attributes like page no which are not bean
> parameters but are one single value for the whole search page like a
> parameter called "pageNo".
>
> Now when I use the html:hidden, it requires the property="pageNo" to be a
> bean parameter !!
> And gives error when I pass this as request object. As under ::
>
>  value="<%=Integer.parseInt((String)request.getAttribute("pageNo"))%>">
>
> Anybody can give ideas for this:
>
> Another Design Issue : Search Results page, how to return the set of Form
> Beans ? Whats the best approach.
>
> When the validate method fails, it is able to read any attributes which
were
> being picked from the request.getAttribute() call.
>
>
> Thanks for your advice !!
>
> Yogesh
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee.  Access to
this
> message by anyone else is unauthorised.  If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may
be
> unlawful.  Please immediately contact the sender if you have received this
> message in error. Thank you.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee.  Access to
this
> message by anyone else is unauthorised.  If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may
be
> unlawful.  Please immediately contact the sender if you have received this
> message in error. Thank you.
>
> -
> 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]
DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.

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



Re: REPOST: IMP :: Defining a single parameter when returning Collection of F orm Beans as Request Attribute

2003-09-18 Thread Sgarlata Matt
If you are using  then the hidden parameter you are passing
MUST be a property of the form bean.  A simple work-around is to just use
 directly instead of using the Struts HTML taglib.

Search results is a long discussion, and I'm not sure what the best
practices are.  There's no info in the archives?

Matt
- Original Message - 
From: "Chawla, Yogesh" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 18, 2003 10:45 AM
Subject: REPOST: IMP :: Defining a single parameter when returning
Collection of F orm Beans as Request Attribute


>
> Hi,
> I am returning a collection of Form Beans form where I iterate and get the
> results of my serach page. This collection I put into the request
attribute.
>
> However, I have some common attributes like page no which are not bean
> parameters but are one single value for the whole search page like a
> parameter called "pageNo".
>
> Now when I use the html:hidden, it requires the property="pageNo" to be a
> bean parameter !!
> And gives error when I pass this as request object. As under ::
>
>  value="<%=Integer.parseInt((String)request.getAttribute("pageNo"))%>">
>
> Anybody can give ideas for this:
>
> Another Design Issue : Search Results page, how to return the set of Form
> Beans ? Whats the best approach.
>
> When the validate method fails, it is able to read any attributes which
were
> being picked from the request.getAttribute() call.
>
>
> Thanks for your advice !!
>
> Yogesh
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee.  Access to
this
> message by anyone else is unauthorised.  If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may
be
> unlawful.  Please immediately contact the sender if you have received this
> message in error. Thank you.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee.  Access to
this
> message by anyone else is unauthorised.  If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may
be
> unlawful.  Please immediately contact the sender if you have received this
> message in error. Thank you.
>
> -
> 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]



REPOST: IMP :: Defining a single parameter when returning Collect ion of F orm Beans as Request Attribute

2003-09-18 Thread Chawla, Yogesh

Hi,
I am returning a collection of Form Beans form where I iterate and get the
results of my serach page. This collection I put into the request attribute.

However, I have some common attributes like page no which are not bean
parameters but are one single value for the whole search page like a
parameter called "pageNo".

Now when I use the html:hidden, it requires the property="pageNo" to be a
bean parameter !!
And gives error when I pass this as request object. As under ::

">

Anybody can give ideas for this: 

Another Design Issue : Search Results page, how to return the set of Form
Beans ? Whats the best approach.

When the validate method fails, it is able to read any attributes which were
being picked from the request.getAttribute() call.


Thanks for your advice !!

Yogesh
DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.

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



IMP :: Defining a single parameter when returning Collection of F orm Beans as Request Attribute

2003-09-18 Thread Chawla, Yogesh
Hi,
I am returning a collection of Form Beans form where I iterate and get the
results of my serach page. This collection I put into the request attribute.

However, I have some common attributes like page no which are not bean
parameters but are one single value for the whole search page like a
parameter called "pageNo".

Now when I use the html:hidden, it requires the property="pageNo" to be a
bean parameter !!
And gives error when I pass this as request object. As under ::

">

Anybody can give ideas for this: 

Another Design Issue : Search Results page, how to return the set of Form
Beans ? Whats the best approach.

Thanks for your advice !!

Yogesh
DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.

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



RE: Using the tag as a parameter for itself

2003-09-11 Thread hari_s
What will you do with bean:massage is it for throw an output to page
How about if you try with bean:write

-Original Message-
From: Mehdi EL AKARI [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 3:02 PM
To: [EMAIL PROTECTED]
Subject: Using the  tag as a parameter for itself

Hello everybody,
I'm a new struts developper, and i need to do the following thing:
 
but this does not work! 
Do yo have any suggestions please?
Thank you


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



RE: How can I place a parameter back on the URL

2003-09-11 Thread Pady Srinivasan

Why not have a hidden variable whose value is set by the jsp ? If you have
to change the hidden field value from the html page, then use javascript
code.


Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: John Habbouche [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 12:51 PM
To: Struts Users Mailing List
Subject: How can I place a parameter back on the URL

I have invoking a JSP with a parameter appended to the jsp name (i.e.
jsname.jsp?from=main) using Struts and Tag  libraries.  This parameter is
specified as part of the struts-config.xml forward element.  When I enter my
jsp, I check to see if my parameter is there by invoking:



This statement evaluates to true.  When I click on my submit button, my
form's validate method gets called which is what I expect since I have
requested validation in my action in struts-config.xml file.  Now if the
form fails to validate, the same JSP is invoked since this is what is
specified as part of my "input" element in my action.  The
question is:

How can I place the parameter back on the URL (i.e. from=main) in my JSP
prior to pressing the submit button using an elegant way (i.e. Tags) without
using scriplets.  I am using a form:



and I need to be able to append a parameter to the action value
(/editUser.do) except the parameter  must be dynamic (i.e. the "from" must
be dynamic, extrated from the request with request.getParameter("from").
The value can change depending on where I am coming from.   The end result
should look like this:



Any help would be greatly appreciated.



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

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



How can I place a parameter back on the URL

2003-09-11 Thread John Habbouche
I have invoking a JSP with a parameter appended to the jsp name (i.e.
jsname.jsp?from=main) using Struts and Tag  libraries.  This parameter is
specified as part of the struts-config.xml forward element.  When I enter my
jsp, I check to see if my parameter is there by invoking:



This statement evaluates to true.  When I click on my submit button, my
form's validate method gets called which is what I expect since I have
requested validation in my action in struts-config.xml file.  Now if the
form fails to validate, the same JSP is invoked since this is what is
specified as part of my "input" element in my action.  The
question is:

How can I place the parameter back on the URL (i.e. from=main) in my JSP
prior to pressing the submit button using an elegant way (i.e. Tags) without
using scriplets.  I am using a form:



and I need to be able to append a parameter to the action value
(/editUser.do) except the parameter  must be dynamic (i.e. the "from" must
be dynamic, extrated from the request with request.getParameter("from").
The value can change depending on where I am coming from.   The end result
should look like this:



Any help would be greatly appreciated.



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



Re: Using the tag as a parameter for itself

2003-09-11 Thread Mehdi EL AKARI
Thank you it has worked

Mehdi
- Original Message - 
From: "Paul McCulloch" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, September 11, 2003 8:30 AM
Subject: RE: Using the  tag as a parameter for itself


> Using struts tags:
>
> 
> 
> 
>
> 
>
> Using JSTL:
>
> 
> 
> 
> 
> 
>
>
> Paul
>
> -Original Message-
> From: Mehdi EL AKARI [mailto:[EMAIL PROTECTED]
> Sent: 11 September 2003 09:02
> To: [EMAIL PROTECTED]
> Subject: Using the  tag as a parameter for itself
>
>
> Hello everybody,
> I'm a new struts developper, and i need to do the following thing:
> 
> but this does not work!
> Do yo have any suggestions please?
> Thank you
>
>
> **
> Axios Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such case, you should destroy this message, and notify
us immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
> WARNING:
> While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code.  You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



RE: Using the tag as a parameter for itself

2003-09-11 Thread Paul McCulloch
Using struts tags:







Using JSTL:








Paul

-Original Message-
From: Mehdi EL AKARI [mailto:[EMAIL PROTECTED]
Sent: 11 September 2003 09:02
To: [EMAIL PROTECTED]
Subject: Using the  tag as a parameter for itself


Hello everybody,
I'm a new struts developper, and i need to do the following thing:
 
but this does not work! 
Do yo have any suggestions please?
Thank you


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


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



Using the tag as a parameter for itself

2003-09-11 Thread Mehdi EL AKARI
Hello everybody,
I'm a new struts developper, and i need to do the following thing:
 
but this does not work! 
Do yo have any suggestions please?
Thank you

[HELP] how passing in list sql statement parameter using scaffold

2003-09-10 Thread Lázaro Miguel Fung
Hi.

I'm using scaffold, how I can pass a numeric list in this sql statement

select * from table_name where key in (?)

key is an integer.

When I try to pass a list like this: 8,2,5,10 the select only return the
record related to the first item (8).

Any help will be highly apretiated.

TIA
LFung


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



How can I construct STRUTS select options tag according to a parameter ?

2003-08-30 Thread Fumitada Hattori
Hi there.

How can I construct STRUTS select options tag according to a parameter ?

I got a jsp named "example_1.jsp".
One accesses the page with a parameter like example_1.jsp?id=2 .
Now what I wanna do is that the example_1.jsp get the value of id
parameter and construct select options tag dynamically.

Like below...
String id = request.getParameter("id");
USBean us = (USBean)request.getServletContext().getAttribute("USBean");
StateBean state = us.getState(id);
ArrayList cities = state.getCities();

All Beans above are set in the application scope when tomcat starts.

I dont' know how to make us.getState(id) with STRUTS select options tag,
since USBean's getState( ) method requires a id parameter.

What I'm doing now is 
Using 1 more page ( actionExample.do ) right before 
the example_1.jsp.

One accesses the actionExample.do with the id parameter like 
actionExample.do?id=2 and forward to example_1.jsp

In the actionExample.do, get a value of the id parameter and 
StateBean accroding to the value.
Set the StateBean in session scope like below.

String id = request.getParameter("id");
USBean us = (USBean)request.getServletContext().getAttribute("USBean");
StateBean state = us.getState(id);
request.getSession(true).setAttribute("state",state);

then in example_1.jsp




I don't wanna do this anymore...since eveytime users accesses the
actionExample.do , state bean is set in the session scope...
Isn't this too much work ???

Thanks in advance.





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



Re: File Upload and Request Parameter

2003-08-29 Thread Jason Lea
David Stemm wrote:

All,
   I have a form that is doing a file upload and on the confirmation page after the upload I'm trying to get a request parameter using 
the  tag.  The tag doesn't seem to find the request param.  I know the parameter exists - I can see it in the debugger.  
The tag looks like this:  and I tried this as well .  I believe the problem is because the form is setup to use "multipart/form-data". 
 Any ideas on this?  Thanks.
There is a note in the request.getParameter() JavaDocs that states:

"If the parameter data was sent in the request body, such as occurs with 
an HTTP POST request, then reading the body directly via 
getInputStream() or getReader() can interfere with the execution of this 
method."

You have probably used some package like FileUpload to handle the file. 
 This package would be using the getInputStream() to extract the 
contents of the uploaded file (this is why you cannot access the 
parameters normally).  This package should also provide some method of 
accessing any formfields or parameters that were passed.

FileUpload package:
http://jakarta.apache.org/commons/fileupload
(I haven't used this myself) It looks like you could use this in your 
action to get a list of FileItems (some will be uploaded files which you 
can save to disk, the others would be form fields).

When you find a form field, you could try adding it to the request using 
request.setAttribute(), which should allow you to access it using .

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


File Upload and Request Parameter

2003-08-28 Thread David Stemm
All,
   I have a form that is doing a file upload and on the confirmation page after the 
upload I'm trying to get a request parameter using the  tag.  The tag doesn't 
seem to find the request param.  I know the parameter exists - I can see it in the 
debugger.  The tag looks like this:  and I tried this 
as well .  I believe the problem is because the 
form is setup to use "multipart/form-data".  Any ideas on this?  Thanks.

File Upload and Request Parameter

2003-08-28 Thread David Stemm
All,
   I have a form that is doing a file upload and on the confirmation page after the 
upload I'm trying to get a request parameter using the  tag.  The tag doesn't 
seem to find the request param.  I know the parameter exists - I can see it in the 
debugger.  The tag looks like this:  and I tried this 
as well .  I believe the problem is because the 
form is setup to use "multipart/form-data".  Any ideas on this?  Thanks.

RE: adding a parameter to html:link with a map

2003-08-20 Thread Kamholz, Keith (corp-staff) USX
I'm not sure exactly what you're trying to do, but you can do both of the
following:



or




Hope this helps.


- Keith



-Original Message-
From: Mike Whittaker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 2:03 PM
To: Struts Users Mailing List
Subject: RE: adding a parameter to html:link with a map



>I want to be able to add a literal parameter to a link
>
>but I already successfully use 
>this adds a Map of parameters, but I'd like to be able to add further
>parameters literally (ie not from a bean).
>
>Is there any way I can achieve this, by struts or jstl or anything!?
>

Okay I can do this:


Printer page


seems a bit of a kludge, be nice to just specify an addition rather than put
in and take it out of the map.

--
Mike W


-
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: adding a parameter to html:link with a map

2003-08-19 Thread Greg Ludington
>Okay I can do this:
>
>
>Printer
page
>
>
>seems a bit of a kludge, be nice to just specify an addition rather
than put
>in and take it out of the map.

I am not sure it is recommended practice to mix Map and single params in
the same html:link tag, but, if all you need is to add a print=true to
the end of one of your standard links, this should do the trick:

Printer page

Assuming you have some bean named "myBean" defined, and the value of
that bean is "true", this will add both your Map of parameters and
print=true to the link's query string.

-Greg



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



RE: adding a parameter to html:link with a map

2003-08-19 Thread Mike Whittaker

>I want to be able to add a literal parameter to a link
>
>but I already successfully use 
>this adds a Map of parameters, but I'd like to be able to add further
>parameters literally (ie not from a bean).
>
>Is there any way I can achieve this, by struts or jstl or anything!?
>

Okay I can do this:


Printer page


seems a bit of a kludge, be nice to just specify an addition rather than put
in and take it out of the map.

--
Mike W


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



adding a parameter to html:link with a map

2003-08-19 Thread Mike Whittaker
I want to be able to add a literal parameter to a link

but I already successfully use 
this adds a Map of parameters, but I'd like to be able to add further
parameters literally (ie not from a bean).

Is there any way I can achieve this, by struts or jstl or anything!?

--
Mike W


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



Parameter with message resources

2003-08-14 Thread Vincent Peytavin
Hello,

I'm wondering on how to parameter a message, when there is a "{number}" in
the .properties.

This is an example :
In the ApplicationResources.properties, there is a little sentence
"my.text=The {0} t-shirt(s) cost ${1}".

In the JSP, how could I change "{0}" and "{1}" for their real values?


I've seen it's possible to put  but I need to put
bean values, to obtain the sentence :
"The 4 t-shirts cost $20."

Thanks for your help.
Links/examples/explainations are welcomed.

--
Vincent
ps : is there any web site for asking questions in the struts-user list?
I use news.basebeans.com for reading, but can't write on the forum which is
based on the struts-user list.


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



RE: Newbie: Passing parameter using html:link, but how to get it back?

2003-08-04 Thread DE BACKER Sam
 
> > If I do the data access part in UserDetailAction, how can I retrieve
> > the UserId parameter that was specified from the link part in
> > UserList.jsp?
> 
> request.getParameter("UserId"); 

or add a form bean to your action, in struts-config.xml, (static form bean or 
DynaActionForm) with an appropriate userId property. Then access it like this:

  ((MyForm)form).getUserId(); // static MyForm

or

  ((DynaActionForm)form.get("userId");

Sam.


STRICTLY PERSONAL AND CONFIDENTIAL
This message may contain confidential and proprietary material for the sole use of the 
intended recipient. Any review or distribution by others is strictly prohibited. If 
you are not the intended recipient please contact the sender and delete all copies.

Ce Message est uniquement destiné aux récipiendaires indiqués et peut contenir des 
informations confidentielles. Si vous n'êtes pas le récipiendaire, vous ne devez pas 
révéler le contenu de ce message ou en prendre copie. Si vous avez reçu ce message par 
erreur, veuillez en informer l'expéditeur, ou La Poste immédiatement, avant de le 
supprimer.

Dit bericht is enkel bestemd voor de aangeduide ontvangers en kan vertrouwelijke 
informatie bevatten. Als u niet de ontvanger bent, dan mag u de inhoud van dit bericht 
niet bekendmaken noch kopiëren. Als u dit bericht per vergissing heeft ontvangen, 
gelieve er de afzender of De Post onmiddellijk van op de hoogte te brengen en het 
bericht vervolgens te verwijderen.



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



Re: Newbie: Passing parameter using html:link, but how to get itback?

2003-08-03 Thread Rick Reumann
On Mon, Aug 04,'03 (11:36 AM GMT+0800), Andy wrote: 
 
> If I do the data access part in UserDetailAction, how can I retrieve
> the UserId parameter that was specified from the link part in
> UserList.jsp?

request.getParameter("UserId"); 

-- 
Rick

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



Newbie: Passing parameter using html:link, but how to get it back?

2003-08-03 Thread Andy Cheng
I have a JSP that contains a list of User bean, and I display that list
with all the attributes of the User bean.  I use literate tag to display
it
 






 
Detail


 
This is passed to /UserDetail action specified in the action mapping,
which then will forward the request to UserDetail.jsp.
 



 
If I do the data access part in UserDetailAction, how can I retrieve the
UserId parameter that was specified from the link part in UserList.jsp?
 
Andy


[OT] Approaches to URL Parameter masking in Struts

2003-08-01 Thread John Cavacas
After reading a somewhat interesting post by Russell Beattie in which he
mentions the desire to separate the URL that a user sees from the actual
logic and data that it represents, it got me thinking about the approaches
that one can take in Struts to achieve something similar. I don't think the
way he refers to this practice is correct. I'm more used to referring to it
as URL parameter rewrite or masking. For those that don't know what I am
talking about, here's an example.

Say you have an URL like so: 

http://www.mysite.com/do/SomeAction?param1=value1¶m2=value2

After doing some magic it looks like this to the user:

http://www.mysite.com/do/SomeAction/param1/value1/param2/value2

It's somewhat easy to do this if you use Apache in front of your container.
Using a module, you can mask and unmask the URL before and after it reaches
your container. It's somewhat common practice in PHP and Perl based sites
that I've seen. That's where I first learned the trick.

Why do this? Well the most common reason is to provide search engine
friendly URLs. The other more interesting reason is to hide away your
specific technology implementation from the URL. For example, the URL could
look something like this:

http://www.mysite.com/html/SomeAction/param1/value1 or even
http://www.mysite.com/SomeAction/html/param1/value1

It also has the advantage of making the URLs somewhat easier to remember, if
you don't have a lot of parameters that is. Cocoon seems to do this as
Russell mentions in his blog. The specific abstraction between the URL and
the underlying action mapping is already accomplished by using Struts.

Anyway to finally get to the point, what approaches (if any) have you taken
to do this in a Struts/J2EE specific way? Could a Servlet Filter be used?
Throwing Apache in front of your container is not the best solution as you
could be using IIS (gasp) or just serving the site from your container
directly. Russell describes his approach in his Blog
(http://www.russellbeattie.com/notebook/1003728.html careful it's friken
long) but it doesn't seem very clean to me. 

Thanks,
John






This communication is intended for the use of the individual(s) or entity it
was addressed to and may contain confidential and/or privileged information.
If the reader of this transmission is not the intended recipient, you are
hereby notified that any review, dissemination, distribution or copying of
this communication is prohibited.  If you receive this communication in
error, please notify the sender immediately and delete this communication
from your system(s) to which it was sent and/or replicated to. (c) 2003
Sapiens Americas Corp.

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



passing parameter to a getter method

2003-07-29 Thread Richard Raquepo
help.

how can i pass a parameter  to a getter method using
JSTL of Struts-EL?

example

in a java i can get values from my bean using
ArrayList values = mybean.getSampleValues("id01");

now how can i do that in struts/jsp. 
using logic-el:iterate or for each.
"Id01" is dynamic it will come from a logic-el:iterate.

any dea how?

thanks a lot

passing parameter to a getter method

2003-07-29 Thread Richard Raquepo
help.

how can i pass a parameter  to a getter method using
JSTL of Struts-EL?

example

in a java i can get values from my bean using
ArrayList values = mybean.getSampleValues("id01");

now how can i do that in struts/jsp. 
using logic-el:iterate or for each.
"Id01" is dynamic it will come from a logic-el:iterate.

any dea how?

thanks a lot

Pb with UTF-8 parameter encoding for

2003-07-16 Thread Marc Guillemot
Hi,

my links generating with  with a parameter map don't work
when the value of one of the attributes contains non ascii characters like
"Türkei". The generated link looks like:

/search.do?freetext=T%C3%BCrkei

with the "ü" encoded in UTF-8 (performed in
org.apache.struts.util.RequestUtils.encodeURL(String))

The problem is that this comes to my ActionForm as "Türkei".

Does this mean that it gets decoded as ISO-8859-1?
If I patch org.apache.struts.util.RequestUtils.encodeURL(String) to encode
using ISO-8859-1 instead of "UTF-8" everything works well, but the javadoc
for URLEncoder.encode() explains that UTF-8 should be used.

Has someone already faced this problem? Is there a better solution to fix
the problem instead of patching the struts class?

Marc.




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



Re: newbie question - setting form parameter in Javascript

2003-07-13 Thread Mark Lowe
Okay man..If you mail me your form bean, action class, jsp and struts 
config i'll take a look.. Just to double check here's the stuff I'm 
pretty confident should work..

I wouldn't have action as a form bean property (thus no need to define 
getAction in your form bean), its not really part of you form more of a 
mechanism for selecting a dispatch action.

//jsp

function lookup(form) {
form.elements['action'].value = 'lookup';
form.submit();
}




...



//action servlet
public final class MyAction extends DispatchAction {
/**
*Is called when paramater named action has the value of 'lookup'
*/
public final ActionForward lookup(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)

  throws Exception {

...
}
/**
*Is called when paramater named action has the value of 'submit'
*/
public final ActionForward submit(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)

  throws Exception {

...
	}

}

///struts config


On Saturday, July 12, 2003, at 11:11 PM, Shyam A wrote:

Mark,

Thanks a lot for your mails. I have used "action" as a form bean 
property and not as a parameter in struts-config. Unfortunately, the 
Javascript function doesn't seem to work...it does not set the value 
of the ActionForm property, "action".
 When I tried to print out the value of the "action" property in my 
ActionClass,
I got a null value.

I tried the following code in my Action class and I got a null value.
String action = ((ActionForm) form).getAction();
Wonder if I have missed something.

Shyam

Mark Lowe <[EMAIL PROTECTED]> wrote:
Its better that this is posted to the list as well, after all its a
good question and hopefully an adequate answer.
function lookup(form) {
form.elements['action'].value = "lookup";
form.submit();
}
//-->




...



 [input]





//struts config

name="myForm" redirect="false" parameter=""action" />

The only thing you'd have to watch would be if the client didn't
support javascript then you'd lose lookup, this would make a case for
having action as a form bean property and have some relevantly named
form elements in noscript tags. If lookup isn't mission critical then i
guess you could let this slide.


On Friday, July 11, 2003, at 08:44 PM, Shyam A wrote:

Mark,

Thanks for your mail. I understand that DispatchAction class includes
multiple execute methods for different actions. However, I still have
some doubts.
You mentioned using tags in JSP:



Are these used instead of using "Submit" buttons ?
i.e use and in conjunction instead
of  ?  Can
be used for a drop- down?
I guess my problem is still unresolved. As I mentioned in my earlier
mail, I have a drop-down associated with an ActionForm property "crn"
.
   None

I would like to trigger an action called "Lookup" when the drop-down
is clicked .i.e, associate the clicking of the drop-down with the
"action" property of the ActionForm class. I don't know how to set the
"action" property of the ActionForm class  when the drop-down is
selected, based on which appropriate method of the DispatchAction
class would be executed.
Any help would be greatly appreciated.

Thanks,
Shyam


Mark Lowe wrote:
check out dispatch actions..
you can have multiple execute methods with dispatch action ...

Your Action class extends DispatchAction instead of action (check the
docs)
public final ActionForward submit(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
...
}
public final ActionForward lookup(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
...
}
in struts config the parameter attibute need to know the name of the
parameter your about to send, the value of which is your execute 
method
name..

scope="request" parameter="action">
...
and then in jsp





HTH Mark

On Friday, July 11, 2003, at 08:00 PM, Shyam A wrote:

James,

Thanks for your mail. I guess I need to elaborate a little bit. My
HTML form can be submitted in 2ways.
1. Clicking the "Submit" button.
2. Clicking the drop-down
Clicking the drop-down triggers a

Re: newbie question - setting form parameter in Javascript

2003-07-12 Thread Shyam A
Mark,
 
Thanks a lot for your mails. I have used "action" as a form bean property and not as a 
parameter in struts-config. Unfortunately, the Javascript function doesn't seem to 
work...it does not set the value of the ActionForm property, "action". 
 When I tried to print out the value of the "action" property in my ActionClass,
I got a null value.
 
I tried the following code in my Action class and I got a null value.
String action = ((ActionForm) form).getAction();
 
Wonder if I have missed something.
 
Shyam

Mark Lowe <[EMAIL PROTECTED]> wrote:
Its better that this is posted to the list as well, after all its a 
good question and hopefully an adequate answer.


function lookup(form) {
form.elements['action'].value = "lookup";
form.submit();
}
//-->






...



 [input] 





//struts config

name="myForm" redirect="false" parameter=""action" />


The only thing you'd have to watch would be if the client didn't 
support javascript then you'd lose lookup, this would make a case for 
having action as a form bean property and have some relevantly named 
form elements in noscript tags. If lookup isn't mission critical then i 
guess you could let this slide.



On Friday, July 11, 2003, at 08:44 PM, Shyam A wrote:

> Mark,
>  
> Thanks for your mail. I understand that DispatchAction class includes 
> multiple execute methods for different actions. However, I still have 
> some doubts.
>  
> You mentioned using tags in JSP:
>  
> 
>
> 
> Are these used instead of using "Submit" buttons ?
> i.e use and in conjunction instead 
> of  ?  Can 
> be used for a drop- down?
>  
> I guess my problem is still unresolved. As I mentioned in my earlier 
> mail, I have a drop-down associated with an ActionForm property "crn" 
> > .
> 
>None  
> 
>   
> I would like to trigger an action called "Lookup" when the drop-down 
> is clicked .i.e, associate the clicking of the drop-down with the 
> "action" property of the ActionForm class. I don't know how to set the 
> "action" property of the ActionForm class  when the drop-down is 
> selected, based on which appropriate method of the DispatchAction 
> class would be executed.
>  
> Any help would be greatly appreciated.
>  
> Thanks,
> Shyam
>  
>  
>
>
> Mark Lowe wrote:
> check out dispatch actions..
>
> you can have multiple execute methods with dispatch action ...
>
> Your Action class extends DispatchAction instead of action (check the
> docs)
>
> public final ActionForward submit(
> ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
>
> throws Exception {
> ...
> }
>
> public final ActionForward lookup(
> ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response)
>
> throws Exception {
> ...
> }
>
> in struts config the parameter attibute need to know the name of the
> parameter your about to send, the value of which is your execute method
> name..
>
>
> scope="request" parameter="action">
> ...
>
> and then in jsp
>
>
>
>
>
>
> HTH Mark
>
>
> On Friday, July 11, 2003, at 08:00 PM, Shyam A wrote:
>
> > James,
> >
> > Thanks for your mail. I guess I need to elaborate a little bit. My
> > HTML form can be submitted in 2ways.
> > 1. Clicking the "Submit" button.
> > 2. Clicking the drop-down
> >
> > Clicking the drop-down triggers a different action than clicking the
> > "Submit" button.
> > Selecting a value in the drop-down would submit the form and populate
> > some of the other fields in the form. This is done before the 
> "Submit"
> > button is clicked. So, I need to distinguish the action of clicking
> > the drop-down from clicking the "Submit" button and I called it
> > "Lookup".
> >
> > Both actions would be identified with a single property in the
> > ActionForm class - action.
> >
> > eg:
> >
> >
> > I would like to set this "action" property value to "Lookup" on
> > clicking the drop-down using Javascript. I guess a hidden field would
> > not serve the purpose as I already have "action" property defined for
> > the Submit button.
> >
> > Look forward to your help/suggestions.
> >
> > Thanks,
> > Shyam
> >
> > James Mitchell wrote:
> >
> > You will need to create a hidden field named &

Re: newbie question - setting form parameter in Javascript

2003-07-12 Thread Rick Reumann
  
> > My Javascript function is given below:
> >
> > 
> >
> > 

  1   2   3   4   5   6   >