You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by delbd <de...@oma.be> on 2005/02/23 15:04:39 UTC
how to link to an url stored in actionform?
Hello,
I'm a bit lost with the way am supposed to create a link using informations
stored in the actionform in a JSP page.
I looked at the html:link but it looks like you can only extract the part
after the '?' from the actionForm.
I was thinking about simply using a classical jsp tags after setting my
actionform as a jsp bean using bean:struts but it seems it maps a
DynaActionBean representing the xml fragment of my struts-config.xml. That's
not what i need.
So now am blocked. I have an class which extends ActionForm, this class has a
getter and a setter for a property named 'url'. This ActionForm is prefilled
with datas from an other action and i can't find how to get it back!
To be more precise, the url property contains something like
'/files/section/myfile.pdf' and i need to create a link to
'http://theserver/thewebapp/DAV/files/section/myfile.pdf'
Some help would be usefull, i can't find any doc on how to do it :)
Regards,
--
David Delbecq
Royal Meteorological Institute of Belgium
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to link to an url stored in actionform?
Posted by Erik Weber <er...@mindspring.com>.
delbd wrote:
>But i'd really like to know how
>i am supposed to access my actionform in jsp. Can't find any doc on it. And
>bean:write request the name of the bean to use. It does not seems to default
>to the actionform. So the basic question is simply, where on hell is this
>actionform??
>
>
>
>
I always say "where in hell", but "where on hell" has a certain style to
it. I think I will start using that if you don't mind.
I'm not sure I understand the problem fully, but your ActionForm is
stored in whatever scope and under whatever name you specified for that
Action in struts-config.xml.
If you have name="myForm" and scope="request", then you can access your
form with "${myForm}".
For example:
<c:set var="details" scope="page" value="${myForm.someProperty}"/>
Hope that helps any.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to link to an url stored in actionform?
Posted by Jeff Beal <jb...@gmail.com>.
I've never been completely sure of the answer to this question myself,
so I just took a dive through the source code for
RequestProcessor.processActionForm(). It looks like, by default, it
just stores it as a request-scoped attribute with the name of the
ActionForm itself. You can override this by using the attribute named
'attribute' in your ActionMapping.
-- Jeff
On Wed, 23 Feb 2005 15:39:29 +0100, delbd <de...@oma.be> wrote:
> I could do it using the request (i think so). But i'd really like to know how
> i am supposed to access my actionform in jsp. Can't find any doc on it. And
> bean:write request the name of the bean to use. It does not seems to default
> to the actionform. So the basic question is simply, where on hell is this
> actionform??
>
--
Jeff Beal
Webmedx, Inc.
Pittsburgh, PA USA
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to link to an url stored in actionform?
Posted by delbd <de...@oma.be>.
The URL comes as a result of form filled by user A.
This is then stored in system.
Later, User B show the same form as user A in edit mode.
An additionnal section appear showing the link to the ressource created by A.
As those forms maps datas from a workflow it's quite cumbersome to put all
those datas also as request attributes, not to mention i have to think about
it for each action which leads to the same jsp.
I could do it using the request (i think so). But i'd really like to know how
i am supposed to access my actionform in jsp. Can't find any doc on it. And
bean:write request the name of the bean to use. It does not seems to default
to the actionform. So the basic question is simply, where on hell is this
actionform??
Le Mercredi 23 Février 2005 15:08, Jeff Beal a écrit :
> Is the URL entered by a user or does it come from the system? If it
> comes from the system (as you seem to indicate), I wouldn't store it
> in the ActionForm at all. Store it as a request attribute, then use
> standard methods (JSTL or <bean:write/> or even a scriptlet if you're
> feeling rebellious) to write it out in your JSP page.
>
> -- Jeff
>
> On Wed, 23 Feb 2005 15:04:39 +0100, delbd <de...@oma.be> wrote:
> > So now am blocked. I have an class which extends ActionForm, this class
> > has a getter and a setter for a property named 'url'. This ActionForm is
> > prefilled with datas from an other action and i can't find how to get it
> > back!
--
David Delbecq
Royal Meteorological Institute of Belgium
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to link to an url stored in actionform?
Posted by Jeff Beal <jb...@gmail.com>.
Is the URL entered by a user or does it come from the system? If it
comes from the system (as you seem to indicate), I wouldn't store it
in the ActionForm at all. Store it as a request attribute, then use
standard methods (JSTL or <bean:write/> or even a scriptlet if you're
feeling rebellious) to write it out in your JSP page.
-- Jeff
On Wed, 23 Feb 2005 15:04:39 +0100, delbd <de...@oma.be> wrote:
> So now am blocked. I have an class which extends ActionForm, this class has a
> getter and a setter for a property named 'url'. This ActionForm is prefilled
> with datas from an other action and i can't find how to get it back!
--
Jeff Beal
Webmedx, Inc.
Pittsburgh, PA USA
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org