• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

how to trigger a servlet from JSF

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried to call a servlet but i have the following error:
Cannot forward a response that is already committed

my managed bean code:


servlet:


 
Saloon Keeper
Posts: 28114
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My definition of "call" a servlet is when one item of webapp code contacts a server, gets a response, and acts on the response. What you're actually attempting to do is to forward. that is, to, "call" without returning.

JSF is designed to manage requests from end to end, so forwarding is a problem.

However, based on your sample code, I don't know if you really even need JSF for what you're trying to do.

JSF is not a "Master Control Program" that has to be totally in control at all times. It's an assistance framework that acts on individual request/response cycles. If you have a particular client request that doesn't need JSF's forms support, don't try and force it. Instead, write a servlet or JSP and let that servlet/JSP handle the request exactly as you would in a non-JSP app.
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but from servlet, how do i access my managed bean values?
 
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic