You should also build your Action using a package so struts/Web Container knows exactly where to look. Do some debugging to see if the Action is actually called at all.


Example struts-config.xml ActionMapping with package


<action
  path="/GetUsersAction"
  type="app.GetUsersAction">
  <forward
    name="ViewUsers"
    path="/Viewusers.jsp"/>
</action>

--Sloan

In a JSP page, I have a link that calls an Action. Usually, this is done
with a submit button within a form, but I need it to be a link. Apparently,
this introduces a problem, since I'm not using a form. Basically, I want to
click a link, execute an Action which puts some object in request scope,
then forward to some results page.

Here's the link:

[ jsp snippet ]
...
<A href="/GetUsersAction.do">List Users</A>

In my struts-cfg.xml, I have

<action path="/GetUsersAction" type="GetUsersAction">
        <forward name="ViewUsers" path="/ViewUsers.jsp"></forward>
</action>

In the GetUsersAction class, I put an object in request scope with
request.setAttribute( "label", myObj ), and then call

return (mapping.findForward("ViewUsers"));

I believe that this Action class is not being called since no log messages
are displayed in the console and myObj is not availabe in the ViewUsers JSP.
However the request is forwarded to the ViewUsers.jsp file. (This part
doesn't make sense.)

Is it possible for me to call an action from a link without a form, or do I
need to use a dummy form? Or do I need to change my stuts-cfg.xml somehow?

Thanks in advance.

Morgan



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Sloan Bowman
www.nashlinux.com
www.q3networks.com
www.aboutgoodlettsville.com
www.spudibby.com
---------------------------
Windows 95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to