You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Himstedt, Maik (EXTERN: T-Systems on)" <ex...@volkswagen.de> on 2009/09/04 17:55:15 UTC

Calling Struts action from JSP outside WEB-INF folder

Hi everybody,

I need to call a Struts action (we use Struts 1.3) from a JSP but I keep getting an "Cannot retrieve mapping for action: "/maEdit" error. The JSP looks like 

<html:form action="/maEdit" method="post" target="_self">
...
the struts-config looks like

<action path="/maEdit" type="de.volkswagen.ipad.aip.action.MaEditAction" name="maEditForm" parameter="method" scope="session" validate="false">

The main problem is the web project's structure. We habe a Web Content folder, underneath WEB-INF and a folder called protected which basically holds all JSPs (don't ask me who had this bright idea...). The full path to my JSP goes like protected/processes/aip/ma/myPage.jsp where myPage.jsp is the JSP in question. I thought I could navigate to the Struts action like 

<html:form action="../../../../maEdit" method="post" target="_self">

but the error remains. Is it possible at all?

Mit freundlichen Grüßen


Maik Himstedt

T-Systems on site services GmbH
Procurement Systems
Telefon/phone: +49-5361-9-44026
E-Mail: extern.maik.himstedt@volkswagen.de
--------------------------------------------------------------------------------

Maik Himstedt
Consultant
Benzstraße 25a, 38446 Wolfsburg
+49-5361-464 78-0 (Tel.)
+49-5361-464 78-10 (Fax)
E-Mail: maik.himstedt@t-systems.com
Internet: http://www.t-systems-onsite.de 

Geschäftsführung: Stefan Kappe, Thomas Müller-Braun
Handelsregister: Amtsgericht Berlin HRB 51336
Sitz der Gesellschaft: Berlin

Re: Calling Struts action from JSP outside WEB-INF folder

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Maik,
typical action and result config for struts is like this:

<action input=""
		name="customerForm"
		path="/customerWrapper"
		type="com.pi.eplatform.suirz.user.action.CustomerWrapperAction">
				<forward name="view"
						 path="/WEB-INF/pages/user/customer/customerView.jsp"/>
				<forward name="viewList"
						 path="/user/customer/customerList.jsp"/>
</action>

and if You will enter http://localhost:8080/customerWrapper.do in my
browser it will fire this action and result one of the results defined
abowe.
Now i don't fully understand what your problem is. If You submit Your
form You are having this exception? If so it means that there is
something wrong with action mapping. Also it might be ok but You could
add it when server was running and didn't restart it after so that
changes got rereaded.
As for your mapping it looks ok and it should work.

Best greetings,
Paweł Wielgus.



2009/9/4 Himstedt, Maik (EXTERN: T-Systems on)
<ex...@volkswagen.de>:
> Hi everybody,
>
> I need to call a Struts action (we use Struts 1.3) from a JSP but I keep getting an "Cannot retrieve mapping for action: "/maEdit" error. The JSP looks like
>
> <html:form action="/maEdit" method="post" target="_self">
> ...
> the struts-config looks like
>
> <action path="/maEdit" type="de.volkswagen.ipad.aip.action.MaEditAction" name="maEditForm" parameter="method" scope="session" validate="false">
>
> The main problem is the web project's structure. We habe a Web Content folder, underneath WEB-INF and a folder called protected which basically holds all JSPs (don't ask me who had this bright idea...). The full path to my JSP goes like protected/processes/aip/ma/myPage.jsp where myPage.jsp is the JSP in question. I thought I could navigate to the Struts action like
>
> <html:form action="../../../../maEdit" method="post" target="_self">
>
> but the error remains. Is it possible at all?
>
> Mit freundlichen Grüßen
>
>
> Maik Himstedt
>
> T-Systems on site services GmbH
> Procurement Systems
> Telefon/phone: +49-5361-9-44026
> E-Mail: extern.maik.himstedt@volkswagen.de
> --------------------------------------------------------------------------------
>
> Maik Himstedt
> Consultant
> Benzstraße 25a, 38446 Wolfsburg
> +49-5361-464 78-0 (Tel.)
> +49-5361-464 78-10 (Fax)
> E-Mail: maik.himstedt@t-systems.com
> Internet: http://www.t-systems-onsite.de
>
> Geschäftsführung: Stefan Kappe, Thomas Müller-Braun
> Handelsregister: Amtsgericht Berlin HRB 51336
> Sitz der Gesellschaft: Berlin
>

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