Hi Geeta/Paul/Mark/Wendy

What Geeta has suggested is basically the same thing but Paul is using JSTL for that.
But such is the restriction of my application that I can not use request object to get the values from form directly by calling request.getParameter(...);

I will explain this why.

The framework that we are working with right now gives some add on features over struts. Basically taken from StrutsEJB framework.

We are using Map Based DTOs to transfer data from view layer to model layer and other way round.
We are also using the feature of Command Files. I will explain it what it is for people unaware of StrutsEJB framework.

In Struts we are supposed to mention the Action Class in the struts-config.xml. And from the Action class we generally call some java programs (say command files) to access the model layer basically to avoid keeping business logic in Action Classes.

But in my framework we just need to mention the Command file name in struts-config.xml instead of Action classes. There is only one action class that is DefaultAction class which handles all the requests and diverts the program control to the command file. I will give here one typical entry in my struts-config.xml for your reference.

<action
    path="/CreateUser"
    type="framework.common.web.DefaultAction"
    name="UserForm"
    scope="request"
    input = "/CreateUser.jsp"
    parameter="app.cmd.CreateUserCmd">
    <forward name="Success" path = "/UserSucc.jsp" />    
  </action>

in the above action tag the attribute parameter is the name of the command file where i would like my control to go after the form gets submitted.

Now the problem is in the Command File "CreateUserCmd" where i would keep my business logic -- i dont have the "request" object. so i cant do a
"request.getParameter(.....); " here.

the way i get values from forms is like this.

if I have this code in JSP
<html:text property="dto(txtUsname)" styleClass="listItem" size="14" />

I will have to write the following code in my command file to get the value of "User Name"
String UserName = (String)paramDTO.get("txtUsName");

As Mark/Wendy were asking me why i cant use _javascript_ is because

whenever i use something like this in _javascript_ I get _javascript_ error at runtime
document.UserForm.dto(txtUsName).value = val;
document.UserForm.submit();

This is obvious because whenever _javascript_ parses something like dto(txtUsName) it takes it as a function call.

I hope I could explain the problem properly.

Regards
Avinash Tiwari
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com



"Geeta Ramani" <[EMAIL PROTECTED]>

02/17/2004 09:57 PM

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

To
Struts Users Mailing List <[EMAIL PROTECTED]>
cc
Subject
Re: Form Submission





Avinash:

How about trying something like this:

<%String myLink = "/EmplyeeDetailAction.do?employeeId=" + employeeId; %>

<html:link page="<%=myLink">Employee Detail Page</html:link>

Regards,
Geeta

[EMAIL PROTECTED] wrote:

>
> I want to use a hyperlink instead -
>
> for example
> On a typical employee list page clicking the employee id of an
> employee takes you to the employee detail page.
>
> In this scenario employee id can not be displayed over a button - it
> has to be a hyperlink..
>
> Use of _javascript_ is restricted. So i cant call a _javascript_ function
> to set the action atribute and then call the submit function.
>
> Avinash Tiwari
> Tata Consultancy Services
> Mailto: [EMAIL PROTECTED]
> Website: http://www.tcs.com
>
>
> Mark Lowe <[EMAIL PROTECTED]>
                                          To "Struts Users Mailing List"
                                             <[EMAIL PROTECTED]>
 02/17/2004 08:57 PM
                                          cc
         Please respond to
    "Struts Users Mailing List"      Subject Re: Form Submission
  <[EMAIL PROTECTED]>

>
>
>
> May I ask why you don't want a submit button?
>
>
> On 17 Feb 2004, at 15:55, [EMAIL PROTECTED] wrote:
>
> >
> > Hi
> >
> > How can we submit a form without using <html:submit> tag. I dont
> want
> > to use _javascript_ for this?
> >
> > Thanks & Regards
> >  Avinash Tiwari
> >  Tata Consultancy Services
> >  Mailto: [EMAIL PROTECTED]
> >  Website:
> > http://
> >
> www.tcs.com<InterScan_Disclaimer.txt>----------------------------------
>
> > -----------------------------------
> > 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]
>
>
> ForwardSourceID:NT00004E3A
>
>    ----------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

ForwardSourceID:NT00004E76    
DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the addressee. 
Unauthorized use, disclosure or copying is strictly prohibited and may constitute 
unlawful act and can possibly attract legal action, civil and/or criminal. The 
contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services on any subject matter.
Any action taken or omitted to be taken based on this message is entirely at your risk 
and neither the originator of this message nor Tata Consultancy Services takes any 
responsibility or liability towards the same. Opinions, conclusions and any other 
information contained in this message
that do not relate to the official business of Tata Consultancy Services shall be 
understood as neither given nor endorsed by Tata Consultancy Services or any affiliate 
of Tata Consultancy Services. If you have received this message in error, you should 
destroy this message and may please notify the sender by e-mail. Thank you.

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

Reply via email to