You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "uma.k" <um...@net-kraft.com> on 2004/12/21 14:46:50 UTC

Passing information to Action class

Hi,
How to pass information to Action class directly? i.e. I don't want to write
a ActionForm class.

<html:form action="editUpload.do">
<html:hidden property="fileAbsPath" value="<%=fileAbsPath%>" />
<html:submit>Edit</html:submit>
</html:form>

And my struts-config.xml will look like this

    <action
    		path="/editUpload"
    		type="upload.EditUploadAction"
    		scope="request"
    		input="/upload/display.jsp">
      <forward name="success" path="/upload/upload.jsp" />
    </action>

in my .java execute method, I am writing
String theFile = request.getParameter("fileAbsPath");

Any ideas?

Uma


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to implement torque?

Posted by Jay Chandran <ja...@iqss.co.in>.
Thanks Eddie

I will do that. Have u tried implementing the same? :)

Jay Chandran.


----- Original Message -----
From: "Eddie Bush" <ea...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>; "Jay Chandran"
<ja...@iqss.co.in>
Sent: Wednesday, December 22, 2004 11:32 AM
Subject: Re: How to implement torque?


> Have you tried surfing the Torque site for docs?  They used to have
> some decent docs ... been ages since I looked at it though.
>
> I believe they have a user list there - for Turbine, if not Torque.
> That is likely a better spot to ask than here.
>
> On Wed, 22 Dec 2004 11:32:26 +0530, Jay Chandran
> <ja...@iqss.co.in> wrote:
> > Does any one knows how to implement TORQUE in an existing system
implemented
> > using struts and postgreSQL.
> >
> > :(
> >
> > Jay Chandran
>
> --
> Eddie Bush
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to implement torque?

Posted by Eddie Bush <ea...@gmail.com>.
Have you tried surfing the Torque site for docs?  They used to have
some decent docs ... been ages since I looked at it though.

I believe they have a user list there - for Turbine, if not Torque. 
That is likely a better spot to ask than here.

On Wed, 22 Dec 2004 11:32:26 +0530, Jay Chandran
<ja...@iqss.co.in> wrote:
> Does any one knows how to implement TORQUE in an existing system implemented
> using struts and postgreSQL.
> 
> :(
> 
> Jay Chandran

-- 
Eddie Bush

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


How to implement torque?

Posted by Jay Chandran <ja...@iqss.co.in>.
Does any one knows how to implement TORQUE in an existing system implemented
using struts and postgreSQL.

:(


Jay Chandran



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Passing information to Action class

Posted by Jay Chandran <ja...@iqss.co.in>.
Below is used using vm(velovity templates) as front end .Here using
addQueryData we are passing parameter which can be accessed in the action
file.


<a
href='$link.setAction("deleteuser_vm").addQueryData("userName",Devan)'>Delet
e</a>


in my .java execute method, write
> String user= request.getParameter("userName");


Check the command in jsp for adding parameter to the link action file.

----- Original Message -----
From: "uma.k" <um...@net-kraft.com>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Tuesday, December 21, 2004 7:16 PM
Subject: Passing information to Action class


> Hi,
> How to pass information to Action class directly? i.e. I don't want to
write
> a ActionForm class.
>
> <html:form action="editUpload.do">
> <html:hidden property="fileAbsPath" value="<%=fileAbsPath%>" />
> <html:submit>Edit</html:submit>
> </html:form>
>
> And my struts-config.xml will look like this
>
>     <action
>     path="/editUpload"
>     type="upload.EditUploadAction"
>     scope="request"
>     input="/upload/display.jsp">
>       <forward name="success" path="/upload/upload.jsp" />
>     </action>
>
> in my .java execute method, I am writing
> String theFile = request.getParameter("fileAbsPath");
>
> Any ideas?
>
> Uma
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Passing information to Action class

Posted by "uma.k" <um...@net-kraft.com>.
Yes Jack, You are right. I have ActionForm but do not want to use it.

-----Original Message-----
From: Dakota Jack [mailto:dakota.jack@gmail.com]
Sent: Wednesday, December 22, 2004 10:56 AM
To: Struts Users Mailing List; Shiva Narayana
Subject: Re: Passing information to Action class


I may be wrong, Shiva, but I think she wants to avoid the use of
action forms in this case rather than avoid writing classes.  If you
use forms in a file upload, then you are trapped into using the Struts
file upload implementation.  She may, I don't know, want to avoid
that.

Jack



--
"You can lead a horse to water but you cannot make it float on its back."

~Dakota Jack~

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

-----------------------------------------------

"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Passing information to Action class

Posted by Dakota Jack <da...@gmail.com>.
I may be wrong, Shiva, but I think she wants to avoid the use of
action forms in this case rather than avoid writing classes.  If you
use forms in a file upload, then you are trapped into using the Struts
file upload implementation.  She may, I don't know, want to avoid
that.

Jack



-- 
"You can lead a horse to water but you cannot make it float on its back."

~Dakota Jack~

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

-----------------------------------------------

"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Passing information to Action class

Posted by Shiva Narayana <sh...@gmail.com>.
try with DynaActionForm it solves ur problem. No noeed to write FormBean

<form-bean name="simpleForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="fileAbsPath" type="java.lang.String"/>
</form-bean>


On Tue, 21 Dec 2004 19:16:50 +0530, uma.k <um...@net-kraft.com> wrote:
> Hi,
> How to pass information to Action class directly? i.e. I don't want to write
> a ActionForm class.
> 
> <html:form action="editUpload.do">
> <html:hidden property="fileAbsPath" value="<%=fileAbsPath%>" />
> <html:submit>Edit</html:submit>
> </html:form>
> 
> And my struts-config.xml will look like this
> 
>    <action
>                path="/editUpload"
>                type="upload.EditUploadAction"
>                scope="request"
>                input="/upload/display.jsp">
>      <forward name="success" path="/upload/upload.jsp" />
>    </action>
> 
> in my .java execute method, I am writing
> String theFile = request.getParameter("fileAbsPath");
> 
> Any ideas?
> 
> Uma
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
Regards
Shiva

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Passing information to Action class

Posted by Dakota Jack <da...@gmail.com>.
Don't use a form and check the request object for what happens to be
in the critter, just as you suggested.  What is the problem?

Jack

-- 
"You can lead a horse to water but you cannot make it float on its back."

~Dakota Jack~

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

-----------------------------------------------

"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org