DynamicJasper + Struts 1 - struts-1

I saw that DynamicJasper integration with Struts 2 is possible and easy on the official doc.
But how about Struts 1 ?? is there a possible integration like with Struts 2?

A regular file download should be enough... no need for anything special to have it integrated.
The logic to make the report should be in a service class, the action should call this service. The service should return a temporary file in order to let the action send it as response to the client as a regular file download.

Related

What is the difference between AddMVC, AddMvcCore and AddRouting in ASP NETCore

I am looking for performance improvement in my ASP.net Core project
I am using graphql.net instead of REST in my project. So I don't need MVC mostly. But I also have a health check endpoint lets say api/health to check the service health. For that I need to add MVC to my application.
Initially I was using the addMVC extension, later I figured out that I should use addMVCCore instead of add addMVC to exclude unnecessary bundle.
Today I came across this article
https://hackernoon.com/iris-go-vs-net-core-kestrel-in-terms-of-http-performance-806195dc93d5
It talks about using AddRouting alone and using kestrel
I am already using kestrel.
I wanted to know what exactly differs among the three.
Can I use addRouting instead of addMVCCore if I just need a health check endpoint ? would that improve perf
AddMVC() internally calls the AddMVCCore() .
AddMVC() calls the required services for the MVC . like return view() from the action and it has only the minimum dependencies required to run the MVC framework
addMvcCore() calls only the mvc core services . it contains the return content("") and it doesn't contains the dataannotations ,auth filters , cors filter .

Spring boot pre api action annotation

I'm new using Spring boot , but i come from a Play! framework background.
In Play there was something called action "Action Composition"
https://www.playframework.com/documentation/2.6.x/JavaActionsComposition
It is used to do some code logic before going through the api method , so it could be used for creating a custom security for example or whatever logic we want to add before accessing an api method.
Then we simply annotate whatever api with this Action.
Is there something similar to do in Spring boot ?
I have googled for actions/ validators , but i did not find results similar to Play framework's action composition behavior.
What you are looking for is called an interceptor. Its purpose is to allow some action to be taken before an actual API endpoint is reached.
This documentation should help.

A layer before controller - spring mvc

I have a spring mvc application. Now in my project, I basically want to execute the latest request and all the previous requests are cancelled/terminated.
Currently all the cancellation code is inside my controller. But for code clarity/readability I want to port this code outside my controller. Ultimately I want a layer above, which takes requests, checks if the task is to be cancelled or not and only then forward it to the controller.
One way of doing above would be to have another controller which forwards it to the above controller. I have also heard of Handler Interceptor. What is the best way of doing it?
I would go with an interceptor if I were you.
you can check this link for examples on how to implement you own

Seems like struts validate method doesn't work anymore when using spring

I am now moving to Struts for my presentation layer. I have done a simple example using Struts alone (not really, actually, I test an example inside a simple maven project). From now on, I am likely to use Struts with Spring so I try to migrate my simple application, my goal was to use service layer to deal with specific operation.
In my simple test, I extend action from Struts action, now that I am using Spring, I extend it from ActionSupport so that I can fully use spring injection. Now it seems like even though I override validate method, it is no longer called. Is that the right behaviour, if so, where should perform operations like checking if my mandatory fields are populated (inside action or service ?)
Thanks for your answer !

Spring MVC 3 and Ajax library advice

I'm developing a webapp with Hibernate+Spring 3 (Spring MVC, JSP): I'd like to create some divs with AJAX style (i.e. no need to refresh all the page, independent update of each div).
I'd like a good advice about which AJAX library to use (in conjunction with Spring 3 MVC + JSP) and, if possible, where to find some code snippets.
I know very little of AJAX libraries, JSONs and how to integrate them, but I have good knowledge of Javascript and Spring (and how callbacks work). I'd like to write as less code as possible, particularly in the jsps.
My Webapp will display an updated (every 5 minutes) POJO in a div and perform some operations between different domain objects in the other div when user press a button.
This is correct use JQuery
Here
http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/
you can find working examples to use Jquery+JSON+Spring MVC.
and this question can help you with server side configuration:
JQuery, Spring MVC #RequestBody and JSON - making it work together
I would suggest jQuery. It is very easy to use and has very good ajax support.
In addition to that it has quite a lot of plugins and components.

Resources