Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AJAX request 's URL to a ManagedBean's method  RSS feed

Cristian Jujea
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm building a web shop using JSF 2.0.
The taglibs available are very nice but why ask the server to do extra processing when the developer can use plain XHTML instead of taglibs !?

I have a very simple situation :

<input type="text" id="adminName" /><br />
<input type="password" id="adminPwd" /><br />
<button onClick="adminLoginFunction()" id="AdminLoginButton"> Login </button>

The javascript function adminLoginFunction constructs an Ajax request which is meant for the login method of this managed bean :

public class SecurityResponsibleManagedBean {

public void login() {

I was expecting the URL of the Ajax request to be :


but it doesn't work, I get a HTTP Status 404.
I don't want to use taglibs nor javascript libraries.
How do I solve this problem?
And further more, how do I obtain the adminName and adminPwd Ajax request parametes inside the login method of the SecurityResponsibleManagedBean and how do I return the Ajax response below to the same page:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!