You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryce Fischer <br...@berzerker-soft.com> on 2003/10/16 03:54:39 UTC

Struts and Links

I'm crossposting this into the Struts group, as this question may have
to do with me not understanding how to access a Global Forward inside an
<a> tag. Specifically, this deals with DisplayTag. I don't know if I can
use the <html:link> tag there

I'm trying to create a link in my tag that will call a global forward.
I'm using a decorator to create the link.

My Global Forward looks like this:

        <forward 
            name="doGetCostCenter" 
            path="/WEB-INF/pages/getcostcenter.jsp"/>

Currently, my link looks like this:
<a href="doGetCostCenter?id=610380&action=edit">Edit</a>

I've tried it:
doGetCostCenter.do
<full path to app>\doGetCostCenter (with and without the .do)

I see in the FAQ, it mentions using requestURI in the display:table tag.
Does this affect how I would create my value in the Decorator class?

Thanks

-- 
Bryce Fischer <br...@berzerker-soft.com>


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


Re: Struts and Links

Posted by Max Cooper <ma...@maxcooper.com>.
The forward is a forward, not necessarily a request that Struts will know
how to handle when it comes in from the outside (which is what will happen
with a link). With the JSP residing in the WEB-INF subtree, it could not be
served directly anyway.

You probably want to setup a doGetCostCenter action mapping, and use that
for your link instead. Inside that action mapping, you'll want a forward to
the /WEB-INF/pages/getcostcenter.jsp page.

OPTIONAL: If you want to be able to have other actions forward to the
doGetCostCenter action, you could setup a global forward that forwards to a
"/doGetCostCenter.do" path, which will send the request first through the
action and then the doGetCostCenter action will forward to the JSP. You
might want to make that a redirect forward (by setting redirect="true" in
the global forward) so that the URL in the user's browser window will match
the page they see.

-Max


----- Original Message ----- 
From: "Bryce Fischer" <br...@berzerker-soft.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Wednesday, October 15, 2003 6:54 PM
Subject: Struts and Links


> I'm crossposting this into the Struts group, as this question may have
> to do with me not understanding how to access a Global Forward inside an
> <a> tag. Specifically, this deals with DisplayTag. I don't know if I can
> use the <html:link> tag there
>
> I'm trying to create a link in my tag that will call a global forward.
> I'm using a decorator to create the link.
>
> My Global Forward looks like this:
>
>         <forward
>             name="doGetCostCenter"
>             path="/WEB-INF/pages/getcostcenter.jsp"/>
>
> Currently, my link looks like this:
> <a href="doGetCostCenter?id=610380&action=edit">Edit</a>
>
> I've tried it:
> doGetCostCenter.do
> <full path to app>\doGetCostCenter (with and without the .do)
>
> I see in the FAQ, it mentions using requestURI in the display:table tag.
> Does this affect how I would create my value in the Decorator class?
>
> Thanks
>
> -- 
> Bryce Fischer <br...@berzerker-soft.com>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



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