struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Johansson <>
Subject How to import a struts 2 action into a jsp?
Date Thu, 24 Sep 2009 09:18:29 GMT

I am new to Struts and want to import a Struts 2 action into a jsp by
jstl import:
  	<c:import url="/HelloWorld_input.action" />
But neither Tomcat nor Jboss seem to like this - but gives the reply:
Importing /HelloWorld_input.action: The requested resource
(/HelloImport/HelloWorld_input.action) is not available

Using c:import does not seem to trigger the processing of the struts
filter dispatcher.

If I import via an intermediate jsp instead, it works:
<c:import url="/hello.jsp" />

With hello.jsp:
        <form action="/HelloImport/HelloWorld.action" >
            <input type="text" name="userName" />
            <input type="submit" />

And struts.xml:
    <package name="default" extends="struts-default">
        <action name="HelloWorld_input" >
        <action name="HelloWorld" class="test.HelloWorld">
            <result >/success.jsp</result>

With Struts you should never access jsp:s directly, but always work
with actions.
Is there any trick to import a Struts 2 action directly into a JSP?

/Best regards, Per Johansson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message