Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9269613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:10:05+00:00 2026-06-18T15:10:05+00:00

I am new to Spring and I am developing a dummy Bank transaction project.

  • 0

I am new to Spring and I am developing a dummy Bank transaction project. Upto now I have created a welcome page that links me to the page where I can perform deposit or withdraw transaction. The database and everything works fine. And, I have a table that shows the list of customers having 4 attributes(id, name, acctNo, balance). The id is linked to the next page where I want to show only the information about this customer. How can I achieve this.

The Dispatcher-Servlet.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" 
    xmlns:p="http://www.springframework.org/schema/p">      
     <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">

        <property name="prefix">
            <value>/WEB-INF/jsp/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
    <bean id="urlMapping"
        class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="interceptors">
            <list>
                <ref local="localeChangeInterceptor"/>
            </list>
        </property>
        <property name="urlMap">
            <map>              
                <entry key="/login.html">
                    <ref bean="userloginController"/>
                </entry>
            </map>          
        </property>             
    </bean>


   <!-- I tried adding this bean but noe luck, not sure where to use this id to map this bean -->
     <bean id="showindividualCustomer" class="com.showCustomerController">s
        <property name="successView"> <value>ViewCustomer</value></property>
     </bean>

     <bean id="userloginController" class="com.UserLoginFormController">
        <property name="sessionForm"><value>false</value></property>
        <property name="commandName"><value>userLogin</value></property>
        <property name="commandClass"><value>com.UserLogin</value></property>
        <property name="formView"><value>userLogin</value></property>
        <property name="successView"><value>showCustomer</value></property>
    </bean>

    <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
        <property name="paramName" value="hl"/>
    </bean> 
    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>      
</beans>

And the controller for bean=showindividualcustomer is:

public class showCustomerController extends SimpleFormController{

    protected ModelAndView onSubmit(Object obj) throws ServletException{

        return new ModelAndView("ViewCustomer");//name of the jsp page inside WEB-INF/jsp
    }
}

Thank you!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:10:06+00:00Added an answer on June 18, 2026 at 3:10 pm

    I would actually recommend taking full advantage of spring 3, looking at your code I assume you’re looking at a spring 2 tutorial.

    Using spring 2.5.6 or spring 3.* you could just do:

        @RequestMapping(value="/customer/{id}")
        public String showCustomerInformation(@PathVariable String id, HttpServletRequest request){
            //your logic to get the customer information and pass it on
            return "customerInformation";
        }
    

    Some references:
    http://tech-read.com/2011/10/31/spring-3-mvc-annotations/
    http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-requestparam

    edit:
    Change your method signature to:

    onSubmit(HttpServletRequest request, Object command) throws ServletException
    

    And just use:

    request.getParameter("id")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to spring MVC. i have below project structure. Below are classes:
I am currently developing my project using Spring, Sutruts2 & Hibernate. Now i want
I'm working on developing new Spring web applications, on a team that's developed a
I am new to Spring MVC . I have a web application. I have
I am new to Spring and ROO and this Annotation/Aspect hell. I have an
I'm fairly new to Spring and I need a bean that has two properties
I am new to Spring Batch. I have following question. I am using Spring
I'm developing a program that sends tweets. I have this piece of code: StringBuilder
I have created a dummy web service with 2 optional parameters using the .Net
I am developing a new web application with Struts2, Spring and Hibernate as its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.