J
Joerg Gippert
Joerg Gippert said:Hello everyone!
Ok, found the mistake. Just replying to myselfe, in case someone else runs
in to the same mistake and does a Google search on that topic. Here´s what I
did wrong:
Using the following line in the global-fowards section, will cause Struts to
look for an action whose path is 'ShowItemDetAction':
<forward name="showdetails" contextRelative="true"
path="/ShowItemDetAction.do" redirect="true"/>
Thus, I added an action mapping that looks like this:
<action path="/ShowItemDetAction"
type="com.mycompany.struts.action.ShowItemDetAction"></action>
The JSP still looks like this:
<html:link forward="showdetails" paramId="iid" paramName="ITEMS"
paramProperty="itemid">
<bean:write name="ITEMS" property="itemid" />
<bean:write name="ITEMS" property="name" />
</html:link>
which produces an output of links like: http://127.0.0.1/myapp/test.do?iid=6
Clicking on that link envokes the actionservlet 'ShowItemDetAction'. The
parameter 'iid' can be accessed by something like:
String iids[] = request.getParameterValues("iid");
String id = iids[0]; //id would be '6' according to link stated above
Make sure to catch an empty array.
Regards,
Joerg