Questions tagged [struts2]
Apache Struts 2 is an extensible framework based on servlets and implements model–view–controller (MVC) pattern in its architecture for creating enterprise-ready Java web applications.
11,371
questions
0
votes
0
answers
11
views
Struts2-jquery-plugin Not Compatible with Freemarker
I am trying to upgrade from Struts2 2.5.30 to Struts2 6.0.0. I am using the latest struts-jquery.plugin, version 4.0.3 as well as the latest Freemarker, version 2.3.31. When I try to load a JSP page ...
0
votes
0
answers
25
views
How to get Array of Objects values from one Action Class to another Action Class in Struts 2?
I'm working an a project where I need the Array of Objects values from One Action Class to another.
The flow goes something like this:
Try1.java --> first.jsp --> Try2.java
I'm not able to get ...
-1
votes
0
answers
10
views
Migrating from struts1 to Struts 2 calling of servlet from result tag instead of jsp
<action name =“create” class =“com.ChooseCreare” method=“execute”> <result name =“call” type=“dispatcher”><param name=“location”>/Package/</param></result>
Here package ...
-1
votes
0
answers
16
views
Session management and form fileds
I have a struts Registration form application having 4 JSP pages. if I click on register button, the values will be store in DB. Now I have to create a "Next" button.
if I click on next ...
-1
votes
0
answers
19
views
how to reset input fields after submit in struts, I want to reset all my input fields after click on submit button
I am using a struts application , I have a form with few filed. Once i submit the form the data is stored in database and i will return to the same page. Now, How to reset the input fields in the form ...
-1
votes
0
answers
14
views
Spring upgrade to 5.3.18
I have an application with struts2.5 and spring3. When I tried to upgrade Spring to 5. I m getting
Error500:Javax.servlet.servletException: filter[struts2]: could not be initialised.
What can be the ...
0
votes
1
answer
18
views
How to do URL redirect in Struts 1?
Our application (still using Struts 1) needs to redirect the user to a new login page (hosted externally). In a similar application (using Struts 2), we have this working properly. Below, I will show ...
-1
votes
0
answers
20
views
I have strut2.0 based existing Application earlier It was using CSP based authentication . Now we need to migrate on openID based authentication
I have strut2.0 based existing Application earlier It was using CSP based authentication . Now we need to migrate on openID based authentication.
Can Anyone please suggest or provide any ...
0
votes
0
answers
34
views
Calling a servlet from result tag in struts2 [duplicate]
Migrating from struts1 to struts2.5. In struts-config forwarding request to the servlet.wondering how we can achieve in struts 2
0
votes
0
answers
39
views
I am working in Struts2 webapp and while trying to send mail it's not working on first click where as second click working
I am working in Struts2 webapp and while trying to send mail it's not working on first click where as when I clicked second time it's working and aslo if I comment the <interceptor-ref name="...
-1
votes
0
answers
34
views
Jquery datepicker parsing date/time error
I could not resolve the parsing date/time error from Struts2 jquery tag datepicker when setting the minDate. Have tried both date and timestamp as the minDate parameter but the error is still showing. ...
-1
votes
0
answers
65
views
Front-end patterns for Microservices calls
I was wandering about patterns to implement for calling Microservices in a web app.
At moment a big client of the company that I work for had only implemented a SOA architecture in his infrastructure ...
0
votes
1
answer
40
views
Send data from Singleton Class to JSP page
I'am developing Struts2 Application. There is a value in database table and I want to use that value in many different Jsp pages. For that I am using singleton class.
DAO Class:
public class TestDAO {
...
-1
votes
0
answers
31
views
Struts 2 integration with spring 5.3.18
I am trying to upgrade my spring from 3.1.3 to 5.3.18 with struts 2.5.26
I got xwork2-core-2.3.37 error later i removed struts2-spring-plugin
Now my application is partially working
I can’t understand ...
0
votes
1
answer
51
views
Receiver class org.apache.struts2.tiles.StrutsTilesInitializer does not define or inherit an implementation of resolved method createContainerFactory
Could someone point me to a possible solution? We're migrating a really old Struts2.3/Spring4/Hibernate4 application to Struts 2.5.30 / Hibernate 5.2.1 / Spring 5.2.21. Also, the legacy app had Tiles ...
0
votes
0
answers
28
views
struts2 How to change the resultCode in the PreResultListener
I am migrating a project from Struts 1 to Struts 2.
The requirement is to validate if the result jsp is secured or open. If secured, we have to take the customer to an error jsp which states that the ...
0
votes
0
answers
29
views
Struts action call to a particular method not working intermittently
So I am using Struts 2 and I have action calls to specific methods , now my application instance works fine most of the time but intermittently my struts calls after interceptor requests just fade out ...
0
votes
1
answer
31
views
Struts2 keep same action url if validation fail using struts2-bean-validation-plugin
I am using Struts 2 and I have two action one will show the register form and second will be register user.
I want to achieve is while submitting form if any validation fail then user will be redirect ...
0
votes
0
answers
20
views
struts TextProvider’s with user input as a second param is safe? [duplicate]
From this page https://struts.apache.org/security/#do-not-use-incoming-values-as-an-input-for-localisation-logic, it says that all the getText(...) from TextProvider are not OGNL injection safe. ...
0
votes
0
answers
10
views
Struts2 field validator - Validate multiple fields together [duplicate]
As part of my project I have the credit card month and year as two different fields,
<field name="expiry-month">
<field-validator>
...
</field-validator>
&...
0
votes
0
answers
24
views
Struts2 - Best way to redirect to another domain
My website has a section that will be migrated to another domain, but all our clients still use the old url, which will be deprecated soon.
What i want to achieve is send 301 moved permanently HTTP ...
0
votes
0
answers
22
views
Tomcat is not redirecting to custom error page in case of IllegalArgumentException with error code 400 [duplicate]
I am trying to fix a bug in Java Struts2 application, where in case of "java.lang.IllegalArgumentException: Invalid character found in the request target" I have to show custom error page ...
1
vote
1
answer
57
views
repeated Freemarker warning message - Rendering tag out of Action scope
I have a Struts web application (core V2.5.30) running on Tomcat9 / Ubuntu server. The syslog file is getting numerous instances of error messages similar to the following. There are no directly ...
1
vote
1
answer
52
views
Websocket Connection is not working with Struts2
I have taken example from
https://github.com/slankka/websocket-with-struts2
Error : WebSocket connection to 'ws://localhost:8080/websocket' failed:
Web.xml
<!DOCTYPE web-app PUBLIC
"-//...
0
votes
1
answer
130
views
Struts to Spring MVC using Sping Boot
I need to convert a Struts app to Spring MVC using Spring Boot.
He want one application Core that can be called from two different Front Ends, one is with Angular and one with JSPs.
My idea is to ...
0
votes
0
answers
33
views
Why is it throwing a HTTP Status 500 'The requested list key 'colors' could not be resolved' error when running this Struts2 application? [duplicate]
Disclaimer: Before I begin, just wanted to say I've consulted this similar question but the answers provided did not fix the issue (Struts2 list couldn't be resolved)
I'm building an application ...
0
votes
2
answers
45
views
Struts 2 problem to upload a document problem with ajax
I have a problem to upload a file with my Struts 2 app.
I have this:
<div class="form-group">
<label for="file">my file</label>
<input type="file"...
0
votes
1
answer
32
views
Struts2 + jQuery, how to update style of checked items in a table
I have a table with a checkbox and a <s:property> on each row:
<s:iterator value="myforms" var="form">
<tr>
<td class="text-center">
<...
0
votes
0
answers
16
views
What is causing the no action mapped for namespace and action name error with Struts 2 when there is mapping done in the struts.xml? [duplicate]
I'm building my first application with Struts2 and I'm running into a HTTP Status 404 No action mapped for namespace and action name error when I run the application.
From researching the issue, I ...
0
votes
1
answer
37
views
What could be causing the StrutsPrepareAndExecuteFilter ClassNotFoundException with Struts2 when using the latest Struts 2.5.29 version? [duplicate]
I'm building my first application with Struts2 and I'm running into a ClassNotFoundException when I run the application.
Just for some background. I used this link to download the latest Struts2 ...
0
votes
0
answers
106
views
struts2.5.26 only file field is getting null on action class and rest fields are getting set
Recently I moved from struts2.3.35 to struts2.5.26 and along with this I moved to spring boot app from spring which was using external tomcat and now it's using embedded one.
So whenever I try to ...
1
vote
1
answer
80
views
How to implement the equivalent of html:cancel in Struts 2?
I'm migrating an application from Struts1 to Struts2.
In Struts 1, we have <html:cancel> tag to bypass the form bean validate() method upon clicking.
But in Struts 2, I'm not aware of any ...
1
vote
1
answer
72
views
Property tag of struts2 using a properties file with html tags
I am migrating a Struts1 project to Struts2. It has a properties file with html tags like below.
properties file
profile.instruction.ordersearch=Enter the search criteria,and then click <b>...
0
votes
1
answer
124
views
How to redirect my app in Struts 2 with Azure SSO
I am wanting to implement a SSO with Azure to an application that is built with Struts 2, I have already implemented the filter to make me the login from the microsoft page.
however the redirection ...
1
vote
1
answer
680
views
Logs not printing after migrating from log4j-1.2.17 to Log4j2 2.17.1
I am trying to migrate from log4j-1.2.17 to log4j-api-2.17.1 but after all the changes, the logs are not getting printed. I am using 'Option 2' as suggested by the https://logging.apache.org/log4j/2.x/...
-1
votes
1
answer
108
views
Struts2 no Action mapped for namespace [/] and action name [index] associated with context path
This has been asked many times before, but not quite the same as this. Everything seems to be present and in the right place. I'm using Java8, Eclipse, Maven, Struts2 w/ Convention Plugin, Spring, ...
0
votes
1
answer
125
views
Getting errors after attempting to update log4j and remove display tag
I've recently had to update my log4j dependency as the old one was being pulled in by displaytag. I've converted all of the necessary tables, and things seem to be running fine on the front end, but I'...
5
votes
1
answer
210
views
How to redirect app in Struts 2 with Azure SSO
I am wanting to implement a SSO with Azure to an application that is built with Struts 2, I have already implemented the filter to make me the login from the microsoft page.
however the redirection ...
1
vote
1
answer
29
views
How to get source path and alternate text values from properties file in Struts2 for inserting images? In Struts1 altKey and srcKey were used for this
I would like to know what the replacement is for the altKey and srcKey attributes in the <html:img> tag in Struts 2.
What I want to achieve is to be able to insert an image with source path from ...
1
vote
1
answer
24
views
Struts 2 cannot resolve java action method in # tag
There's something I'm been missing in how Struts resolve ftl tag,
I have an action with some methods that I'm trying to call from my ftl.
The signature:
<@s.property value="%{someJavaMethod(...
0
votes
1
answer
35
views
struts2 s:if tag behaves differently for string and boolean
I have an s:iterator with s:if like below
<s:iterator var="connections" value="serviceItems">
<s:if test='disableCheckBox == "Y"'>
disableCheckBox ...
1
vote
1
answer
72
views
HTTP Status 404 while running struts2 application
I'm using Java SE-11, struts 2.5.29, tomcat 10.0.6 in my program.
I'm trying to create a small project using struts-2 framework.
I have declared all the filters in the web.xml as mentioned on the ...
0
votes
0
answers
64
views
Ajax call always going to error function in Struts 2
I am trying to return json from action by ajax call in struts 2 but it's always taking me to the error function.
Here i am trying to take the cartsize by ajax call and want to print the cartsize ...
0
votes
0
answers
56
views
Struts2 - Tomcat - Intellij
I'm following a course of struts2 using Eclipse.
I have intellij ultimate and i'm more confident with this.
How can i create the corresponding of Eclipe's Dynamic Web Project with Inellij?
Thanks ...
0
votes
0
answers
44
views
Struts2 tokenSession interceptor null pointer exception when submitting form multiple times
I have added a tokenSession interceptor to struts xml as below but whenever I submit multiple requests I am getting a null pointer exception from the JspRuntimeLibrary.
The code is working ok with ...
0
votes
0
answers
22
views
Struts2 Wildcard mapping not working while using Struts2 REST api implementation [duplicate]
I am trying to implement the SEO friendly URL something like /movies/{id}/actors/{actor_id} to point out to the actor details of a particular movie. So I tried using the Advanced Wildcard mappings, ...
0
votes
1
answer
120
views
Struts2 REST-API with {id} is not mapped properly when API request sent along with JSON Body
Here my files.
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"...
2
votes
1
answer
109
views
How to check username availability using Ajax in Struts 2
I am trying to check username available or not when a user tries to create his account.
when a user types it's username there should be an instant check that username is available or not and it will ...
0
votes
1
answer
78
views
Struts1 Link tag to Struts2 Anchor Tag; get the action parameter
Short Question: How do I get the action passed in the AnchorTag's action when I am customising it?
Long Question:
I am doing a migration from Struts 1 to Struts 2 where we are using some custom tags. ...
1
vote
1
answer
65
views
Getting Uncaught TypeError errors using Struts2 JQuery datepicker tag
I have a Struts 2 application with UI built using bootstrap and am trying to get JQuery datepicker working using struts2 jquery tag library. I am using <sj:head compressed="true" jqueryui=...