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 7568371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:54:27+00:00 2026-05-30T14:54:27+00:00

In Spring 3.0 if i have a jsp page with two different links each

  • 0

In Spring 3.0

if i have a jsp page with two different links each calling different method on MultiActionController

<form:form method="POST">
    <a href="user.htm?action=add" style="color: blue;">Add</a>
    <a href="user.htm?action=delete" style="color: blue;">Delete</a>
</form:form>

on the MultiActionController i get request parameter as null so cannot validate the values

String username=request.getParameter("username");
String password=request.getParameter("password");

i also tried uing a button and changed it to look like a link but in case of button click add method is called twice once with requestparameter as null and second time with correct values, but this twice entry is creating a mess in the code also to make this work i am using form action which will not work in case of two different method calls

 <form:form action="user.htm?action=add method="POST">
     <input type="submit" value="I have info"/>"> ---> should call delete method
     <input type="submit" value="Click to send info"/> ---> should call add method 

    </form:form>

want to achieve this without javascript

I have also set param reslover in xml file with default method to call

let me explain my problem again forget the above code i was just giving some example

I have a jsp page which has two input text field and two links each should call different method of the controller both the method will validate the input and will get redirect to another page simple!!

The reason i have using MultiActionController…….
Unfortunately i have to continue using a controller which extends MultiActionController because the same jsp page also has paging which work absolutely fine

So all i wan to do is simply achieve server and client side validation once either of the link is clicked and redirect accordingly.

Please give me some example to move ahead in this…

i want to achieve this w/o javascript i got this example here
but my problem is why the requestParameter is Null

http://www.goospoos.com/2009/11/spri…oller-example/

Here’s my code

<bean id="myExampleController" class="com.ui.controller.MyExampleController">
            <property name="methodNameResolver">
            <ref bean="paramResolver" />
        </property> 
        <property name="validators" ref="myExampleValidator"/>       
    </bean>

    <bean id="paramResolver"
        class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
<property name="defaultMethodName" value="loadPage"></property>  
<property name="paramName">
<value>action</value>            
</property>     
</bean>

<bean id="myExampleValidator" class="com.validator.MyExampleValidator" />

Controller

public ModelAndView validateValues(HttpServletRequest request, HttpServletResponse response) throws Exception{
ModelAndView mav=null;
----> this is null ??? 
String value1=request.getParameter("textvalue1");
String value2=request.getParameter("textvalue2");


mav = new ModelAndView("myexample");
mav=getPageData(request, false); 
return mav;

}

JSP page

<form action="myexample.htm" method="post">

input type="text" name="textvalue1" size="20" />
input type="text" name="textvalue2" size="20" />
</form>

<a href="myexample.htm?action=validateValues">click to validate</a>

———-> what’s wrong with this if the above mentioned site can call a method and works fine ,why i cannot get request parameters

  • 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-30T14:54:29+00:00Added an answer on May 30, 2026 at 2:54 pm
    Then below works for me
    

    UI

      <form:form action="user.htm?action=add method="POST">  
    <input type="submit" name="add"/>
    

    server side

    (WebUtils.hasSubmitParameter(request, "add")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using spring security and have an admin jsp page for editing user
I have created Spring 3.0 application where after Login user get displayed jsp page
I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that
I have a JSP that is using Spring:form tags to bind controls to a
I have a spring web application with jsp pages that calls different web services
I have a form JSP web page, this form contains multiple instances of the
I have a jsp page having two text field id and name. Now I
I am using Spring MVC 3.0 I have a guestbook.jsp page where I want
Hi: In my jsp page,I have a form to add/update a nested object using
I am using jsp + spring mvc, and on jsp page I have some

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.