Solved

jsf

Posted on 2010-09-21
4
686 Views
Last Modified: 2013-11-24
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" %>

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

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?



0
Comment
Question by:Manish
  • 2
4 Comments
 
LVL 20

Expert Comment

by:a_b
ID: 33724979
action is coming as  inputname.jsf -> This is so that the form postbacks to itself
0
 
LVL 5

Accepted Solution

by:
afibarra earned 75 total points
ID: 33726589
<h:commandButton type="submit" action="welcome" value="OK" />

You are not specifying an action method. So JSF does a form postback.
0
 
LVL 11

Author Comment

by:Manish
ID: 33726976
so what it should be?
0
 
LVL 20

Assisted Solution

by:a_b
a_b earned 50 total points
ID: 33731435
It should be a method in your backing bean.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question