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
2
votes
2 answers

ASP.NET MVC ActionResult View() not changing url

I have a method... [HttpPost] public ActionResult Start(SomeViewModel someViewModel) { ... } that based on some conditions returns things like return View("Invalid"), View("NotFound"), View("Run", anotherViewModel), etc. The problem is that no…
Brian David Berman
  • 7,514
  • 26
  • 77
  • 144
2
votes
1 answer

Is it good idea to have a general try/catch in every method in a controller or is there a better way?

I'm trying to improve my MVC.NET Core-fu and I ended up in a bunch of methods in all my controllers looking like this (note the outermost, general, repetitive try-catch). [HttpPost] public IActionResult DoSomething([FromBody] Thing thing) { try …
DonkeyBanana
  • 3,266
  • 4
  • 26
  • 65
2
votes
2 answers

Actionlink to another view (MVC)

i am working on my MVCOnlineShop Project , i have shown categories on homepage by creating a partial view CategoryLayout.cshtml : @model IEnumerable @{ ViewBag.Title = "CategoryLayout"; }
2
votes
1 answer

Upgrading from Struts2 2.1 to 2.5

I am trying to do a redirectAction to another class, and to invoke a specific method in that class. Basically, when the user hits an "Edit" link in a cell in a table, we get that object and put it into the Session, and then invoke the Editor…
Tom
  • 51
  • 1
  • 3
2
votes
2 answers

How to redirect request after logoff in Struts2

The project has a servlet which is called when a person logs out. public class LogonServlet extends HttpServlet { private static final long serialVersionUID = -4899047924930198118L; public void doPost(HttpServletRequest request,…
Prashant
  • 152
  • 1
  • 16
2
votes
2 answers

I want to download a pdf file which is stored in the folder which is in WebContent of project

This is my struts.xml file. fileInputStream application/pdf …
2
votes
1 answer

onResult HTTPService

I have a HTTPService: {..} {...}
Yan
  • 582
  • 2
  • 6
  • 22
2
votes
1 answer

Add Query Parameter in action url within action after action is called

I am migrating an application from struts1 to struts2. I have a use case here. Struts1 action adds query String in the URL like this: public String execute() throws Exception { ..... some code here..... ActionForward inputForward =…
Vishal Patidar
  • 191
  • 2
  • 9
2
votes
1 answer

Value cannot be null. Parameter name: entity

I have the following view (basic "edit" template) @model SuccessStories.Models.Testimonials @using (Html.BeginForm()) { @Html.AntiForgeryToken()

Testimonials


Jordan Carter
  • 1,276
  • 3
  • 19
  • 43
2
votes
1 answer

Returning undefined type of data on ajax call

I have a jquery script which does ajax call to my action inside the controller in my MVC application: $('#save').click(function () { $.post(url, { id: id, text: textarea.val() }, function (data) { if (data) { …
perkes456
  • 1,163
  • 4
  • 25
  • 49
2
votes
2 answers

MVC Validation failed for one or more entities

[HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include = "StaffID,StartDate,EndDate,LeaveType,NoOfDays,AppStatus,HiddenID,LeaveReason,UpdateDate,UpdatedBy")] CurrentApplication currentApplication, Staff staff) …
2
votes
1 answer

Custom View Engine vs Custom Action Result

I have a scenario where the user have the option to click the button "download" and I should create a csv file, that contains history data, and then let the user save the file locally. As I haven't done this before, I started to look around for how…
MrW
  • 1,210
  • 2
  • 16
  • 27
2
votes
1 answer

Return view with jquery ajax

I would like to return a view inside of Ajax Success in my Jquery. This is my [HttpPost] MVC Action, decorated with HttpPost public ActionResult Search(SearchOrder order) { if (Session["UserID"] != null) { var results =…
2
votes
2 answers

ActionResult with different parameters

I've got a simple question about the behavior of ActionResult in ASP.NET MVC. I need to have two action result with the same name but different parameters. In particular I want this: public class CarController : Controller { …
lele.lic
  • 23
  • 1
  • 3
2
votes
1 answer

Async ActionResult implementation is blocking

Okay, Here I have an MVC 4 application and I am trying to create an Asynchronous ActionResult with in that. Objective : User has a download PDF Icon on the WebPage, and downloading takes much of time. So while server is busy generating the PDF, the…