Struts 7: error when "s:action" is used on jsp page and jsp is invoked directly in browser

Wolfgang Knauf <[email protected]>
Newsgroups gmane.comp.jakarta.struts.user
Message-ID <trinity-8361390b-76e9-4faa-a8f7-c6ec0a1cef6a-1729343907227@trinity-msg-rest-gmx-gmx-live-55bf474946-zlmlf>
I have a "index.jsp" and invoke an action using "s:action" tag, then render data from this action. In the browser I navigate to this jsp direcly ("http://localhost/index.jsp" instead of browsing to ".../index.action").

Snippet from my JSP:

<s:action name="myAction" var="myActionResult">


  ...
  <s:iterator value="#myActionResult.items">
      </s:iterator><table><tbody>
    <tr>
        <td>
          <s:property value="a">
        </s:property></td>
        <td>
          <s:property value="b">
        </s:property></td>
        <td>
          <s:property value="c">
        </s:property></td>
      </tr>

  </tbody>
</table>


This works with Struts 2. But when migrating this to Struts 7M7, this error is reported:


15:02:27,233 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /Struts7Sample/: org.apache.jasper.JasperException: java.lang.NullPointerException: Cannot invoke "com.opensymphony.xwork2.ActionInvocation.getProxy()" because "invocation" is null
	at [email protected]//org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:461)
	at [email protected]//org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
	at [email protected]//org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
	at [email protected]//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at [email protected]//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
	at deployment.Struts7Sample.war//org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.handleRequest(StrutsPrepareAndExecuteFilter.java:160)
	at deployment.Struts7Sample.war//org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.tryHandleRequest(StrutsPrepareAndExecuteFilter.java:146)
	at deployment.Struts7Sample.war//org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:134)
	at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at [email protected]//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
	at [email protected]//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
	at [email protected]//io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
	at [email protected]//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
	at [email protected]//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at [email protected]//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68)
	at [email protected]//org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103)
	at [email protected]//org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161)
	at [email protected]//org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73)
	at [email protected]//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67)
	at [email protected]//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
	at [email protected]//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
	at [email protected]//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at [email protected]//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
	at [email protected]//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
	at [email protected]//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
	at org.wildfly.security.elytron-web.undertow-server-servlet@4.1.0.Final//org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38)
	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at [email protected]//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:44)
	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at [email protected]//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:51)
	at [email protected]//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276)
	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132)
	at [email protected]//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
	at [email protected]//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421)
	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421)
	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421)
	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421)
	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256)
	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101)
	at [email protected]//io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
	at [email protected]//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
	at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
	at [email protected]//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
	at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.lang.NullPointerException: Cannot invoke "com.opensymphony.xwork2.ActionInvocation.getProxy()" because "invocation" is null
	at deployment.Struts7Sample.war//org.apache.struts2.components.Component.getNamespace(Component.java:448)
	at deployment.Struts7Sample.war//org.apache.struts2.components.ActionComponent.executeAction(ActionComponent.java:252)
	at deployment.Struts7Sample.war//org.apache.struts2.components.ActionComponent.end(ActionComponent.java:166)
	at deployment.Struts7Sample.war//org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:39)
	at org.apache.jsp.index_jsp._jspx_meth_s_005faction_005f0(index_jsp.java:171)
	at org.apache.jsp.index_jsp._jspService(index_jsp.java:116)
	at [email protected]//org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at [email protected]//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at [email protected]//org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:422)
	... 53 more




It works if I navigate to "index.action".

Is this intended behavior or a regression? As you can see, I use a WildFly server (WildFly 26 for Struts 2, WildFly 33 for Struts 7)

I can provide full samples for Struts2 and Struts7 if necessary.


Best regards

Wolfgang</s:action>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.