You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Smoak <We...@asu.edu> on 2002/11/26 19:30:10 UTC

[tiles] More tiles questions

Finally!  I have a tabbed tiles page working.  Sort of... 

I go to http://host/dev/testAction.do and I see that URL with my brand new
tabbed page with the first tab selected.  Then I click the second tab, and
it tries to go to this URL:

http://host/dev/WEB-INF/jsp/tilesTest/tabsTest.jsp?selected=1

The 'jsp under WEB-INF' thing is popping up again!  I'm stuck.  

I think the tabbed links should go back to the Action.  In my case, I want
to do a "Person Profile" with tabs.  It will come up with name and address
on the first tab.  When the user clicks, say, the "Employment History" tab,
I will need to talk to the database and put some beans in scope to be
displayed.

(In addition, I need to do some verification because not all of the users
will be allowed to see data on all of the tabs.  But I'd be happy at present
if *I* could just see all of them. :)

I'm not quite sure where I've gone wrong, so I would appreciate any hints or
advice you can offer.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

RE: [tiles] More tiles questions

Posted by James Mitchell <jm...@telocity.com>.
You probably already know this, but:

1. You cannot redirect if the jsp are under /WEB-INF, you ONLY forward
2. You must always go through an action (do not link from one jsp to another)
3. Make sure when you link or post to an action, that you do so with '/' as the
   first character for your action, if you don't, then you could potentially
   get: 1) a 'growing' URL
         or
        2) incorrect path to your *.do


<html:base/> can screw you up....

Consider this ( #1 ):
(Not using <html:base/>)

<html:link page="items/displayItem.do?foo=bar">Display</html:link>

So you click on it and you see this in the address bar:

 http://www.mydomain.com/items/displayItem.do?foo=bar

ok, now if that same link is on the page, click it again:

  http://www.mydomain.com/items/items/displayItem.do?foo=bar
                          ^^^^^

see what happens?




( #2 )
Now if you had used <html:base/> then your link would do this:
 (assuming jsp is at /WEB-INF/jsp/)

 http://www.mydomain.com/WEB-INF/jsp/items/displayItem.do?foo=bar



Since you are using jsp under /WEB-INF, I would not use <html:base/> unless
you are sure that all client side references (images, css, js, etc) are
using to the correct url.

Hope that helps you.

--
James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"If you were plowing a field, which would you rather use? Two strong oxen or
1024 chickens?"
- Seymour Cray (1925-1996), father of supercomputing


> -----Original Message-----
> From: Wendy Smoak [mailto:Wendy.Smoak@asu.edu]
> Sent: Tuesday, November 26, 2002 1:30 PM
> To: Struts Users Mailing List (E-mail)
> Subject: [tiles] More tiles questions
>
>
>
> Finally!  I have a tabbed tiles page working.  Sort of...
>
> I go to http://host/dev/testAction.do and I see that URL with my brand new
> tabbed page with the first tab selected.  Then I click the second tab, and
> it tries to go to this URL:
>
> http://host/dev/WEB-INF/jsp/tilesTest/tabsTest.jsp?selected=1
>
> The 'jsp under WEB-INF' thing is popping up again!  I'm stuck.
>
> I think the tabbed links should go back to the Action.  In my case, I want
> to do a "Person Profile" with tabs.  It will come up with name and address
> on the first tab.  When the user clicks, say, the "Employment History" tab,
> I will need to talk to the database and put some beans in scope to be
> displayed.
>
> (In addition, I need to do some verification because not all of the users
> will be allowed to see data on all of the tabs.  But I'd be happy at present
> if *I* could just see all of them. :)
>
> I'm not quite sure where I've gone wrong, so I would appreciate any hints or
> advice you can offer.
>
> --
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>