Upgrading Struts 2.2.3 to 2.3.34

classic Classic list List threaded Threaded
44 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
We are currently attempting to migrate our application from Struts 2.2.3 to
2.3.34. However, we are currently facing issues with the migration. Here
are the steps that we have already performed.


1. Replaced necessary JAR files & required dependencies.

2. Changed DTD in struts.xml

3. Changed DTD in tiles.xml

4. Modified web.xml file and changed
org.apache.struts2.dispatcher.FilterDispatcher to
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

5. Modified web.xml file context-param to
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>

6. Added the ff in struts.xml:

<constant name="struts.additional.excludedPatterns"
value="^(action|method):.*"/>

<constant name="struts.enable.DynamicMethodInvocation" value="true" />


We would just like to know if there are additional changes that we need to
do in our java/jsp/xml files. This is because we are getting errors such as
these when executing actions:


No result defined for action com.MyRequestAction and result fileSizeError


This error did not appear before our migration. Our results are correctly
defined in our struts.xml. Hence, we are not certain why the error was
returned to us.


Thanks!
Reply | Threaded
Open this post in threaded view
|

Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
We are currently attempting to migrate our application from Struts 2.2.3 to
2.3.34. However, we are currently facing issues with the migration. Here
are the steps that we have already performed.


1. Replaced necessary JAR files & required dependencies.

2. Changed DTD in struts.xml

3. Changed DTD in tiles.xml

4. Modified web.xml file and changed
org.apache.struts2.dispatcher.FilterDispatcher
to org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

5. Modified web.xml file context-param to <param-name>org.apache.tiles.impl.
BasicTilesContainer.DEFINITIONS_CONFIG</param-name>

6. Added the ff in struts.xml:

<constant name="struts.additional.excludedPatterns"
value="^(action|method):.*"/>

<constant name="struts.enable.DynamicMethodInvocation" value="true" />


We would just like to know if there are additional changes that we need to
do in our java/jsp/xml files. This is because we are getting errors such as
these when executing actions:


No result defined for action com.MyRequestAction and result fileSizeError


This error did not appear before our migration. Our results are correctly
defined in our struts.xml. Hence, we are not certain why the error was
returned to us.


Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Yasser Zamani


On 10/12/2017 8:48 AM, Ej Magdaluyo wrote:
> No result defined for action com.MyRequestAction and result fileSizeError

Could you please post it's complete stack trace?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
Hi Yasser,

Here is the stacktrace:

No result defined for action com.MyRequestAction and result fileSizeError -
action

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:276)

org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:575)

org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)

weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)

weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)

weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)

weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)

weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

On Thu, Oct 12, 2017 at 2:56 PM, Yasser Zamani <[hidden email]>
wrote:

>
>
> On 10/12/2017 8:48 AM, Ej Magdaluyo wrote:
> > No result defined for action com.MyRequestAction and result fileSizeError
>
> Could you please post it's complete stack trace?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Lukasz Lenart
In reply to this post by Ej Magdaluyo
2017-10-12 3:55 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> No result defined for action com.MyRequestAction and result fileSizeError

Can you post your action & result definition from struts.xml?


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
Hi Lukasz,

Here it is:

<action name="editMyDraft" method="editMyDraft" class="com.MyRequestAction">
<result name="success" type="tiles">/addAccess</result>


tiles.xml:

<definition name="/addAccess" extends="baseLayout">
<put-attribute name="title" value="addAccess"/>
<put-attribute name="body" value="/jsp/addAccess.jsp"/>
</definition>


This functionality was working correctly prior to the upgrade. I am not
exactly sure what triggered the exception this time.

I have already tried removing the / for this and the error persists.

Your help would be greatly appreciated. Thanks!

On Thu, Oct 12, 2017 at 3:36 PM, Lukasz Lenart <[hidden email]>
wrote:

> 2017-10-12 3:55 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> > No result defined for action com.MyRequestAction and result fileSizeError
>
> Can you post your action & result definition from struts.xml?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Yasser Zamani


On 10/12/2017 11:14 AM, Ej Magdaluyo wrote:
> <action name="editMyDraft" method="editMyDraft" class="com.MyRequestAction">
> <result name="success" type="tiles">/addAccess</result>

Your action has returned "fileSizeError" but only "success" has defined.

> No result defined for action com.MyRequestAction and result fileSizeError -
> action
>
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:276)
>
> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)

It seems you have an empty stack without any interceptor. Is this your
desired one or occurred after migration?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Lukasz Lenart
In reply to this post by Ej Magdaluyo
2017-10-12 9:44 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> Hi Lukasz,
>
> Here it is:
>
> <action name="editMyDraft" method="editMyDraft" class="com.MyRequestAction">
> <result name="success" type="tiles">/addAccess</result>

As Yasser already pointed out, you are missing a "fileSizeError"
result, probably one of the interceptors returns it.


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
HI Lukasz, Yasser,

I would just like to confirm if it is expected that we would need to add a fileSizeError result. This is because the code was working in Struts 2.2.3, and the error only appeared post-migration. I reviewed the migration notes, and I am not certain which version changed this.

We have a fileSizeError jsp being called in another part of struts.xml:

<action name="reviewUpload" class="com.AddAccess" method="reviewUpload">
<result name="success">popupreview.jsp</result>
<result name="fileSizeError">fileSizeError.jsp</result>
</action>


Jar files used:




On Thu, Oct 12, 2017 at 4:01 PM, Lukasz Lenart <[hidden email]> wrote:
2017-10-12 9:44 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> Hi Lukasz,
>
> Here it is:
>
> <action name="editMyDraft" method="editMyDraft" class="com.MyRequestAction">
> <result name="success" type="tiles">/addAccess</result>

As Yasser already pointed out, you are missing a "fileSizeError"
result, probably one of the interceptors returns it.


Regards
--
Łukasz
<a href="tel:%2B%2048%20606%20323%20122" value="+48606323122">+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Yasser Zamani


On 10/12/2017 11:44 AM, Ej Magdaluyo wrote:
> I would just like to confirm if it is expected that we would need to add
> a fileSizeError result. This is because the code was working in Struts
> 2.2.3, and the error only appeared post-migration. I reviewed the
> migration notes, and I am not certain which version changed this.
>

I don't think Struts has such result internally. So, please search all
your xml and java files for string fileSizeError. Maybe you already has
defined a global result but fails to load in migrated app. Then please
debug that action why returns this result and why does not return such
result in previous app. You can do this by put a breakpoint on what you
found in previous steps.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Lukasz Lenart
In reply to this post by Ej Magdaluyo
2017-10-12 10:14 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> I would just like to confirm if it is expected that we would need to add
a fileSizeError result. This is because the code was working in Struts
2.2.3, and the error only appeared post-migration. I reviewed the migration
notes, and I am not certain which version changed this.

I don't know if this is needed but this what the error message says. And
you are migrating from a very old version of Struts (please be aware that
2.x.x means Struts 2, where 2.2.x and 2.3.x is like Struts 2 ver 2 compared
to Struts 2 ver 3)

> We have a fileSizeError jsp being called in another part of struts.xml:
>
> <action name="reviewUpload" class="com.AddAccess" method="reviewUpload">
> <result name="success">popupreview.jsp</result>
> <result name="fileSizeError">fileSizeError.jsp</result>
> </action>

So I would review your flow of the interceptors because it looks like like
of them returns this result.

> Jar files used:

You cannot inline images, please list your JARs


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
Hi Yasser, Lukasz,

Thank you for the information. I will look into the code and will let you
know.

Here is the list of the JAR files:
antlr-2.7.2.jar
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
commons-beanutils-1.8.0.jar
commons-collections-3.2.2.jar
commons-digester-2.0.jar
commons-fileupload-1.3.2.jar
commons-io-2.2.jar
commons-lang-2.4.jar
commons-lang3-3.2.jar
commons-logging-1.1.3.jar
displaytag-1.2.jar
displaytag-export-poi-1.2.jar
freemarker-2.3.22.jar
itext-1.3.jar
javaee.jar
javassist-3.11.0.GA.jar
jcs-1.3.jar
json-lib-2.1-jdk15.jar
jstl.jar
jxl.jar
log4j-1.2.16.jar
obpm_ws_proxy.jar
ognl-3.0.21.jar
slf4j-api-1.7.12.jar
slf4j-simple-1.7.12.jar
struts2-core-2.3.34.jar
struts2-dojo-plugin-2.3.34.jar
struts2-json-plugin-2.3.34.jar
struts2-tiles-plugin-2.3.34.jar
tiles-api-2.2.2.jar
tiles-compat-3.0.1.jar
tiles-core-2.2.2.jar
tiles-el-2.2.2.jar
tiles-extras-3.0.1.jar
tiles-freemarker-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-ognl-2.2.2.jar
tiles-request-servlet-1.0.1.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
xercesImpl.jar
xwork-core-2.3.34.jar


On Thu, Oct 12, 2017 at 4:36 PM, Lukasz Lenart <[hidden email]>
wrote:

> 2017-10-12 10:14 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> > I would just like to confirm if it is expected that we would need to add
> a fileSizeError result. This is because the code was working in Struts
> 2.2.3, and the error only appeared post-migration. I reviewed the migration
> notes, and I am not certain which version changed this.
>
> I don't know if this is needed but this what the error message says. And
> you are migrating from a very old version of Struts (please be aware that
> 2.x.x means Struts 2, where 2.2.x and 2.3.x is like Struts 2 ver 2 compared
> to Struts 2 ver 3)
>
> > We have a fileSizeError jsp being called in another part of struts.xml:
> >
> > <action name="reviewUpload" class="com.AddAccess" method="reviewUpload">
> > <result name="success">popupreview.jsp</result>
> > <result name="fileSizeError">fileSizeError.jsp</result>
> > </action>
>
> So I would review your flow of the interceptors because it looks like like
> of them returns this result.
>
> > Jar files used:
>
> You cannot inline images, please list your JARs
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
Upon investigating the interceptor flow, it should be working based on my
understanding:



RequestInterceptor:

*import* org.apache.struts2.ServletActionContext;

*import* org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper;



*import* com.opensymphony.xwork2.ActionInvocation;

*import* com.opensymphony.xwork2.interceptor.Interceptor;



