You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2005/09/14 02:58:49 UTC

Re: How to prevent path shows up at the Address box in the browser, IE and others

I'm not sure what you're trying to achieve here. At what point do you 
want the URL to remain hidden? What you have below just controls what 
gets rendered on the HTML page. The address bar will contain the URL 
used to get that page, not the URL to UsersAdministrationPage.jsp, or 
any other link on the page.

On the other hand, when the user clicks any of those links, the browser 
will load the referenced page and *then* the address bar will contain 
the URL of that page. Is this what you want to prevent?

I can only think of two ways to do that:

1) use Javascript instead of a regular href-based link to load the URL 
and replace the current page content with the content loaded from the 
new URL

2) use an enclosing frameset and target the links in your page to a 
frame in that frameset. The address bar will then always show the URL 
for the outer frameset rather than the URLs of whatever pages are loaded 
in the frames.

Of course with option 2 you have all the normal drawbacks of using 
frames, including the inability to bookmark pages.

L.

Kam Lung Leung wrote:
>    
>   Hi,
> 
> I am working on a project that uses Tiles and Structs.
> I have the following Tiles definition;
> <!--  Menu definition -->
>   <definition name="Infra.WebComponemt.AdminMenuItems" path="/Infra/WebComponemt/Layouts/menuLayout.jsp" >
>           <put name="title" value="User Administration Menu" />
>           <putList name="items" >
>                <item value="Home”  link="/WebComponemt/Presentation/index.jsp"  />
>                <item value="User Administration" link="/WebComponemt/Presentation/UsersAdministrationPage.jsp" />
>          </putList>
>   </definition>
> 
> What can I do to prevent the path of the UsersAdministrationPage.jsp and
> the index.jsp files show up in the Address box of a browser. Would the
> following step help preventing the path of the UsersAdministrationPage.jsp
> to show up?
> 
> <!—Rewrited Menu definition -->
>   <definition name="Infra.WebComponemt.AdminMenuItems" path="/Infra/WebComponemt/Layouts/menuLayout.jsp" >
>           <put name="title" value="User Administration Menu" />
>           <putList name="items" >
>                <item value="Home”  link="index"  />
>                <item value="User Administration" link="UsersAdministrationPage" />
>          </putList>
>   </definition>
> 
> Add a Global Forward in the structs-config.xml file like below:
> <struts-config>
>        <!-- ====   Global Forward Definitions ============= -->
>        <global-forwards>
>               <forward   name="index"    path="/WebComponemt/Presentation/index.jsp.do"/>
>             <forward   name=" UsersAdministrationPage " path="/WebComponemt/Presentation/UsersAdministrationPage.jsp"/>
>        </global-forwards>
> </struts-config>
> 
> Any suggestion is greatly appreciated.
> Kam Lung Leung
> kleung@advoicetech.com


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