I am new to jsf.
Creating sample application of spring with jsf.
I have following code in jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<title>enter your name page</title>
<h:outputText value="JSF 1.2 Tutorial"/>
  <h:form id="UserEntryForm">
    <h:outputText value="Enter Your Name:"/>
    <h:inputText value="#{UserBean.userName}" />
    <h:commandButton type="submit" action="welcome" value="OK" />

when I see view source it is showing  following output
<form id="UserEntryForm" name="UserEntryForm" method="post" action="/inputname.jsf" enctype="application/x-www-form-urlencoded">

I am not gettting how action is coming as  inputname.jsf?

LVL 11
Who is Participating?
afibarraConnect With a Mentor Commented:
<h:commandButton type="submit" action="welcome" value="OK" />

You are not specifying an action method. So JSF does a form postback.
action is coming as  inputname.jsf -> This is so that the form postbacks to itself
ManishLeadAuthor Commented:
so what it should be?
a_bConnect With a Mentor Commented:
It should be a method in your backing bean.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.