File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Calling Servlet from a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Calling Servlet from a form" Watch "Calling Servlet from a form" New topic
Author

Calling Servlet from a form

Tom Franck
Greenhorn

Joined: May 19, 2012
Posts: 7
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

Joined: Oct 31, 2011
Posts: 498

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!


PM Me If You Want to get Urgent Help on Java Programming
Tom Franck
Greenhorn

Joined: May 19, 2012
Posts: 7
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

Joined: Feb 21, 2007
Posts: 25
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
 
 
subject: Calling Servlet from a form