Questions tagged [actionresult]

The value returned by the Struts 2 Action class method when it completes.

The value returned by the Struts 2 Action class method when it completes. Actually, it returns a String type value. The value of the String is used to select a result element of the configuration. An action configuration will often have a set of result configurations representing different possible outcomes. A standard set of result tokens are defined by the Action interface are:

String SUCCESS = "success";
String NONE    = "none";
String ERROR   = "error";
String INPUT   = "input";
String LOGIN   = "login";

Further details are available: http://struts.apache.org/release/2.3.x/docs/result-configuration.html

457 questions
3
votes
4 answers

Asp.net MVC How To Open New Window From Controller

So I have a scenario where I want to return my ActionResult...Return View("ViewName", "MasterPageName",model); in a popup window of a specific size I can pass... E.G.: public ActionResult PopUp() { //do some work... //I want this returned in a…
user1011144
  • 193
  • 2
  • 4
  • 13
3
votes
1 answer

How to return Generic response from Controller?

Net core application and calling other .Net Core Web API application. I am calling controller methods as below public async Task SendRequest(U request, string methodName, HttpMethod reqtype, string token) { T res =…
Mr Perfect
  • 585
  • 8
  • 30
3
votes
1 answer

Overriding ActionResult without caching data

I've create a SitemapResult class that derives from ActionResult. It allows the caller to add any number of URL resources, and it then outputs sitemap data in XML format. public class SitemapResult : ActionResult { private List
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
3
votes
1 answer

IHttpActionResult result fail to bind request body parameter when parameters are defined directly as methods arguments instead of a model

When i put an array of Guids as an argument directly in my web api action result it doesnt find any of my guids which are in the request body and bind them e.g. [HttpPost] public IHttpActionResult AddStores([FromBody]Guid[] Ids) { ... …
Harry
  • 3,930
  • 2
  • 14
  • 31
3
votes
1 answer

Unable to redirect to another URL using action chain and post param

Trying to redirect to external URL with post parameter. My code is below: ${at.url} …
xrcwrn
  • 5,339
  • 17
  • 68
  • 129
3
votes
1 answer

Can I retrieve a ViewModel from an ActionResult?

Trying to avoid repetition here. I have an action in a base class controller which I am not allowed to modify. I'd like my action to do some checks, call the base class action, and modify the result in some way before rendering. But part of what I…
Samo
  • 8,202
  • 13
  • 58
  • 95
3
votes
2 answers

How do I use Ninject with ActionResults while making the controller IoC-framework-agnostic?

Nearly all of the Ninject examples I've seen explain how to use it with ASP.NET MVC, which will automatically inject dependencies into controllers. How would I use Ninject manually though? Let's say I have a custom ActionResult: public class…
3
votes
2 answers

Bestpractice DI with ASP.NET MVC and StructureMap - How to inject dependencies in an ActionResult

I edited my whole question, so do not wonder :) Well, I want to have an ActionResult that takes domain model data and some additional parameters, i.e page index and page size for paging a list. It decide itself if it returns a PartialViewResult or a…
Rookian
  • 19,841
  • 28
  • 110
  • 180
3
votes
2 answers

MVC Handler for an unknown number of optional parameters

I am workingon an MVC route that will take an unknown number of parameters on the end of the URL. Something like this: domain.com/category/keyword1/keyword2/.../keywordN Those keywords are values for filters we have to match. The only approach I…
bopapa_1979
  • 8,949
  • 10
  • 51
  • 76
3
votes
2 answers

MVC traditional form action not calling controller method

I am aware this topic has been in many developers' interest and has been talked about in many forums, but I haven't been able to find the right answer that quite solves my issue. Perhaps I haven't tried hard enough to seek the answer, in which case…
YoOuch
  • 43
  • 1
  • 8
3
votes
3 answers

Return to current page on INPUT result in Struts 2

I have an that is present on all pages of my web application.
k_rollo
  • 5,304
  • 16
  • 63
  • 95
3
votes
2 answers

How to properly call an ActionResult with parameter which return a view

I have this code which returns a view: public ActionResult Survey(int idProject, string name) { return View(Surveys.Data.Services.Project.GetAllSurveys(idProject)); } When I call this from client with @Url.Action("Survey", "Project", new {…
Mathieu
  • 113
  • 1
  • 2
  • 9
3
votes
1 answer

How to use Struts2 convention without using any action class

In Struts2 we can define action without using action class in struts.xml as follows: /error.jsp In my application I am using struts2 convention. In this case how to avoid writing action classes.…
user995656
  • 123
  • 1
  • 14
3
votes
2 answers

How to redirect user to different pages based on the submit button in Struts 2

First, please note I know the following code is not in JavaScript or jQuery but I just added them as tags of this question in hope of finding a solution for it using Javascript or jQuery. I have a form with three submit buttons. The problem is that,…
Jack
  • 6,430
  • 27
  • 80
  • 151
3
votes
1 answer

JSON exception error while output using Struts 2

I am getting the JSON Exception error when I am executing the result into the browser like the following: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this…
user3150012
  • 109
  • 9