• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about handling struts afterwhile upgrading

 
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:
Since I've upgraded from Spring 5.x to 6.X, the jakarta ee is causing the following strits 1.x related things to break in struts Action class.



For example if I'm using it like this in my code, it keeps on throwing above error:



Is there a way I could upgrade Struts 1.x to get the above issue fixed?
 
Saloon Keeper
Posts: 15608
366
  • Number of slices to send:
    Optional 'thank-you' note:
I can't endorse it as i haven't tried it, but you could take a look at the the following project: https://github.com/weblegacy/struts1

But maybe consider migrating your project to Struts2 or Spring MVC or Jakarta MVC.
 
Saloon Keeper
Posts: 27851
196
  • Number of slices to send:
    Optional 'thank-you' note:

Stephan van Hulst wrote:But maybe consider migrating your project to Struts2 or Spring MVC or Jakarta MVC.



Or JavaServer Faces.

Yes, I know everyone loves to put it down, but it's a web MVC framework that's actually part of the JEE standard, and thus is built in to the full-stack JEE webapp servers, and easy to work with even with the minimal servers like Tomcat. And Spring Boot, for that matter.

JSF was designed by people who wanted a POJO-based MVC system, having had a bellyful of all the kinks that Struts required (special Struts-only base classes and interfaces). Some of those designers had originally designed Struts. Being POJO-based means almost by definition that application components are insulated from changes in the framework itself, in addition to the potential for code re-use and the relative ease that you can unit-test them (no mock infrastructure needed).

Additionally, it gets good support on the CodeRanch.
 
Jack Tauson
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:

Stephan van Hulst wrote:I can't endorse it as i haven't tried it, but you could take a look at the the following project: https://github.com/weblegacy/struts1


Thanks. I encountered that link as well and couldn't find any maven URL and hence wondering how would I go about using 1.5.0 Release Candidate 2 ( as that's the latest one) as  all I'm seeing is what changes are done etc in the ReadMe.
 
Marshal
Posts: 4525
572
  • Number of slices to send:
    Optional 'thank-you' note:

Jack Tauson wrote:Thanks. I encountered that link as well and couldn't find any maven URL and hence wondering how would I go about using 1.5.0 Release Candidate 2 ( as that's the latest one) as  all I'm seeing is what changes are done etc in the ReadMe.


Is this what you are looking for?: io.github.weblegacy::struts-parent::1.5.0-RC2
 
Jack Tauson
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:

Ron McLeod wrote:Is this what you are looking for?: io.github.weblegacy::struts-parent::1.5.0-RC2



I think so but it doesn't talk about jakarta in the description on the maven repository. That looks similar to what that github link related release(https://github.com/weblegacy/struts1/releases/tag/v1.5.0_rc2) look like. I can try to test it.  Did you end up on the maven repository from the same github link (https://github.com/weblegacy/struts1)somehow ? Thanks!
 
Ron McLeod
Marshal
Posts: 4525
572
  • Number of slices to send:
    Optional 'thank-you' note:

Jack Tauson wrote:Did you end up on the maven repository from the same github link (https://github.com/weblegacy/struts1)somehow ? Thanks!


I just used Google to search for: maven repository weblegacy struts1
 
Jack Tauson
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:

Ron McLeod wrote:

Jack Tauson wrote:Did you end up on the maven repository from the same github link (https://github.com/weblegacy/struts1)somehow ? Thanks!


I just used Google to search for: maven repository weblegacy struts1



Thanks. Unfortunately, after adding the following dependency from above URL,



I haven't seen any change in the error I mentioned in my original post on this thread. Any idea if I need to get rid of my existing struts dependencies and just use the above one? right now I just added above dependency in addition to what already exists. It's kind of not clear what the above dependency is doing.
 
Stephan van Hulst
Saloon Keeper
Posts: 15608
366
  • Number of slices to send:
    Optional 'thank-you' note:
Well, no. It doesn't make sense to add a dependency on the parent POM of the Struts project. You want a dependency on one or more of the modules inside the parent project.

Show us the original Apache Struts dependency that you're trying to replace.
 
Jack Tauson
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:

Stephan van Hulst wrote:Well, no. It doesn't make sense to add a dependency on the parent POM of the Struts project. You want a dependency on one or more of the modules inside the parent project.

Show us the original Apache Struts dependency that you're trying to replace.



Sure, here is how it looks like. I've left some of the stuff in the dependencies below and removed some other things that were not very relevant.

Struts dependency starts at line #67 and line #104 is where I tried adding the one we are discussing.

 
Stephan van Hulst
Saloon Keeper
Posts: 15608
366
  • Number of slices to send:
    Optional 'thank-you' note:
First, remove the dependency on struts-parent.

See all those dependencies with the group ID org.apache.struts?

Simply replace the group ID in all of them with io.github.weblegacy, and replace the version in all of them with 1.5.0-RC2.
 
Jack Tauson
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:

Stephan van Hulst wrote:First, remove the dependency on struts-parent.

See all those dependencies with the group ID org.apache.struts?

Simply replace the group ID in all of them with io.github.weblegacy, and replace the version in all of them with 1.5.0-RC2.



Thanks. So I did that and it looks like the following now.

1. Please note that I didn't touch org.springframework on line 67 below. Hope that's fine.

2. Upon updating the maven dependencies, I'm getting error  package org.apache.struts.actions does not exist wherever import org.apache.struts.actions.DispatchAction; is used. Other imports like import org.apache.struts.action.ActionMessages; etc are not complaining.  And if I try to use import io.github.weblegacy.DispatchAction; as a fix for it, I get package io.github.weblegacy does not exist on this line. Any idea what might be wrong here?

3. Question on my original error -  May be I didn't mention but I deliberately changed javax imports to jakarta in the Struts action class which resulted in the error I mentioned in my original post. I am wondering if I should not mess javax imports which works fine with org.apache.struts and continue with my Spring upgrade process?



 
Stephan van Hulst
Saloon Keeper
Posts: 15608
366
  • Number of slices to send:
    Optional 'thank-you' note:
Please show us an example of a (short) class that is not compiling.
 
Jack Tauson
Ranch Hand
Posts: 416
  • Number of slices to send:
    Optional 'thank-you' note:

Stephan van Hulst wrote:Please show us an example of a (short) class that is not compiling.



Please find one of the classes below ( irrelevant code has been removed for brevity):




The errors I can see in eclipse are on the folowing lines:



Line #14 for import org.apache.struts.actions.DispatchAction;
Error Description from Eclipse:
The import org.apache.struts.actions cannot be resolved
Console says: package org.apache.struts.actions does not exist on the same line

Line #18 with red underline on DispatchAction for public class UploadAction extends DispatchAction {
Error Description from Eclipse:
DispatchAction cannot be resolved to a type
Console says: cannot find symbol

Line #35 and #47 saveErrors(request, errors);
Error Description from Eclipse:
The method saveErrors(HttpServletRequest, ActionMessages) is undefined for the type UploadAction

The error here is different than my original post error here for saveErrors.

Line #53 for saveMessages(request,errors);
Error Description from Eclipse:
The method saveMessages(HttpServletRequest, ActionMessages) is undefined for the type UploadAction


I wonder why other imports with org.apache.struts.action are working even though I got rid of org.apache.struts.action from the dependency and it's only complaining
for DispatchAction. Similarly, there's another class where it's complaining about import org.apache.struts.validator.ValidatorActionForm;
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic
vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |