struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peer Mohammad <peer4...@gmail.com>
Subject Re: Issue in migration from struts2.3.35 to struts2.5.22
Date Thu, 29 Oct 2020 10:11:18 GMT
Hi,

I am using maven to control dependencies and i have doubt on struts2-tiles-plugin jar which
has many new library class,not sure if something need to implement. I am using version in
dtd in tiles.xml.

Please find the list of dependencies for struts2.3.35 (working fine) and struts2.5.22(upgrading)

The list of jars version for strust2.3.55:
struts2-core 2.3.35
freemarker -2.3.28
xwork-core -2.3.35
struts2-tiles-plugin 2.3.35
tiles-api 2.2.2
tiles-compat 3.0.8
tiles-core 2.2.2
tiles-jsp 2.2.2
tiles-servlet 2.2.2
ognl 3.0.21
commons-validator 1.3.1
commons-beanutils 1.8.0
taglibs-standard-1.2.5
asm-5.0.2
bsf-2.3.0
commons-fileupload-1.3.2
commons-lang3-3.1
commons-logging-1.1.3
commons-io-2.2
commons-chain-1.2
commons-digester-1.8

------
list of jars for Strust2.5.22 

struts2-core 2.5.22
freemarker -2.3.30
xwork-core -2.3.37
struts2-tiles-plugin 2.5.22
tiles-api 3.0.8
tiles-compat 3.0.8
tiles-core 3.0.8
tiles-jsp 3.0.8
tiles-servlet 3.0.8
ognl 3.1.26
commons-validator 1.3.1
commons-beanutils 1.9.4
taglibs-standard-1.2.5
asm-7.2
bsf-2.4
commons-fileupload-1.4
commons-lang3-3.8.1
commons-logging-1.2
commons-io-2.6
commons-chain-1.2
commons-digester-2.1

error:

Caused by: There is no ActionContext for current request! - [unknown location]

    at org.apache.struts2.tiles.StrutsTilesLocaleResolver.resolveLocale(StrutsTilesLocaleResolver.java:45)

    at org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:86)

    at org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:286)

    at org.apache.tiles.TilesContainerWrapper.getDefinition(TilesContainerWrapper.java:83)

    at org.apache.tiles.impl.mgmt.CachingTilesContainer.getDefinition(CachingTilesContainer.java:89)

    at org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.java:121)

    at org.apache.tiles.template.InsertDefinitionModel.renderDefinition(InsertDefinitionModel.java:132)

    at org.apache.tiles.template.InsertDefinitionModel.execute(InsertDefinitionModel.java:99)

    at org.apache.tiles.jsp.taglib.InsertDefinitionTag.doTag(InsertDefinitionTag.java:254)

    at org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:151)

    at org.apache.jsp.index_jsp._jspService(index_jsp.java:115)

    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)

    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)

    ... 57 more

On 2020/10/28 14:28:45, Lukasz Lenart <lukaszlenart@apache.org> wrote: 
> śr., 28 paź 2020 o 11:55 Peer Mohammad <peer4026@gmail.com> napisał(a):
> > Please find the web.xml and struts.xml file. I have observed that many library classes
are not available in strut2-tiles-plugin file and xwork some package in struts-core-2.5.22
compare to struts2.3.35.
> 
> Not sure what do you mean by that? Which classes are missing? XWork
> was merged into Struts Core and there is no additional jar anymore.
> Maybe you are mixing different jars in your app, do you use Maven to
> control dependencies? Could you list jars from the lib folder?
> 
> Also did you use a proper DTD in your tiles.xml files as mentioned
> here https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-Tiles
> 
> <!DOCTYPE tiles-definitions PUBLIC
>        "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
>        "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
> 
> > Web.xml
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
> >          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
> >                  http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
> >          version="3.1">
> >         <display-name>CHEETTA_online</display-name>
> >         <!-- <context-param>
> >                 <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
> >                 <param-value>/WEB-INF/tiles.xml</param-value>
> >         </context-param> -->
> >         <listener>
> >                 <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
> >         </listener>
> >
> >         <!-- For Veracode CSRF issue - Added the below filters - Start -->
> >         <!-- Generates CSRF token and keeps in session and request objects -->
> >         <filter>
> >     <filter-name>CSRFTokenFilter</filter-name>
> >     <filter-class>com.sbc.cheetta.common.framework.filter.GenerateCSRFTokenFilter</filter-class>
> >         </filter>
> >         <filter-mapping>
> >             <filter-name>CSRFTokenFilter</filter-name>
> >             <url-pattern>/*</url-pattern>
> >         </filter-mapping>
> >          <filter-mapping>
> >             <filter-name>CSRFTokenFilter</filter-name>
> >             <url-pattern>*.action</url-pattern>
> >         </filter-mapping>
> >         <filter-mapping>
> >             <filter-name>CSRFTokenFilter</filter-name>
> >             <url-pattern>*.do</url-pattern>
> >         </filter-mapping>
> 
> This is duplication, just /* is enough, remove other patterns
> 
> >         <!-- Filter for validating CSRF attack-->
> >         <filter>
> >     <filter-name>CSRFValidationFilter</filter-name>
> >     <filter-class>com.sbc.cheetta.common.framework.filter.CSRFValidationFilter</filter-class>
> >      <init-param>
> >         <param-name>excludedUrls</param-name>
> >         <!-- Comma separated list of excluded servlets  -->
> >         <param-value>/index.jsp,/Welcome.do,/Logoff.do,/LogonSubmit.do,/networkEditProfileLinker.do,/images/swmainmenubutton.gif,/images/att_logo.gif,/images/mwmainmenubutton.gif,/images/admin.gif,/theme/Master.css,/images/wmainmenubutton.gif,/images/atmainmenubutton.gif,/images/bg_header1024.gif,/images/bg_footer1024.gif,/images/bg_header1024.gif</param-value>
> >      </init-param>
> >         </filter>
> >         <filter-mapping>
> >             <filter-name>CSRFValidationFilter</filter-name>
> >             <url-pattern>/*</url-pattern>
> >         </filter-mapping>
> >         <!-- For Veracode CSRF issue - Added the below filters - End -->
> >
> >         <filter>
> >                 <filter-name>xFrameOptionsFilter</filter-name>
> >                 <filter-class>com.sbc.cheetta.common.framework.filter.XFrameOptionsFilter</filter-class>
> >         </filter>
> >         <filter-mapping>
> >                 <filter-name>xFrameOptionsFilter</filter-name>
> >                 <url-pattern>*.action</url-pattern>
> >         </filter-mapping>
> >         <filter-mapping>
> >                 <filter-name>xFrameOptionsFilter</filter-name>
> >                 <url-pattern>*.do</url-pattern>
> >         </filter-mapping>
> >         <filter>
> >                 <filter-name>struts2</filter-name>
> >                 <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
> >                 <init-param>
> >                         <param-name>actionPackages</param-name>
> >                         <param-value>com.sbc.cheetta.actions</param-value>
> >                 </init-param>
> >         </filter>
> >         <filter-mapping>
> >                 <filter-name>struts2</filter-name>
> >                 <url-pattern>/*</url-pattern>
> >         </filter-mapping>
> >         <filter-mapping>
> >         <filter-name>struts2</filter-name>
> >         <url-pattern>*.action</url-pattern>
> >     </filter-mapping>
> >         <filter-mapping>
> >                 <filter-name>struts2</filter-name>
> >                 <url-pattern>*.do</url-pattern>
> >         </filter-mapping>
> 
> Same here, just left /* pattern
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message