*public* *class* *RequestInterceptor* *implements* Interceptor{



        HttpServletRequest request = (HttpServletRequest) invocation
.getInvocationContext().get(ServletActionContext.*HTTP_REQUEST*);

       *if*(request *instanceof* MultiPartRequestWrapper){

MultiPartRequestWrapper fileRequestWrapper=(MultiPartRequestWrapper)request;

               *if*(fileRequestWrapper!=*null* &&fileRequestWrapper
.getErrors()!=*null*){

                       *return* "fileSizeError";

               }

            }



return SUCCESS is not included here.




Struts.xml:


In struts.xml the fileSizeError that was used was only the jsp page.



       <action name=*"reviewUpload"* class=*"com.AddAccess"* method=
*"reviewUpload"*>

              <result name=*"success"*>popupreview.jsp</result>

             <result name=*"fileSizeError"*>fileSizeError.jsp</result>

       </action>



Interceptors:


<interceptors>

                    <interceptor name=*"sessionCheck"* class=
*"com.RequestInterceptor"* />

                    <interceptor-stack name=*"sStack"*>

                           <interceptor-ref name=*"sessionCheck"* />

                           <interceptor-ref name=*"defaultStack"* />

                    </interceptor-stack>

             </interceptors>




The success result for reviewUpload can be found in AddAccess.java, also an
interceptor import file is also being used.


*import* org.apache.struts2.interceptor.ServletRequestAware;

*import* org.apache.struts2.interceptor.ServletResponseAware;





  *public* String reviewUpload()

    *throws* Exception

  {

    StringBuilder *line* = *new* StringBuilder();

    PrintWriter *out* = *this*.httpResponse.getWriter();



    uploadFile();



    setFileProcessingStatus("SUCCESS");

    *return* "success";

  }



Is it possible that I am missing an additional import here?






On Thu, Oct 12, 2017 at 4:59 PM, Ej Magdaluyo <[hidden email]> wrote:

> Hi Yasser, Lukasz,
>
> Thank you for the information. I will look into the code and will let you
> know.
>
> Here is the list of the JAR files:
> antlr-2.7.2.jar
> asm-3.3.jar
> asm-commons-3.3.jar
> asm-tree-3.3.jar
> commons-beanutils-1.8.0.jar
> commons-collections-3.2.2.jar
> commons-digester-2.0.jar
> commons-fileupload-1.3.2.jar
> commons-io-2.2.jar
> commons-lang-2.4.jar
> commons-lang3-3.2.jar
> commons-logging-1.1.3.jar
> displaytag-1.2.jar
> displaytag-export-poi-1.2.jar
> freemarker-2.3.22.jar
> itext-1.3.jar
> javaee.jar
> javassist-3.11.0.GA.jar
> jcs-1.3.jar
> json-lib-2.1-jdk15.jar
> jstl.jar
> jxl.jar
> log4j-1.2.16.jar
> obpm_ws_proxy.jar
> ognl-3.0.21.jar
> slf4j-api-1.7.12.jar
> slf4j-simple-1.7.12.jar
> struts2-core-2.3.34.jar
> struts2-dojo-plugin-2.3.34.jar
> struts2-json-plugin-2.3.34.jar
> struts2-tiles-plugin-2.3.34.jar
> tiles-api-2.2.2.jar
> tiles-compat-3.0.1.jar
> tiles-core-2.2.2.jar
> tiles-el-2.2.2.jar
> tiles-extras-3.0.1.jar
> tiles-freemarker-2.2.2.jar
> tiles-jsp-2.2.2.jar
> tiles-ognl-2.2.2.jar
> tiles-request-servlet-1.0.1.jar
> tiles-servlet-2.2.2.jar
> tiles-template-2.2.2.jar
> xercesImpl.jar
> xwork-core-2.3.34.jar
>
>
> On Thu, Oct 12, 2017 at 4:36 PM, Lukasz Lenart <[hidden email]>
> wrote:
>
>> 2017-10-12 10:14 GMT+02:00 Ej Magdaluyo <[hidden email]>:
>> > I would just like to confirm if it is expected that we would need to add
>> a fileSizeError result. This is because the code was working in Struts
>> 2.2.3, and the error only appeared post-migration. I reviewed the
>> migration
>> notes, and I am not certain which version changed this.
>>
>> I don't know if this is needed but this what the error message says. And
>> you are migrating from a very old version of Struts (please be aware that
>> 2.x.x means Struts 2, where 2.2.x and 2.3.x is like Struts 2 ver 2
>> compared
>> to Struts 2 ver 3)
>>
>> > We have a fileSizeError jsp being called in another part of struts.xml:
>> >
>> > <action name="reviewUpload" class="com.AddAccess" method="reviewUpload">
>> > <result name="success">popupreview.jsp</result>
>> > <result name="fileSizeError">fileSizeError.jsp</result>
>> > </action>
>>
>> So I would review your flow of the interceptors because it looks like like
>> of them returns this result.
>>
>> > Jar files used:
>>
>> You cannot inline images, please list your JARs
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Yasser Zamani


On 10/12/2017 4:03 PM, Ej Magdaluyo wrote:
>                 *if*(fileRequestWrapper!=*null*  &&fileRequestWrapper
> .getErrors()!=*null*){

I worked and found the bug :) the new version of MultiPartRequestWrapper
instantiates it's `error` inside it's constructor. So you should rewrite
above as:

if(fileRequestWrapper!=null && fileRequestWrapper.hasErrors()){

Hope this helps!
Yasser.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Lukasz Lenart
2017-10-12 19:06 GMT+02:00 Yasser Zamani <[hidden email]>:
> On 10/12/2017 4:03 PM, Ej Magdaluyo wrote:
>>                 *if*(fileRequestWrapper!=*null*  &&fileRequestWrapper
>> .getErrors()!=*null*){
>
> I worked and found the bug :) the new version of MultiPartRequestWrapper
> instantiates it's `error` inside it's constructor. So you should rewrite
> above as:
>
> if(fileRequestWrapper!=null && fileRequestWrapper.hasErrors()){

Great! Thanks for finding this, I think we can fix it in 2.5.14, Ej do
you mind opening a ticket in JIRA?


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Yasser Zamani


On 10/13/2017 9:14 AM, Lukasz Lenart wrote:
> I think we can fix it in 2.5.14

That is a bug inside Ej's custom interceptor, I think.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
Hi Yasser, Lukasz,

This is to confirm that the issue with fileSizeError was fixed through
Yasser's suggestion :)


Upon checking our application, most of the functionalities seem to be
working now, except for one page which throws an Error403-- Forbidden
error. We are not able to retrieve any logs in relation to this:

Error 403--Forbidden
From RFC 2068 *Hypertext Transfer Protocol -- HTTP/1.1*:10.4.4 403 Forbidden


struts.xml:

<action name=*"viewMySearchRequest"* method=*"viewMyRequest"* class=
*"com.MyRequestAction"*>

<result name=*"success"* type=*"tiles"*>/viewMySearchRequest</result>

</action>



<action name=*"viewMyRequest"* method=*"viewMyRequest"* class=
*"com.MyRequestAction"*>

<result name=*"success"*>/viewMyRequest.jsp</result>

</action>

tiles.xml:
<definition name="/viewMySearchRequest" extends="baseLayout">
<put-attribute name="title" value="View Request"/>
<put-attribute name="header" value="/jsp/common/headerForApprover.jsp"/>
<put-attribute name="body" value="/jsp/viewMySearchRequest.jsp"/>
</definition>

<definition name="/viewMyRequest" extends="baseLayout">
<put-attribute name="title" value="View Request"/>
<put-attribute name="header" value="/jsp/common/headerForApprover.jsp"/>
<put-attribute name="body" value="/jsp/viewMyRequest.jsp"/>
</definition>


some java snippets (I assume it has something to do with the
imports/implementation given that it is not able to access the page itself):

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;


public class MyRequestAction extends BaseAction implements
ServletRequestAware,ServletResponseAware{
Logger log = new Logger(this.getClass());
HttpServletRequest request;
HttpServletResponse response;
.
.

        *public* String viewMyRequest() *throws* Exception {//My Request
page while clicking view/display icon



               SearchCriteriaVO searchCriteriaVO= constructSearchCriteria();

               MyRequestDelegate myRequestDelegate = *new*
MyRequestDelegate();

               ViewReqDetails = myRequestDelegate.getRequestViewDetails(
searchCriteriaVO);

               ViewReqDetails.setEditApprover(*false*);

               String searchEnabled=request.getParameter("searchEnabled");

               *if*(searchEnabled!=*null*&&searchEnabled.equalsIgnoreCase(
"true")){

               ViewReqDetails.setSearchEnabled(*true*);

               }

               setViewReqDetails(ViewReqDetails);

               request.setAttribute("ViewReqDetails", ViewReqDetails);

               *return*  *SUCCESS*;

        }


public void setServletRequest(HttpServletRequest arg0) {
this.request=arg0;

// TODO Auto-generated method stub

}

public void setServletResponse(HttpServletResponse arg0) {
// TODO Auto-generated method stub
this.response=arg0;
}



Thanks!


On Fri, Oct 13, 2017 at 3:56 PM, Yasser Zamani <[hidden email]>
wrote:

>
>
> On 10/13/2017 9:14 AM, Lukasz Lenart wrote:
> > I think we can fix it in 2.5.14
>
> That is a bug inside Ej's custom interceptor, I think.
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Lukasz Lenart
2017-10-13 11:17 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> Upon checking our application, most of the functionalities seem to be
> working now, except for one page which throws an Error403-- Forbidden
> error. We are not able to retrieve any logs in relation to this:
>
> Error 403--Forbidden
> From RFC 2068 *Hypertext Transfer Protocol -- HTTP/1.1*:10.4.4 403 Forbidden

This seems unrelated to Struts, do you have the exact request? url?


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Ej Magdaluyo
Hi Lukasz,

Can you please clarify what you mean by request url?

I am thinking that it might by either a Struts or a Tiles issue since I
tried replicating the issue on the pre-migrated version and found no
issues. I did extensive check on the logs from our end:

Writing headers for HttpRequest@1726786004 - /TestApp/jsp/
Wrote cookie: JSESSIONID=FKGMZg4Hb34THT5ThzTvvd0TWwmQ6b
tMk2pKG9XZhZmxgvxn0x3D!-324399909; path=/; HttpOnly>
<Response committed. request: 'HttpRequest@1726786004 - /TestApp/jsp/'
response: weblogic.servlet.internal.ServletResponseImpl@38d2[
HTTP/1.1 403 Forbidden
Date: : Fri, 13 Oct 2017 12:56:36 GMT
Content-Length: : 1166
Content-Type: : text/html; charset=UTF-8
X-WebLogic-JVMID: -324399909
Set-Cookie: JSESSIONID=FKGMZg4Hb34THT5ThzTvvd0TWwmQ6b
tMk2pKG9XZhZmxgvxn0x3D!-324399909; path=/; HttpOnly
X-Powered-By: Servlet/2.5 JSP/2.1
]>
 <Servlet execution completed: weblogic.servlet.internal.
ServletStubImpl@d8353e2 - FileServlet class: 'weblogic.servlet.FileServlet'
>
<Servlet execution completed: weblogic.servlet.jsp.JavelinxJSPStub@213159be
- /jsp/viewMyRequest.jsp class: 'jsp_servlet._jsp.__viewmyreq



On Fri, Oct 13, 2017 at 6:16 PM, Lukasz Lenart <[hidden email]>
wrote:

> 2017-10-13 11:17 GMT+02:00 Ej Magdaluyo <[hidden email]>:
> > Upon checking our application, most of the functionalities seem to be
> > working now, except for one page which throws an Error403-- Forbidden
> > error. We are not able to retrieve any logs in relation to this:
> >
> > Error 403--Forbidden
> > From RFC 2068 *Hypertext Transfer Protocol -- HTTP/1.1*:10.4.4 403
> Forbidden
>
> This seems unrelated to Struts, do you have the exact request? url?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading Struts 2.2.3 to 2.3.34

Yasser Zamani
In reply to this post by Ej Magdaluyo


On 10/13/2017 12:47 PM, Ej Magdaluyo wrote:
> <action name=*"viewMyRequest"* method=*"viewMyRequest"* class=
> *"com.MyRequestAction"*>
>
> <result name=*"success"*>/viewMyRequest.jsp</result>
>
> </action>

I have no idea how above works in your previous app!! I guess that is an
another bug in your app. You don't have `/viewMyRequest.jsp` (rather
than `/jsp/viewMyRequest.jsp`) so maybe you get 403 because of this (As
Łukasz correctly mentioned, such fails usually are from the container;
here Jetty). According to context, I think you should rewrite above as
below:

<result name="success" type="tiles">/viewMyRequest</result>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
123