You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Flávio Maldonado <fv...@yahoo.com.br> on 2005/01/11 19:07:11 UTC

=

Hello...

How can I do to make a <html:link> works like a <html:submit> ??
For example...

I have this button: 
    <html:submit property="method">
         <bean:message key="user.newUser.displayname"/>
     </html:submit>

and I'd like to make a Link to do the same thing.

thanks for help!


Flávio Vilasboas Maldonado
Diretor de Desenvolvimento
SedNet Soluções
(35)3471-9381

Re: Multiple Struts-config problem

Posted by Kishore Senji <ks...@gmail.com>.
The module name in the <html:link> should start with a "/"

<html:link module="/master" action="cityAction">link</<html:link>


On Wed, 12 Jan 2005 18:39:58 +0530, sachin <sa...@paradyne.co.in> wrote:
> hi all ,
> 
> i am implementing multiple modules in struts 1.2.4
> i have two config files which i define in web.xml like
> 
>    <init-param>
>      <param-name>config</param-name>
>      <param-value>/WEB-INF/struts-config.xml</param-value>
>    </init-param>
>    <init-param>
>      <param-name>config/master</param-name>
>      <param-value>/WEB-INF/master/master-config.xml</param-value>
>    </init-param>
> 
> and in the master-config.xml i have an action defined like ...
> 
> <action path="/cityMaster" forward="/master/cityMaster.jsp" />
> <action path="/cityAction" type="master.CityMasterAddAction"
> name="cityMasterBean" scope="request" validate="true"
> input="/cityMaster.do">
> <forward name="Success" path="/cityMaster.do" />
> </action>
> 
> but when i try to access the from with html link .. it gives error
> <html:link module = "master" action="cityAction">link</<html:link>
> 
> The error given is : no action found /cityAction
> 
> Please could tell me how to access the actions defined in modules
> 
> Sachin Hegde
> Paradyne Infotech Limited , Mumbai
> 09324546711
> 
> ---------------------------------------------------------------------
> 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


Multiple Struts-config problem

Posted by sachin <sa...@paradyne.co.in>.
hi all , 

i am implementing multiple modules in struts 1.2.4
i have two config files which i define in web.xml like

    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>config/master</param-name>
      <param-value>/WEB-INF/master/master-config.xml</param-value>
    </init-param>

and in the master-config.xml i have an action defined like ...

<action path="/cityMaster" forward="/master/cityMaster.jsp" />
<action path="/cityAction" type="master.CityMasterAddAction" 
name="cityMasterBean" scope="request" validate="true" 
input="/cityMaster.do">
<forward name="Success" path="/cityMaster.do" />
</action>

but when i try to access the from with html link .. it gives error 
<html:link module = "master" action="cityAction">link</<html:link>

The error given is : no action found /cityAction

Please could tell me how to access the actions defined in modules 


Sachin Hegde
Paradyne Infotech Limited , Mumbai
09324546711


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


Re: =

Posted by Nicolas De Loof <ni...@capgemini.com>.
Another option is to use a submit button (that will post the form) and 
CSS to make it look as a link :

<html>
 <head>
 <style type="text/css">
    .submit {
        border:0px;
        background-color:#fff;
        cursor: pointer;
        text-decoration:underline;
    }
 </style>
 </head>
 <body>
   <form>
      <input class="submit" type="submit" name="bouton" value="valider"/>
   </form>
 </body>
</html>

Nico

Jeff Beal a écrit :

> You need to have the link fire off a JavaScript function that will 
> submit the form.  I don't think you'll want to use the <html:link/> 
> tag in this case, since you won't need to do anything fancy with a 
> request URI.
>
> Here's a really quick example that will run in Internet Explorer.  I 
> haven't done enough JavaScript in other browsers to make any 
> guarantees with those, but modifications to this shouldn't be all that 
> difficult:
>
> <a href="#" onclick="document.forms.namedItem('FORMNAME')">Submit</a>
>
> For FORMNAME, you need to use the name attribute of the FORM element. 
> IIRC, Struts uses the name of the Form Bean here.  The easiest way to 
> be sure is to run your app and view the generated source, though.
>
> -- Jeff
>
> Flávio Maldonado wrote:
>
>> Hello...
>>
>> How can I do to make a <html:link> works like a <html:submit> ??
>> For example...
>>
>> I have this button:     <html:submit property="method">
>>          <bean:message key="user.newUser.displayname"/>
>>      </html:submit>
>>
>> and I'd like to make a Link to do the same thing.
>>
>> thanks for help!
>>
>>
>> Flávio Vilasboas Maldonado
>> Diretor de Desenvolvimento
>> SedNet Soluções
>> (35)3471-9381
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


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


Re: =

Posted by Jeff Beal <jb...@webmedx.com>.
You need to have the link fire off a JavaScript function that will 
submit the form.  I don't think you'll want to use the <html:link/> tag 
in this case, since you won't need to do anything fancy with a request URI.

Here's a really quick example that will run in Internet Explorer.  I 
haven't done enough JavaScript in other browsers to make any guarantees 
with those, but modifications to this shouldn't be all that difficult:

<a href="#" onclick="document.forms.namedItem('FORMNAME')">Submit</a>

For FORMNAME, you need to use the name attribute of the FORM element. 
IIRC, Struts uses the name of the Form Bean here.  The easiest way to be 
sure is to run your app and view the generated source, though.

-- Jeff

Flávio Maldonado wrote:
> Hello...
> 
> How can I do to make a <html:link> works like a <html:submit> ??
> For example...
> 
> I have this button: 
>     <html:submit property="method">
>          <bean:message key="user.newUser.displayname"/>
>      </html:submit>
> 
> and I'd like to make a Link to do the same thing.
> 
> thanks for help!
> 
> 
> Flávio Vilasboas Maldonado
> Diretor de Desenvolvimento
> SedNet Soluções
> (35)3471-9381


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