Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Open mailtool from a commandButton

 
Tom Zeiti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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

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

and in the bean:

public String email() {
return "mailto:john.doe@web.com";
}

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
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Tom!

Use the commandLink tag, instead. That will give you what you want.
 
Tom Zeiti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found this:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic