Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Spring and the fly likes MultiActionController issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "MultiActionController issue" Watch "MultiActionController issue" New topic

MultiActionController issue

Abhi Singh

Joined: Feb 02, 2010
Posts: 13
I am new to Spring and my problem is that I am unable to fetch data from a jsp page in my MultiActionController.....I am getting null value there..

My jsp is as follow

Document : viewProfile
Created on : Feb 25, 2010, 8:24:36 PM
Author : Abhijeet

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<%@taglib prefix="form" uri="" %>
<%@ taglib prefix="form" uri="" %>
<%@ taglib prefix="c" uri="" %>
<%@ taglib prefix="fmt" uri="" %>
<%@ taglib prefix="spring" uri="/spring" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Profile View Page</title>
<h2>My Profile</h2>
<form:form commandName="user" action="../Profile/UpdateDetail.htm" method="post">
<table border="1" bgcolor="gray">
<c:forEach items="${user}" var="user">
<b>Login Id:</b>

<%--form:input path="loginName" /--%>
<input disabled="true" type="text" value="<cut value="${user.loginName}"/>"/>
< value="<cut value="${user.loginName}"/>" />
<input type="text" value="<cut value="${user.password}"/>"/>
<b>First Name:</b>
<input type="text" value="<cut value="${user.firstName}"/>"/>
<b>Last Name:</b>
<input type="text" value="<cut value="${user.lastName}"/>"/>
<input type="text" value="<cut value="${}"/>"/>
<td colspan="2" align="center">
<input type="submit" value="Save" >



I am trying to get the text box value from above jsp into my MultiActionController.......

My dispatcher-servlet.xml
<bean name="/Profile/*.htm" class="com.webaccess.springtrial.web.ProfileController">
<!--property name="commandName" value="profileForm"/>
<property name="commandClass" value="com.webaccess.springtrial.domain.User"-->
<property name="login" ref="login"/>

and ProfileController

public ModelAndView UpdateDetail(HttpServletRequest request,
HttpServletResponse response,Object command)throws Exception{

User user=(User)command;
// String userName=request.getParameter("loginName");
// String pass=request.getParameter("password");
// String fName=request.getParameter("firstName");
// String lName=request.getParameter("lastName");
// Long phn=Long.parseLong(request.getParameter("phone"));
String userName=user.getLoginName();
String pass=user.getPassword();
String fName=user.getFirstName();
String lName=user.getLastName();
Long phn=user.getPhone();
return new ModelAndView("home");


can anyone suggest me the fault in above coding or the alternate solution

David Newton

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.
I agree. Here's the link:
subject: MultiActionController issue
It's not a secret anymore!