• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on h:outputLink

 
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please does h:outputLink have an attribute that ensures a method is invoked when i click on it. For example in a command Button i can have



This ensures that

method is invoked
 
Ranch Hand
Posts: 1880
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.horstmann.com/corejsf/jsf-tags.html#Table4_18
 
Ranch Hand
Posts: 132
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to invoke a Backing Bean method with a link, you can make use of <h:commandLink /> tag. It has an action attribute which allows you to specify the method in EL, just as in a commandButton. Only difference is, this tag will result in a <a /> tag, instead of a button.

I think this is what you are looking for.

HTH.
 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yohan Liyanage:
If you want to invoke a Backing Bean method with a link, you can make use of <h:commandLink /> tag. It has an action attribute which allows you to specify the method in EL, just as in a commandButton. Only difference is, this tag will result in a <a /> tag, instead of a button.

I think this is what you are looking for.

HTH.



Thanks for your reply the reason why i am not using <h:commandLink> is that I think the action attributes requires an entry that corresponds to a entry in your faces-config.xml, and it does not allow me to forward say to an external Servlet. The reason i am using outputLink is that it allows me to redirect to an external Servlet whenever a user clicks the page

<h:outputLink title="Edit Resume" value="/ccsvscxxd/servlet/ResumeServlet">
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't invoke arbitrary methods in servlets. They're not designed for it. The GenericServlet gets all URL requests sent to its service() method. For HttpServlets, the service() method looks at the request type and dispatches the doGet, doPost, etc. method.
 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tim Holloway:
You can't invoke arbitrary methods in servlets. They're not designed for it. The GenericServlet gets all URL requests sent to its service() method. For HttpServlets, the service() method looks at the request type and dispatches the doGet, doPost, etc. method.



I am not invoking methods of servlet themselves, I am invoking the servlet using an outputLink
 
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic