• 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

AJAX request 's URL to a ManagedBean's method

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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 :

@ManagedBean
@ApplicationScoped
public class SecurityResponsibleManagedBean {

public void login() {
...
}
}


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

http://localhost:8080/GShop/SecurityResponsibleManagedBean.login?adminName=a&adminPwd=b

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:
<login>
<status>CORRECT</status>
</login>
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic