if your using the latest servlet spec you can do:

<html:link action="myAction?action=${MyCons.EDIT}">Your Text</html:link>

although, it looks like your trying to access a static field?

I use this trick,

Make you constants class extend java.util.HashMap class

Add this contructor your constant class
public MyCons() {
        // create the internal map using this
        Field[] fields = this.getClass().getDeclaredFields();
        for ( Field field : fields ) {
            try {
                this.put( field.getName() , (String)field.get( new String() ) );
            }
            catch ( Exception exp ) {}
        }
}

Create an instance of your constants class using:

<jsp:useBean id="myCons" ....

You can then use this within your jsp as shown below:
<html:link action="myAction" paramId="action" paramName="myCons" 
paramProperty="EDIT"> ...

I think this looks better than using scriptlets and defining temporary strings 
to hold link locations.

Gareth

Markus Demetz wrote:

ok thanks,
but I forgot that it should be dynamically, e.g:
/myAction?action=<%= MyCons.EDIT %>
but so it does not work.

markus


-----Ursprüngliche Nachricht-----
Von: Gareth Evans [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 1. Februar 2006 12:14
An: Struts Users Mailing List
Betreff: Re: <html:link> passing parameters


<html:link action="myAction?action=edit">Your Text</html:link>

Should do the trick.

Note: You do not need the .do

Gareth

Markus wrote:


Hi all,

just a simple question.

I would like to pass a single parameter with a <html:link> tag.
I've searched the net, but there I understand that it is only
possible to pass parameters via beans.

Is the a simpler way to redender the following with <html:link>:

/myAction.do?action=edit

I'm just a little confused now.

Thank You,
Markus


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



--
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

--
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: [EMAIL PROTECTED]
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility
for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.



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



--
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

--
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: [EMAIL PROTECTED]
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.



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

Reply via email to