Using Request Method GET and params=formaction together in a single methodData binding of @ModelAttribute annotated parametersRun a single test method with mavenAutowired bean is null in MVC ControllerSpring - ModelAttribute and parameter namesSpring MVC 3.0 - restrict what gets routed through the dispatcher servletSpring getting error in get attribute methodwhy we need to use get method inside a java file @RequestMapping(method = RequestMethod.GET)How to render partial view in Spring MVCSpring MVC cannot find method in controller when using POST requestWhy does using @Valid with @ModelAttribute result in exception?
Is there any road between the CA State Route 120 and Sherman Pass Road (Forest Route 22S0) that crosses Yosemite/Serria/Sequoia National Park/Forest?
How to get distinct values from an array of arrays in JavaScript using the filter() method?
Have ejective consonants ever arisen on their own?
How to decide whether an eshop is safe or compromised
90s(?) book series about two people transported to a parallel medieval world, she joins city watch, he becomes wizard
Convert HTML color to OLE
Infinite loop in CURSOR
How much code would a codegolf golf if a codegolf could golf code?
How does turbine efficiency compare with internal combustion engines if all the turbine power is converted to mechanical energy?
Sous vide chicken without an internal temperature of 165
Is it appropriate for a business to ask me for my credit report?
How can I describe being temporarily stupid?
Why should someone be willing to write a strong recommendation even if that means losing a undergraduate from their lab?
Hai la patente? - omission of possessive adjective
Have only girls been born for a long time in this village?
Is "stainless" a bulk or a surface property of stainless steel?
"Silverware", "Tableware", and "Dishes"
Repurpose telephone line to ethernet
Should my "average" PC be able to discern the potential of encountering a gelatinous cube from subtle clues?
Why do some academic journals requires a separate "summary" paragraph in addition to an abstract?
Did the twin engined Lazair ultralight have a throttle for each engine?
How does the Saturn V Dynamic Test Stand work?
Are illustrations in novels frowned upon?
How big would a Daddy Longlegs Spider need to be to kill an average Human?
Using Request Method GET and params=formaction together in a single method
Data binding of @ModelAttribute annotated parametersRun a single test method with mavenAutowired bean is null in MVC ControllerSpring - ModelAttribute and parameter namesSpring MVC 3.0 - restrict what gets routed through the dispatcher servletSpring getting error in get attribute methodwhy we need to use get method inside a java file @RequestMapping(method = RequestMethod.GET)How to render partial view in Spring MVCSpring MVC cannot find method in controller when using POST requestWhy does using @Valid with @ModelAttribute result in exception?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to create a method which has both (@RequestMapping(method=RequestMethod.GET) and @RequestMapping(params= "formaction= selectCustomer)) on the click of a SINGLE button
This is because .GET method gets called first and that is a compulsory method whereas I want params="formaction= selectCustomer" to fetch customer details from the same method used in a different class.
I have already tried @RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer") but it did not work
@Resource (name = "control")
private Controller control;
@Override
@RequestScope
@RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer")
public ModelAndView form(Request request, Model model, @ModelAttribute Command command, BindingResult result) {
return this.control.getData(request, model, command, result)
This getData method is in another class inside same package that usually gets all the data when accessed from a different workflow.
So basically I want the formAction to fetch me the customer data but how to use it with .GET ?
I also tried to make two seperate methods for .GET and formaction and I called the formaction method inside the .GET method but it did not fetch me the data. I am afraid I will get the data only if the method is called using param=formaction notation
java spring model-view-controller overriding request-mapping
|
show 3 more comments
I want to create a method which has both (@RequestMapping(method=RequestMethod.GET) and @RequestMapping(params= "formaction= selectCustomer)) on the click of a SINGLE button
This is because .GET method gets called first and that is a compulsory method whereas I want params="formaction= selectCustomer" to fetch customer details from the same method used in a different class.
I have already tried @RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer") but it did not work
@Resource (name = "control")
private Controller control;
@Override
@RequestScope
@RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer")
public ModelAndView form(Request request, Model model, @ModelAttribute Command command, BindingResult result) {
return this.control.getData(request, model, command, result)
This getData method is in another class inside same package that usually gets all the data when accessed from a different workflow.
So basically I want the formAction to fetch me the customer data but how to use it with .GET ?
I also tried to make two seperate methods for .GET and formaction and I called the formaction method inside the .GET method but it did not fetch me the data. I am afraid I will get the data only if the method is called using param=formaction notation
java spring model-view-controller overriding request-mapping
Is it compiling?
– JustAFellowCoder
Mar 27 at 14:49
Yes it is. But on clicking the button, it says webpage not found.
– Anmol Khanna
Mar 27 at 14:50
Wild guess but if you want both, couldn't you make two separate methods, with different RequestMappings, and one also calls the other?
– JustAFellowCoder
Mar 27 at 14:54
I tried that, but it doesn't fetch me the details from the getData method. It will fetch me the data if called as a formaction I suppose.
– Anmol Khanna
Mar 27 at 14:57
Not sure if it matters the order, but isn't method supposed to be after params?
– JustAFellowCoder
Mar 27 at 15:05
|
show 3 more comments
I want to create a method which has both (@RequestMapping(method=RequestMethod.GET) and @RequestMapping(params= "formaction= selectCustomer)) on the click of a SINGLE button
This is because .GET method gets called first and that is a compulsory method whereas I want params="formaction= selectCustomer" to fetch customer details from the same method used in a different class.
I have already tried @RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer") but it did not work
@Resource (name = "control")
private Controller control;
@Override
@RequestScope
@RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer")
public ModelAndView form(Request request, Model model, @ModelAttribute Command command, BindingResult result) {
return this.control.getData(request, model, command, result)
This getData method is in another class inside same package that usually gets all the data when accessed from a different workflow.
So basically I want the formAction to fetch me the customer data but how to use it with .GET ?
I also tried to make two seperate methods for .GET and formaction and I called the formaction method inside the .GET method but it did not fetch me the data. I am afraid I will get the data only if the method is called using param=formaction notation
java spring model-view-controller overriding request-mapping
I want to create a method which has both (@RequestMapping(method=RequestMethod.GET) and @RequestMapping(params= "formaction= selectCustomer)) on the click of a SINGLE button
This is because .GET method gets called first and that is a compulsory method whereas I want params="formaction= selectCustomer" to fetch customer details from the same method used in a different class.
I have already tried @RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer") but it did not work
@Resource (name = "control")
private Controller control;
@Override
@RequestScope
@RequestMapping(method=RequestMethod.GET, params= "formaction= selectCustomer")
public ModelAndView form(Request request, Model model, @ModelAttribute Command command, BindingResult result) {
return this.control.getData(request, model, command, result)
This getData method is in another class inside same package that usually gets all the data when accessed from a different workflow.
So basically I want the formAction to fetch me the customer data but how to use it with .GET ?
I also tried to make two seperate methods for .GET and formaction and I called the formaction method inside the .GET method but it did not fetch me the data. I am afraid I will get the data only if the method is called using param=formaction notation
java spring model-view-controller overriding request-mapping
java spring model-view-controller overriding request-mapping
edited Mar 28 at 5:01
Anmol Khanna
asked Mar 27 at 14:45
Anmol KhannaAnmol Khanna
137 bronze badges
137 bronze badges
Is it compiling?
– JustAFellowCoder
Mar 27 at 14:49
Yes it is. But on clicking the button, it says webpage not found.
– Anmol Khanna
Mar 27 at 14:50
Wild guess but if you want both, couldn't you make two separate methods, with different RequestMappings, and one also calls the other?
– JustAFellowCoder
Mar 27 at 14:54
I tried that, but it doesn't fetch me the details from the getData method. It will fetch me the data if called as a formaction I suppose.
– Anmol Khanna
Mar 27 at 14:57
Not sure if it matters the order, but isn't method supposed to be after params?
– JustAFellowCoder
Mar 27 at 15:05
|
show 3 more comments
Is it compiling?
– JustAFellowCoder
Mar 27 at 14:49
Yes it is. But on clicking the button, it says webpage not found.
– Anmol Khanna
Mar 27 at 14:50
Wild guess but if you want both, couldn't you make two separate methods, with different RequestMappings, and one also calls the other?
– JustAFellowCoder
Mar 27 at 14:54
I tried that, but it doesn't fetch me the details from the getData method. It will fetch me the data if called as a formaction I suppose.
– Anmol Khanna
Mar 27 at 14:57
Not sure if it matters the order, but isn't method supposed to be after params?
– JustAFellowCoder
Mar 27 at 15:05
Is it compiling?
– JustAFellowCoder
Mar 27 at 14:49
Is it compiling?
– JustAFellowCoder
Mar 27 at 14:49
Yes it is. But on clicking the button, it says webpage not found.
– Anmol Khanna
Mar 27 at 14:50
Yes it is. But on clicking the button, it says webpage not found.
– Anmol Khanna
Mar 27 at 14:50
Wild guess but if you want both, couldn't you make two separate methods, with different RequestMappings, and one also calls the other?
– JustAFellowCoder
Mar 27 at 14:54
Wild guess but if you want both, couldn't you make two separate methods, with different RequestMappings, and one also calls the other?
– JustAFellowCoder
Mar 27 at 14:54
I tried that, but it doesn't fetch me the details from the getData method. It will fetch me the data if called as a formaction I suppose.
– Anmol Khanna
Mar 27 at 14:57
I tried that, but it doesn't fetch me the details from the getData method. It will fetch me the data if called as a formaction I suppose.
– Anmol Khanna
Mar 27 at 14:57
Not sure if it matters the order, but isn't method supposed to be after params?
– JustAFellowCoder
Mar 27 at 15:05
Not sure if it matters the order, but isn't method supposed to be after params?
– JustAFellowCoder
Mar 27 at 15:05
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55380052%2fusing-request-method-get-and-params-formaction-together-in-a-single-method%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55380052%2fusing-request-method-get-and-params-formaction-together-in-a-single-method%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is it compiling?
– JustAFellowCoder
Mar 27 at 14:49
Yes it is. But on clicking the button, it says webpage not found.
– Anmol Khanna
Mar 27 at 14:50
Wild guess but if you want both, couldn't you make two separate methods, with different RequestMappings, and one also calls the other?
– JustAFellowCoder
Mar 27 at 14:54
I tried that, but it doesn't fetch me the details from the getData method. It will fetch me the data if called as a formaction I suppose.
– Anmol Khanna
Mar 27 at 14:57
Not sure if it matters the order, but isn't method supposed to be after params?
– JustAFellowCoder
Mar 27 at 15:05