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

  • Home
  • SEARCH
  • 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 581509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:35:11+00:00 2026-05-13T14:35:11+00:00

I am using SimpleFormController in my application to handle form submisions. one thing i

  • 0

I am using SimpleFormController in my application to handle form submisions. one thing i am missing is the request object that is passed onSubmit(request,response..)
is a different one from the initial request object that is received by formBackingObject(..).probably because it is again a new request from web.

i just want to use the same parameters from request object in onSubmit(..) that i was able to access in formBackingObject(..).

it could be possible for me to store them in and pass thru hidden fields from jsp, but i am trying to get some elegant approach.

is there any way to achieve this?

EDIT:

i am overriding

formBackingObject(HttpServletRequest request)`  

and

onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors)

methods in my class.

for the intial view formbackingObject(..) will be called and i will have some variables from the request object then if user submits the form onSubmit(..) will be called then i will have another request object which is different from the one i received in formbackingObject(..) .

what i am asking is, is there any way of holding the
initial ‘request’
parameters(request.getParameter() kind
of…) so that i can use them in
onSubmit(..) with out sending them
back & forth thru hidden fields ?’

  • 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-05-13T14:35:11+00:00Added an answer on May 13, 2026 at 2:35 pm

    The formBackingObject() method is being called when the user makes the request for the initial form view. This is a completely separate HTTP request to when the user submits the form which is when the onSubmit() method is called.

    If you want to save state from the first HTTP request so it is available in the second HTTP request, your best option is probably to save it in the HTTP session.

    eg: in your formBackingObject() method:

    HttpSession session = request.getSession();
    session.setAttribute("param1", request.getParameter("param1"));
    session.setAttribute("param2", request.getParameter("param2"));
    

    and in your onSubmit() method:

    HttpSession session = request.getSession();
    String param1 = (String) session.getAttribute("param1");
    String param2 = (String) session.getAttribute("param2");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.