You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by denis gautier <de...@laposte.net> on 2001/07/09 15:09:27 UTC

Coding paths always from the same perspective ?

I'm often confused about the way I should code the paths in my 
Struts application.
I'm trying to write a Struts example application for reuse in 
my company.
I've got problems about URL resolving (relative, absolute, ...)
when using framesets along with jsp and other html files.
Is there a way to code paths always from the same perspective 
(preferently from the application root) ?
Should I avoid html and framesets (and use templates instead) ?
Are the struts tags (everywhere) THE solution ?
(I can't find clear rules for coding about all that...)
Thanks in advance for your help.
Denis.



Re: Coding paths always from the same perspective ?

Posted by Ted Husted <hu...@apache.org>.
The Struts html:link tag offers three distinct advantages 

1) It URL encodes the link to retain the actor's session as needed

2) If global forwards are used for all entry points, then different
installations of the application can use different servlet paths
(/do/action versus /action.do).

3) Links to global forwards can be managed through the struts-config

If you need to maintain the session, then yes, use Struts links
everywhere (or URL-encode the others yourself ;-).

If you want to change between prefix and suffix matching later (/do/
versus .do), then yes, use Struts links and global forwards everywhere.

If not, then it's a matter of whether you would like to manage the
target of the links through the struts-config.

My suggestion would be to define global forwards for all your entry
points, and then use those whereever you would use a standard <a href=
..> link. (An entry point being the target of any hyperlink.)

Templates can be a good alternative to framesets, though you should be
able to use the Struts html:link tag with framesets too.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


denis gautier wrote:
> 
> I'm often confused about the way I should code the paths in my
> Struts application.
> I'm trying to write a Struts example application for reuse in
> my company.
> I've got problems about URL resolving (relative, absolute, ...)
> when using framesets along with jsp and other html files.
> Is there a way to code paths always from the same perspective
> (preferently from the application root) ?
> Should I avoid html and framesets (and use templates instead) ?
> Are the struts tags (everywhere) THE solution ?
> (I can't find clear rules for coding about all that...)
> Thanks in advance for your help.
> Denis.