Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > struts: using html:link action attribute

Reply
Thread Tools

struts: using html:link action attribute

 
 
curwen
Guest
Posts: n/a
 
      10-08-2003
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
 
Reply With Quote
 
 
 
 
Wendy S
Guest
Posts: n/a
 
      10-08-2003
"curwen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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/use...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>

--
Wendy in Chandler, AZ


 
Reply With Quote
 
 
 
 
curwen
Guest
Posts: n/a
 
      10-09-2003
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



"Wendy S" <(E-Mail Removed)> wrote in message news:<bm17o1$20l$(E-Mail Removed)>...
> "curwen" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > 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/use...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:

 
Reply With Quote
 
Wendy S
Guest
Posts: n/a
 
      10-09-2003
> 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.

--
Wendy


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts: 1 action, 1 Form, several views handled by 1 only action. Any idea for better design? John Java 0 06-26-2007 11:22 PM
Can we call an Action from another Action in struts??? vyshu Java 1 04-27-2007 09:19 AM
Struts mapping action to action??? runescience Java 3 02-07-2006 04:07 PM
Struts Forward to an Action from an to Action and URLs rjweytens Java 6 06-25-2004 01:49 PM
Struts Static Action Form vs Dyanamic Action Form Joe Bloggs Java 1 08-03-2003 02:30 AM



Advertisments