Announcement Announcement Module
Collapse
No announcement yet.
How to read input value from h:inputText Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to read input value from h:inputText

    Hi, i'm new in jsf+spring framework. I'm working on a simple project to store the input value from the JSF component h:inputText. I would like to read the value being typed into the textbox via the Spring Managed bean but it seems that the bean is unable to read my input value so i would like to seek
    This is my applicationContext.xml code

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
    
    
    	<bean id="projectBean" class="try..Project" scope="session" >
          <property name="projectName" value="${projectBean.projectname}">
      
            </property>  
            
              <property name="id" value="3">
      
            </property>  
        
        
     </bean>
    
    </beans>
    index.jsp
    Code:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    	pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>index</title>
    </head>
    <body>
    <f:view>
    <h:inputText value="#{projectBean.projectName}"></h:inputText>
    <h:form>
    <h:commandButton value="Retreive" action="#{button.doButtonAction}" type="submit"></h:commandButton>
    </h:form>
    </f:view>
    </body>
    </html>
    Any help or solution will be much much appreciated. THANKS!

  • #2
    This forum is for the "Spring Integration" project. Please try posting your question in the Web forum.

    Thanks,
    Mark

    Comment

    Working...
    X