Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Browser's URL with Struts & Tiles

Thread view: 
Antti Nummiaho - 18 Jan 2006 15:39 GMT
I am using struts with tiles for my web application and I am wondering
how should I configure those to get the page url displayed on the
browser instead of the action path.

For example, in struts-config.xml I have:

<action path="/do_something"
       type="foo.SomeAction">
   <forward name="success"
            path="somePage.page"/>
</action>

And in tiles-defs.xml:

<definition name="somePage.page" extends=".mainLayout">
   <put name="pageTitle" value="someTitle" />
   <put name="content"
        value="/WEB-INF/tiles/contents/someContent.jsp"/>
</definition>

When the action do_something is invoked and the page is loaded, the url
that is shown in the browser is .../do_something.do while I would like
it to be something like .../someContent.jsp or .../somePage.page. Is
this possible? I tried putting redirect="true" attribute to the forward
tag, but it had no effect.

Signature

Antti

Raymond DeCampo - 19 Jan 2006 13:42 GMT
> I am using struts with tiles for my web application and I am wondering
> how should I configure those to get the page url displayed on the
[quoted text clipped - 21 lines]
> this possible? I tried putting redirect="true" attribute to the forward
> tag, but it had no effect.

The forwards above all happen on the server, the browser is totally
ignorant of them.  So from the browsers point of view, all it did was
ask for /do_something.do and there is no reason to display anything else.

The moral:  main your actions with the publicly visible URL you want not
the JSP pages.

HTH,
Ray

Signature

This signature intentionally left blank.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.