struts: using html:link action attribute

C

curwen

Hi all,
does anybody know why I can't use ‘action ' attribute in a
struts <html:link > using jdeveloper903??

I just write :
<html:link action="/list" />

and it doesn't't compile:
invalid attribute.

Which is the best way to use struts framework from a <a> tag passing dynamic values?

Thanks in advance
jc
 
W

Wendy S

curwen said:
does anybody know why I can't use 'action ' attribute in a
struts <html:link > using jdeveloper903??
I just write :
<html:link action="/list" />
and it doesn't't compile:
invalid attribute.
Which is the best way to use struts framework from a <a> tag passing
dynamic values?

Looking in the struts-example webapp, I don't see any examples of the
'action' parameter. My guess is that you should not use that leading slash,
as the docs http://jakarta.apache.org/struts/userGuide/struts-html.html#link
say action should be the "Logical name of a Action". I take that to mean
however you've defined the action in struts-config.xml. If you want to use
the path, then use the 'page' attribute instead. An example:

<html:link page="/editRegistration.do?action=Create"><bean:message
key="index.registration"/></html:link>
 
C

curwen

I used the leading slash because the struts-config.xml is like:

<action path="/list" type="xxx.ListAction" name="listForm"
input="list.jsp" scope="request"/>

and works fine elsewhere.
the link to jakarta site says action is an available option for page.
It should at least compile
<html:link page="/editRegistration.do?action=Create"><bean:message
key="index.registration"/></html:link>


could you please send me the line in struts-config.xml belonging to
this link?
how do I register the editRegistration.do?
I guess: I want to trigger an Action::execute method after this call

many thanks
jc
 
W

Wendy S

could you please send me the line in struts-config.xml belonging to
this link?
how do I register the editRegistration.do?
I guess: I want to trigger an Action::execute method after this call

If you have Struts, you have the struts-example.war file. Drop it in your
container and examine struts-config.xml and all the other files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top