This is my code I had written a logic to fetch the username and password from and database and after login the login time and logout time should enter into the database the time should be taken from the system
action class:
public class Login {
private String username;
private String password;
private String login_time;
private String logout_time;
private String status;
private String late;
//getters and setters
#SuppressWarnings("unused")
public String execute(ServletRequest req) throws Exception,SQLException{
int i=0;
try{
SessionUtils su = new SessionUtils();
HttpSession session =((Request) req).getSession();
String hql="select * from login where username='"+username+"'and
password='"+password+"'";
Query query1=((SessionUtils) session).createQuery(hql);
query1.setParameter(1,getUsername());
query1.setParameter(2,getPassword());
int result = query1.executeUpdate();
while(i!=0)
{
RequestDispatcher rd
=req.getRequestDispatcher("DailyInOut.jsp");
return hql;
}
} catch (Exception e)
{
return late;
}
return status;
}
public String chandu(ServletRequest req,ServletResponse res) throws
Exception,SQLException{
int j=0;
try
{
java.util.Date myDate = new java.util.Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
String strDates1 = formatter.format(myDate);
#SuppressWarnings("unused")
SessionUtils su = new SessionUtils();
String hql="update attendance where date='"+strDates1+"' name='"+username+"'
login='"+login_time+"' logout='"+logout_time+"' status='"+status+"'
late='"+late+"'";
HttpSession session =((Request) req).getSession();
Query query2=((SessionUtils) session).createQuery(hql);
session.setAttribute("date", strDates1);
session.setAttribute("login_time",login_time);
session.setAttribute("logout_time",logout_time);
session.setAttribute("status",status);
session.setAttribute("late",late);
#SuppressWarnings("unused")
int result = query2.executeUpdate();
System.out.println(" update row updated");
if(j!=0)
{
System.out.println("success1");
return "success";
}
}
catch(Exception e)
{
e.getMessage();
}
System.out.println("failure page");
return "failure";
}
}
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package namespace="/" name="packageOne" extends="struts-default">
<action name="login" class="com.tribro.chandu.Login" method="post">
<result name="success">DailyInOut.jsp</result>
</action>
</package>
</struts>
logina.jsp
<html>
<head>
<title>Home Page</title>
</head>
<body bgcolor="cyan" text="magenta">
<form action="login" method="execute">
<img src="WebContent/Images/java.jpg" height="80"/>
<pre><marquee behavior="scroll" direction="right"><font size="4">Welcome to TRIBRO
Limited</font></marquee><br/></pre>
<table>
<tr>
<td>
<div>
<img src="WebContent/Images/banner.png" height="300" width="900"></img>
</div>
</td>
<td>
<div>
<table>
<tr>
<td colspan="2" style="text-align:center;">
<h4>Login Form</h4>
</td>
</tr>
<tr>
<td>
<h4>Username :</h4>
</td>
<td>
<h4><input type="text" name="Username"/></h4>
</td>
</tr>
<tr>
<td>
<h4>password:</h4>
</td>
<td>
<h4><input type="password" name="password"/></h4>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<input type="submit" value="Login"/>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
But I am getting an error as
java.lang.NoSuchMethodException: com.tribro.chandu.Login.post()
but I am getting java.lang.NoSuchMethodException: com.tribro.chandu.Login.post()
This makes me think you have written method="post" a <s:submit/> tag (or in struts.xml):
<s:form action="login">
<s:submit method="post" />
</s:form>
where method refers to an Action method, not to an HTTP method (like in <s:form />).
Then remove method from the submit tag, and leave it on the form:
<s:form action="login" method="post">
<s:submit />
</s:form>
if i used this tag i am getting the Exception as java.lang.NoSuchMethodException: com.tribro.chandu.Login.execute()
You are putting parameters in your Action methods:
public String execute(ServletRequest req) throws Exception,SQLException{
this is not how it works, Action methods have no arguments, the parameters are passed through getters and setters, including ServletRequest and ServletResponse (read more here).
Then rewrite your methods as:
public String execute() throws Exception{
and they will be found by Struts.
When you submit a form it has an incorrect method
<form action="login" method="execute">
In the action mapping you have configured the method post() will be mapped to the login action. But, your action class doesn't have such method. If you change this mapping to
<action name="login" class="com.tribro.chandu.Login">
this will map to the execute() method by default. This method you should create in the action class. It has different signature which has not any parameters.
If you need to know how to get servlet objects such as HttpServletRequest then you can read this answer.
You can get the request from the action context like
HttpServletRequest request = ServletActionContext.getRequest();
That way is useful in interceptors, but in action better to implement ServletRequestAware
protected HttpServletRequest request;
public void setServletRequest(HttpServletRequest request) {
this.request = request;
}
Related
I am trying to build a simple select and Option list in thymeleaf, but i keep getting the error
Neither BindingResult nor plain target object for bean name 'BOLForm' available as request attribute
I am pretty sure there is something wrong with my bol.html. But not able to figure out the missing mappings.
Below is my Controller:
#Controller
public class BillOfLadingController {
#Autowired
private DepotList depotList;
#GetMapping("/BillOfLading")
public String getBOLForm(){
return "bol";
}
#PostMapping("/BillOfLading")
public String Login(#ModelAttribute(name="BOLForm") BOLForm bolForm,Model model) {
model.addAttribute("BOLForm", bolForm);
List<DepotDetailEntity> depotDropDown = depotList.getDepots().getDepotDetail();
if(depotDropDown.size() == 0) {
return "login";
}
model.addAttribute("depots", depotDropDown);
return "bol";
}
}
The Form Class
#Component
public class BOLForm {
private String BOL;
private String depotId;
public String getBOL() {
return BOL;
}
public void setBOL(String bOL) {
BOL = bOL;
}
public String getDepotId() {
return depotId;
}
public void setDepotId(String depotId) {
this.depotId = depotId;
}
}
the bol.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="ISO-8859-1">
<title>BillOfLading Request Page</title>
</head>
<body>
<h1>BillOfLading Report</h1>
<form th:action="#{/BillOfLading}" th:object="${BOLForm}" method="post">
<label for="bol">BOL No.</label>
<input type="text" id="bol" name="bol">
<br/>
<table>
<tr>
<td>Select DC:</td>
<td>
<select th:field="*{depotId}">
<option value=""> -- </option>
<option th:each="depot : ${depots}"
th:value="${depot.depotId}"
th:utext="${depot.depotName}"/>
</select>
</td>
</tr>
<tr>
<td><input name="submit" type="submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
</html>
When I replace my bol.html as below, it works:
<form th:action="#{/BillOfLading}" th:object="${BOLForm}" method="post">
<label for="bol">BOL No.</label>
<input type="text" id="bol" name="bol">
<br/>
<label for="depotId">DepotID </label>
<input type="text" id="depotId" name="depotId">
<br/>
In the controller, you need to add the BOLForm object as an attribute of the model:
#GetMapping("/BillOfLading")
public String getBOLForm(Model model){
model.addAttribute("BOLForm", new BOLForm());
return "bol";
}
I'm creating a web application using Spring MVC framework and forms.
I'm having trouble getting my form to update the field position in my PlayerModel. It simply doesn't save the value when I submit the form (check the controller inline comment on the submit() function).
If I select either radio button (with values 1 and 2) and submit, the model reaches the controller with value 0.
Despite having read countless similar questions/answers here on StackOverflow, I am unable to get this to work. What am I doing wrong here?
[EDIT]
I figured out the problem. For some reason, the value of the name attribute in the radio input is being used to match with the model attribute, instead of using path.
<input type="radio" id="index1" value="1" path="position" name="index" />
So it is trying to match index with the model, which of course does not exist, instead of using the position value in the path attribute.
Shouldn't it be the other way around?
playerView.jsp
<%# taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%# taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
</head>
<body>
<form:form action="/game/playerView" method="POST" modelAttribute="playerModel">
<table>
<tr>
<th>
<input type="radio" id="index1" value="1" path="position" name="index" />
<input type="radio" id="index2" value="2" path="position" name="index"/>
</th>
</tr>
<tr>
<td><input type="submit" value="Submit"/></td>
</tr>
</table>
</form:form>
</body>
</html>
GameController.java
#Controller
#SessionAttributes("playerModel")
public class GameController {
#RequestMapping(value = "playerView", method = RequestMethod.GET)
public ModelAndView hello(ModelMap map) {
PlayerModel playerModel = new PlayerModel();
playerModel.setPosition(0);
map.addAttribute("playerModel", playerModel);
return new ModelAndView("playerView", "playerModel", playerModel);
}
#RequestMapping(value = "playerView", method = RequestMethod.POST)
public ModelAndView submit(#ModelAttribute("playerModel") PlayerModel playerModel, BindingResult result, ModelMap model){
playerModel.getPosition(); // returns 0
model.addAttribute("playerModel", playerModel);
return new ModelAndView("playerView", "playerModel", playerModel);
}
}
PlayerModel.java
#Resource
public class PlayerModel {
private int position;
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
}
You are using Spring-MVC form tag therefore please do not use this <input type="radio" id="index1" value="1" path="position" name="index" /> insted of use like this (For more details)
<tr>
<td>Sex:</td>
<td>
Male: <form:radiobutton path="sex" value="M"/> <br/>
Female: <form:radiobutton path="sex" value="F"/>
</td>
</tr>
and there is no path variable in HTML <input type="radio"> ,
path should be used in the spring type declaration.
eg :
<form:input path="firstName"/> this code is changed to <input name="firstName" type="text"/> by Spring
I have a form in JSP having two fields, and in action class I have an instance variable for each field, but those attributes are null when action class is executing.
I have used validate() method that is not even executing.
JSP
<s:form action="addAuthority">
<table>
<caption> <b><big>Add New Authority</big></b>
</caption>
<s:if test="hasActionErrors()">
<tr>
<td><s:actionerror />
</td>
</tr>
</s:if>
<s:if test="hasActionMessages()">
<tr>
<td><s:actionmessage />
</td>
</tr>
</s:if>
<tr>
<td></td>
<td>
<s:textfield name="role" label="Authority Name"></s:textfield </td>
<td></td>
<td>
<s:select name="dependentAuthority" list="#request.authorityList" label="Dependent Authority" listKey="roleId" listValue="role"></s:select>
</td>
<td>
<s:submit value="Add"></s:submit>
</td>
</tr>
</table>
</s:form>
Action
public class AddAuthorityAction extends ActionSupport {
private String dependentAuthority;
private String role;
private Map<String, Object> session;
private HttpServletRequest request;
public String execute() throws Exception{
HttpServletRequest request = ServletActionContext.getRequest();
//System.out.print(role + " " + dependentAuthority+" ");
role = request.getParameter("role");
dependentAuthority = request.getParameter("dependentAuthority");
//System.out.print(role+" "+ dependentAuthority);
//insert the data
int count = new DBInsert().addRoleDependency(role, Integer.parseInt(dependentAuthority));
if(count==0){
addActionError("There is some error while inserting. Please try again");
}else{
addActionMessage("Information successfully inserted");
}
return SUCCESS;
}
#SuppressWarnings("unchecked")
public String moveAddAuthority() {
Map request = (Map) ActionContext.getContext().get("request");
List<Role> authorityList = new DBSelect().getAuthorityId();
request.put("authorityList", authorityList);
List<Role> roleWithDependency = new DBSelect().getRoleWithDependence();
request.put("roleWithDependency", roleWithDependency);
return SUCCESS;
}
public void validate() {
if (role == null || role.trim().equals("")) {
addFieldError("role", "The name is required");
}
}
public String getDependentAuthority() {
return dependentAuthority;
}
public void setDependentAuthority(String dependentAuthority) {
this.dependentAuthority = dependentAuthority;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}}
when I am using HttpServletRequest request = ServletActionContext.getRequest(); I can get the value;
but through implementing ServletRequestAware request become null;
without using both instance variable is null;
I could not get ActionMessage in JSP page.
struts.xml
<action name="addAuthority" class="nodue.action.AddAuthorityAction"
method="execute" >
<interceptor-ref name="authonticateInterceptor"></interceptor-ref>
<result name="success" type="redirect">moveAddAuthority</result>
</action>
<action name="moveAddAuthority" class="nodue.action.AddAuthorityAction"
method="moveAddAuthority">
<interceptor-ref name="authonticateInterceptor"></interceptor-ref>
<result name="success">/authority.jsp</result>
</action>
I have made some modification on datatype of dependentAuthority previously it was Integer, and also added in JSP page the <s:if> tag.
You are probably using a single Interceptor, while you should use an entire stack with your interceptor in it.
You are returning the redirect result that should be used to reach external URLs or non-action URLs. To redirect to an action you should use redirectAction result.
No matter if redirect or redirectAction, when you redirect you lose the request parameters, and this is why you don't see action errors and messages. There are different solutions to this.
You use the validate() method, that returns INPUT result when things go south. But you haven't defined any INPUT result for your actions; be sure to understand how the INPUT result works, along with ValidationInterceptor and ParameterInterceptor.
I'm currently learning JSP/Servelets. The following is code containing 2 JSP pages and a servlet, which works as follows:
JSP #1 requests user info, & passes it into a servlet.
The servlet Instantiates a JavaBean class, and passes it to the 2nd JSP, using the Session Object.
The 2nd JSP then displays the info that th user entered in the 1st JSP; the user can then hit the Return button to return to the 1st JSP.
My Question is: I've read in various Tutorials (notably Murach's JSP, which this code is based on) that if the Javabean attributes are passed to the session object rather than the request object, the JavaBean's values should be maintained throughout the session. However when I return to the first page, the JB fields are empty. Am i doing anything wrong? I would appreciate any help!
The following is the code:
1st JSP:
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!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>Email Application</title>
</head>
<body>
<h1>Join our Email list</h1>
<p>To join our email list, enter your name and email address below.<br>
Then, click on the Submit button</p>
<form action="addToEmailList" method="post">
<jsp:useBean id="user" scope="session" class="business.User"/>
<table cellspacing="5" border="0">
<tr>
<td align="right">First name:</td>
<td>
<input type="text" name="firstName"
value = "<jsp:getProperty name="user" property="firstName"/>">
</td>
</tr>
<tr>
<td align="right">Last name:</td>
<td><input type="text" name="lastName"
value = "<jsp:getProperty name="user" property="lastName"/>">
</td>
</tr>
<tr>
<td align="right">Email address:</td>
<td><input type="text" name="emailAddress"
value = "<jsp:getProperty name="user" property="emailAddress"/>">
</td>
</tr>
<tr>
<td>I'm interested in these types of music:</td>
<td><select name="music" multiple>
<option value="rock">Rock</option>
<option value="country">Country</option>
<option value="bluegrass">Bluegrass</option>
<option value="folkMusic">Folk Music</option>
</select>
</td>
</tr>
<tr>
<td ></td>
<td><input type="submit" name="Submit"></td>
</tr>
</table>
</form>
</body>
Servlet:
public class AddToEmailListServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
private HttpServletRequest request;
private HttpServletResponse response;
private String firstName;
private String lastName;
private String emailAddress;
private String[] musicTypes;
private Music music;
private User user;
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
this.request = request;
this.response = response;
setInstanceVariables();
writeDataToFile();
forwardResponseToJSPpage();
System.err.println("Hello!");
}
private void setInstanceVariables()
{
this.firstName = getFirstName();
this.lastName = getLastName();
this.emailAddress = getEmailAddress();
this.musicTypes = request.getParameterValues("music"); //getMusic();
this.user = new User(firstName,lastName,emailAddress);
}
private String getFirstName()
{
return request.getParameter("firstName");
}
private String getLastName()
{
return request.getParameter("lastName");
}
private String getEmailAddress()
{
return request.getParameter("emailAddress");
}
private void writeDataToFile() throws IOException
{
String path = getRelativeFileName();
UserIO.add(user,path);
}
private String getRelativeFileName()
{
ServletContext sc = getServletContext();
String path = sc.getRealPath("/WEB-INF/EmailList.txt");
return path;
}
private void forwardResponseToJSPpage() throws ServletException, IOException
{
if(this.emailAddress.isEmpty()||this.firstName.isEmpty()||this.lastName.isEmpty())
{
String url = "/validation_error.jsp";
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(url);
dispatcher.forward(request,response);
}
else
{
music = new Music(musicTypes);
HttpSession session = this.request.getSession();
session.setAttribute("music", music);
session.setAttribute("user", user);
String url = "/display_email_entry.jsp";
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(url);
dispatcher.forward(request,response);
}
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
doPost(request,response);
}
}
2nd JSP:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%# include file="/header.html" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Email Application</title>
</head>
<body>
<h1>Thanks for joining our email list</h1>
<p>Here is the information that you entered:</p>
<jsp:useBean id="user" scope="session" class="business.User"/>
<table cellspacing="5" cellpadding="5" border="1">
<tr>
<td align="right">First name:</td>
<td><jsp:getProperty name="user" property="firstName"/></td>
</tr>
<tr>
<td align="right">Last name:</td>
<td><jsp:getProperty name="user" property="lastName"/></td>
</tr>
<tr>
<td align="right">Email Address:</td>
<td><jsp:getProperty name="user" property="emailAddress"/></td>
</tr>
</table>
<p>We'll use the Email to otify you whenever we have new releases of the following types of music:</p>
<c:forEach items="${music.musicTypes}" var="i">
<c:out value="${i}"></c:out><br/>
</c:forEach>
<p>To enter another email address, click on the Back <br>
button in your browser or the Return button shown <br>
below.</p>
<form action="join_email_list.jsp" method="post">
<input type="submit" value="Return">
</form>
</body>
<%# include file="/footer.html" %>
</html>
UPDATE 1/31/10: Since this thread continues to get a lot of views...I am curious if it has been of help to anyone recently? Feel free to leave comments/feedback, thanks.
I have a Spring form where I would like to reuse the search page to include the results under the search form. Currently when I do this I get the following error on loading the success view:
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'searchAccounts' available as request attribute
Here is my bean configuration:
<bean name="/search.html" class="myapp.web.AccountSearchController">
<property name="sessionForm" value="true"/>
<property name="commandName" value="searchAccounts"/>
<property name="commandClass" value="myapp.service.AccountSearch"/>
<property name="validator">
<bean class="myapp.service.AccountSearchValidator"/>
</property>
<property name="formView" value="accountSearch"/>
<property name="successView" value="accountSearchResults"/>
</bean>
Here is the snippet of JSP that includes the search form:
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%# taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%# taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<form:form method="post" commandName="searchAccounts">
<table valign="top" cellspacing="0" cellpadding="0" width="500" border="0">
<tr>
<td valign="top">
<div class="border-title">Account Search</div>
<div id="navhome">
<div class="border">
<div id="sidebarhome">
<table id="form">
<tr>
<td colspan="2">Search by Account ID or Domain Name. If
values are provided for both, only accounts matching both values
will be returned.</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td align="right" valign="top"><form:label path="accountId">Account ID</form:label>:</td>
<td><form:input path="accountId" size="30"/></td>
</tr>
<c:set var="accountIdErrors"><form:errors path="accountId"/></c:set>
<c:if test="${not empty accountIdErrors}">
<tr>
<td> </td>
<td>${accountIdErrors}</td>
</tr>
</c:if>
<tr>
<td align="right" valign="top"><form:label path="domainName">Domain Name</form:label>:</td>
<td><form:input path="domainName" size="30"/></td>
</tr>
<c:set var="domainNameErrors"><form:errors path="domainName"/></c:set>
<c:if test="${not empty domainNameErrors}">
<tr>
<td> </td>
<td>${domainNameErrors}</td>
</tr>
</c:if>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Search">
</td>
</tr>
</table>
</div>
</div>
</div>
</td>
</tr>
</table>
</form:form>
And...here is my form controller class (less the imports):
public class AccountSearchController extends SimpleFormController {
protected final Log logger = LogFactory.getLog(getClass());
public ModelAndView onSubmit(Object command, BindException errors) throws ServletException {
String accountId = ((AccountSearch) command).getAccountId();
String domainName = ((AccountSearch) command).getDomainName();
logger.info("User provided search criteria...\n\tDomain Name: " + domainName + "\n\tAccountId: " + accountId);
//TODO do search
logger.info("returning from AccountSearch form view to " + getSuccessView());
return new ModelAndView(getSuccessView());
}
protected Object formBackingObject(HttpServletRequest request) throws ServletException {
AccountSearch accountSearch = new AccountSearch();
return accountSearch;
}
}
Thanks in advance for your help!
-aj
UPDATE:
I ported this to an annotated controller per answer below. Here is the new/working code:
#Controller
#RequestMapping("/search.html")
public class AccountSearchController {
// note: this method does not have to be called setupForm
#RequestMapping(method = RequestMethod.GET)
public String setupForm(Model model) {
AccountSearchCriteria accountSearchCriteria = new AccountSearchCriteria();
model.addAttribute("accountSearchCriteria", accountSearchCriteria);
model.addAttribute("title", "Account Search");
return "accountSearch";
}
// note: this method does not have to be called onSubmit
#RequestMapping(method = RequestMethod.POST)
public String onSubmit(#ModelAttribute("accountSearchCriteria") AccountSearchCriteria accountSearchCriteria, BindingResult result, SessionStatus status, Model model) {
new AccountSearchValidator().validate(accountSearchCriteria, result);
if (result.hasErrors()) {
return "accountSearch";
} else {
ArrayList<AccountSearchCriteria> accountSearchResults = new ArrayList<AccountSearchCriteria>();
AccountSearchCriteria rec = new AccountSearchCriteria();
rec.setDomainName("ajcoon.com");
accountSearchResults.add(rec);
AccountSearchCriteria rec2 = new AccountSearchCriteria();
rec2.setDomainName("ajcoon2.com");
accountSearchResults.add(rec2);
//TODO do search
//ArrayList<HashMap<String,String>> accountSearchResults = new AccountSearchService().search(accountId,domainName);
if( accountSearchResults.size() < 1 ){
result.rejectValue("domainName", "error.accountSearch.noMatchesFound", "No matching records were found.");
return "accountSearch";
} else if(accountSearchResults.size() > 1){
model.addAttribute("accountSearchResults", accountSearchResults);
return "accountSearch";
} else {
status.setComplete();
return "redirect:viewAccount?accountId=";
//return "redirect:viewAccount?accountId=" + accountSearchResults.get(0).getAccountId();
}
}
}
}
try to use (throws Exception instead of ..)
protected Object formBackingObject(HttpServletRequest request)
throws Exception {
AccountSearch accountSearch = new AccountSearch();
System.out.println("inside formBackingObject");
return accountSearch;
}
It looks like your formBackingObject Method is not executed. rerun the code with the above change and see log console to see if the method is executed.
--
You should be using annotation instead of extending controller. Spring 3.0 will deprecate the controller hierarchy.