Re: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-08 Thread Max Cooper
How does your FindEditorData class get called? It is the responsibility of the caller to tell this class who the user is. I assume that there is an Action mixed in here since the call is made in response to an HTML form being submitted. Have your Action figure out who the user is

Re: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Timo
Caroline, The best way I use it to pass parameters to the action class is via a hidden attribute in the form, in your case the articleForm you can define the hidden attribute using input type=hidden name=hiddenField value=%=request.getRemoteUser();%/ Good luck. - Original Message -

Re: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Caroline Jen
I know how to pass a hidden field. The problem is how to retrieve it in my Java class. I have illustrated that my Java class does not extend HttpServlet or Action. This Java class has a mapping in the struts-config.xml file: type=org.apache.struts.scaffold.ProcessAction

RE: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Joe Hertz
Actually, you haven't illustrated it. You've just stated it. In the ActionForm there are methods like validate() that accept as parameters an ActionMapping and an httpServletRequest, and from the httpServletRequest you can call getSession(). Same holds true in the Action class' execute() method.

RE: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Joe Hertz
Actually, you haven't illustrated it. You've just stated it. In the ActionForm there are methods like validate() that accept as parameters an ActionMapping and an httpServletRequest, and from the httpServletRequest you can call getSession(). Same holds true in the Action class' execute() method.

RE: Very Troubled in Finding Ways to Pass a Variable to a Class

2003-12-06 Thread Caroline Jen
It is wonderful to know that there are some ActionForm methods that holds true in the scaffold.ProcessAction's execute() method. It gives the hope that my problem could be resolved. Via a submit button in my JSP, I try to pass two variables; username and keyName, to my Java class