struts: using html:link action attribute

Discussion in 'Java' started by curwen, Oct 8, 2003.

  1. curwen

    curwen Guest

    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
    curwen, Oct 8, 2003
    #1
    1. Advertising

  2. curwen

    Wendy S Guest

    "curwen" <> wrote in message
    news:...
    > 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>

    --
    Wendy in Chandler, AZ
    Wendy S, Oct 8, 2003
    #2
    1. Advertising

  3. curwen

    curwen Guest

    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" <> wrote in message news:<bm17o1$20l$>...
    > "curwen" <> wrote in message
    > news:...
    > > 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:
    curwen, Oct 9, 2003
    #3
  4. curwen

    Wendy S Guest

    > 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
    Wendy S, Oct 9, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    719
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,047
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,806
    runescience
    Feb 7, 2006
  4. vyshu
    Replies:
    1
    Views:
    2,523
    Richard Senior
    Apr 27, 2007
  5. John
    Replies:
    0
    Views:
    843
Loading...

Share This Page