See intermixed.
Cedric "Struts Newsgroup (@Basebeans.com)" wrote: > Subject: How do I use Tiles w/ iFrame > From: "Matt Raible" <[EMAIL PROTECTED]> > === > Simple Scenario: > --------------------------------------------- > > I want to define a template (layout.jsp) that contains an iframe. > > <layout.jsp> > <iframe src="<tiles:getAsString name="page"/>" id="window" > frameborder="0"></iframe> > </layout.jsp> > > <tile-config.xml> > <definition name="login" extends="/layout.jsp"> > <put name="title.key" value="login.title"/> > <put name="heading.key" value="login.heading"/> > <put name="page" value="/pages/login.jsp"/> > </definition> > </tiles-config.xml> > > Question: I haven't been able to do with without specifying the context as > a prefix for the page URL - I have to put /context/pages/login.jsp for the > "page" value. Is there a way to get around putting the context in there? There is no way to put "dynamically" the context path in a definition declared in the xml file. Solutions to this situations are : * hard code the context in the xml file. Not very nice, and will cause trouble when your context will change. * Add context when you retrieve the path in the jsp : <iframe src="<%=request.getContextPath()%>/<tiles:getAsStringname="page"/>" ...> > > > More Complicated Scenario: > --------------------------------------------- > Ideally, I'd like to use the model above, but have the page value reference > a URL to another definition. > > <put name="page" value="another.def"/> > > Where another.def extends a different layout. > > Question: Is this possible? When I tried value="another.def", it inserted > the actual page HTML after <iframe src= > It is not clear to me what you are really trying to do ... > > Real Complicated Scenario: > --------------------------------------------- > No answer really needed on this one... > > What I'm trying to accomplish is that a user will login to the application, > and at this point I will set a cookie based on their role. Their role > determines which sub-application they are routed too. The sub-applications > have different layouts. > > When a user returns to the site after logging in the first time, I want to > skin the login page with the look/feel of the sub-application. Here is my > login.jsp at this point (This file is referenced for form-based > authentication) > > <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %> > > <tiles:insert definition="login" flush="true" /> > > I plan to do some cookie checking to swich the definition from login to a > sub-app login definition. > > Does this sound reasonable? Or should I just attempt to use CSS and > positioning to change the look and feel? The problem I have is that one > sub-app uses the layout with the iframe, so the user gets the feeling that > they are never leaving the page. As an example, here is a prototype, where > "This is a simple HTML page" is a separate page that will use a different > layout. > > http://raibledesigns.com/onpoint/interface.html > > The outer layout with the image will probably only have a couple > definitions - 1 for the login, and 1 for a JSP/Servlet that renders dynamic > pages based on other information. Have you check new examples coming with Tiles, especially the "dynamic skin layout" ? http://localhost:8080/tiles-doc/examples/mySkinSettings.do > > > I'm probably just blabbing cause I'm tired, but when you're a team of one, > some times you just need to get this stuff in writing. > > Thanks, > > Matt > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>