I am just a beginner at JSF So I didn't know whether it is right question. Is it possible that If I make a form with JSF tags/components and define a servlet for action attribute (i.e can form data submitted to a servlet) and if yes then How can I achieve this and How can I get form parameters in servlet. Is it same as request.getParameter() of method or anything else.Please explain. I am going to make a project for my self practice and want to use JSF,SERVLET AND JSP all together.
Asked
Active
Viewed 316 times
2
-
3Welcome to the JSF world! Your question is too broad to be answered in an answer. Instead, there are good links here in StackOverflow to help you to begin with JSF. To begin with, start reading: [What is the difference between JSF, Servlet and JSP?](http://stackoverflow.com/q/2095397/1065197) to learn the advantages of using JSF against plain Servlets. To start in the JSF world, you can read [our wiki page](http://stackoverflow.com/tags/jsf/info), it contains the basic info to start with JSF 2 + Facelets (no JSP at all). – Luiggi Mendoza Nov 08 '12 at 05:12
-
1There are plenty good resources in our JSF wiki, and also in [BalusC's blog](http://balusc.blogspot.com/)(JSF expert). After you learn the basics of JSF, you can integrate it with third party libraries such as [PrimeFaces](http://www.primefaces.org/) or [RichFaces](http://www.jboss.org/richfaces) that provides more controls with ajax embedded to make good-looking and robust Web Applications. Also, take into account that, in the end, JSF will generate plain HTML, so don't fear to use HTML 5 when making your Facelets. – Luiggi Mendoza Nov 08 '12 at 05:20
-
*Why exactly* do you want to submit to a homegrown servlet? Please elaborate the concrete functional requirement in more detail. JSF already offers the `FacesServlet` to automatically do all request parameter collecting, converting/validating them, setting Javabean properties with them and invoking a Javabean action method. With a homegrown servlet you'd only need to repeat/reinvent all those tasks yourself which makes no sense. Oh by the way, JSP is deprecated since 2009. Don't use it. – BalusC Nov 08 '12 at 11:45
1 Answers
0
A form defined with the JSF tags has to be handled by JSF. However within a JSF page you can use the normal html tags to define a normal html form (make sure it is outside the jsf form tag). This form can ofcourse use any action you like. While the form won't be JSF you can still use EL expressions within your form to get values from your beans and facelets to lay-out the page.

Eelke
- 20,897
- 4
- 50
- 76