aspose file tools
The moose likes JSF and the fly likes Open mailtool from a commandButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Open mailtool from a commandButton" Watch "Open mailtool from a commandButton" New topic

Open mailtool from a commandButton

Tom Zeiti

Joined: Feb 16, 2012
Posts: 2

I am trying to open an eMail tool (same as typing the URL "" into my web browser) from a commandButton.
I tried things like

<h:commandButton value="send mail" action="#{}"/>

and in the bean:

public String email() {
return "";

But this gives an error message since, of course, the JSF framework tries to convert the return string into some other address, e.g. adding .xhtml and so on.
How can I avoid that the address is processed in such a way?

Thanks for your help!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16887

Welcome to the JavaRanch, Tom!

Use the commandLink tag, instead. That will give you what you want.

Customer surveys are for companies who didn't pay proper attention to begin with.
Tom Zeiti

Joined: Feb 16, 2012
Posts: 2
Yes, using the command link was also what I ended up doing. So I try to figure out how to make the command link look like a button so the user won't notice...
Thanks for your help!
Lars Weje Hangstrup

Joined: Oct 30, 2012
Posts: 1
Found this:

subject: Open mailtool from a commandButton
It's not a secret anymore!