Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Servlet from a form

 
Tom Franck
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to call a serlet that contacts a SOAP service. But I keep on getting a PropertyNotFoundException


The form where I call it from looks like this:



My web.xml file:




The servlet itself:

 
Nam Ha Minh
Ranch Hand
Posts: 502
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom Franck wrote:I'm trying to call a serlet that contacts a SOAP service. But I keep on getting a PropertyNotFoundException




You wrapped the servlet name inside a EL expression, so the compiler tries to translate it and it couldn't find any given property. You should change from:

action="#{SOAPServlet.doGet}"

to:

action="/SOAPServlet"

Good luck!
 
Tom Franck
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's how I tried to do it at the start though. But nothing happens when I click the button.
Well at the bottom of the page I get this: Unable to find matching navigation case with from-view-id '/contactUs.xhtml' for action '/SOAPServlet' with outcome '/SOAPServlet'
 
Nischit Shetty
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you are trying to attempt will not work. The moment you start using JSF tags / components, any reference to a bean or object, JSF tries to look within its context, facesconfig. It does not go outside its perimeter.
If your intention is to all call a servlet by clicking a link within a page rendered by JSF, use regualr HTML tags or call a managed bean and then forward to a servlet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic