You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Kyser <kt...@comcast.net> on 2003/06/20 06:40:56 UTC

A question on Tiles and Frames

Hello,

I was trying to use a Tile Definition like:

     <definition name="associator.masterPage"
                 path="/WEB-INF/pages/tiles/framesetLayout.jsp">
         <put name="title"   value="Associator" />
         <put name="heading" value="/WEB-INF/pages/tiles/heading.jsp" />
         <put name="code"    value="/WEB-INF/pages/tiles/emptyMenu.jsp" 
/>
         <put name="menu"    value="/WEB-INF/pages/menu.jsp" />
         <put name="button"  value="/WEB-INF/pages/button.jsp"/>
         <put name="text"    value="/WEB-INF/pages/categories.jsp"/>
     </definition>

with a framesetLayout.jsp that looks like:

<frameset rows="137,*" frameborder="NO" border="0" framespacing="0">
     <frame src="<%=request.getContextPath()%><tiles:getAsString 
name="heading" />" name="heading" scrolling="NO" noresize>
     <frameset cols="217,*" frameborder="NO" border="0" framespacing="0">
         <frameset rows="0,*" frameborder="NO" border="0" 
framespacing="0">
             <frame src="<%=request.getContextPath()%><tiles:getAsString 
name="code" />"   name="code">
	        <frame src="<%=request.getContextPath()%><tiles:getAsString 
name="menu" />"   name="menu">
	    </frameset>
         <frameset rows="26%,*" frameborder="0" border="0" 
framespacing="5" cols="*">
             <frame src="<%=request.getContextPath()%><tiles:getAsString 
name="button" />" name="button" noresize/>
             <frame src="<%=request.getContextPath()%><tiles:getAsString 
name="text" />"   name="text" noresize/>
         </frameset>
     </frameset>
</frameset>

but I get Forbidden errors, presumably because my JSPs are beneath the 
WEB-INF directory and
therefore not accessible.

Is there an alternate way to do this and still have my JSPs underneath 
WEB-INF?

(Basically, I have a frames-based layout with a scrollable panel, and 
am trying
to figure out how to best implement that feature using Struts/Tiles 
without exposing all
my JSPs.

TIA,

-jeff 


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


Re: A question on Tiles and Frames

Posted by Jeff Kyser <kt...@comcast.net>.
Okay. So is there *another* way to implement
independently scrollable content within a region of a page using Struts  
and Tiles?

-jeff

On Friday, June 20, 2003, at 07:17  AM, Cedric Dumoulin wrote:

>
>  The page of a frame should alway be publicly accessible. It is alway  
> possible to access it directly without the other associated frames.  
> So, you can't hide them.
>
>    Cedric
>
>   Cedric
>
> Jeff Kyser wrote:
>
>> Hey Cedric,
>>
>> Thanks for the response. I guess I'd figured out I couldn't put them
>> under WEB-INF for the reasons you stated. So how can I implement
>> a scollable region such as a frame might offer and still use Tiles and
>> stay with some of the 'best practices' recommended for Struts
>> development such as hiding your JSPs under WEB-INF? I suppose
>> it gets off-topic, but surely there must be a way to have  
>> independently
>> scrolled regions of a web page in a Struts environment without
>> making every page publicly accessible?
>>
>> thanks, I'd sure like some insight as to how to proceed...
>>
>> -jeff
>>
>>>  Hi,
>>>
>>>  Each frame of a frameset is filled with a web page. Each one issue  
>>> an independent http request to the web server. So each page  
>>> corresponding to a frame should be publicly accessible on the web  
>>> server, and can't be under WEB-INF.
>>>
>>>   Cedric
>>
>>
>>
>>> but I get Forbidden errors, presumably because my JSPs are beneath  
>>> the WEB-INF directory and
>>>
>>>> therefore not accessible.
>>>>
>>>> Is there an alternate way to do this and still have my JSPs  
>>>> underneath WEB-INF?
>>>>
>>>> (Basically, I have a frames-based layout with a scrollable panel,  
>>>> and am trying
>>>> to figure out how to best implement that feature using Struts/Tiles  
>>>> without exposing all
>>>> my JSPs.
>>>>
>>>> TIA,
>>>>
>>>> -jeff
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: A question on Tiles and Frames

Posted by Cedric Dumoulin <ce...@apache.org>.
  The page of a frame should alway be publicly accessible. It is alway 
possible to access it directly without the other associated frames. So, 
you can't hide them.

    Cedric

   Cedric

Jeff Kyser wrote:

> Hey Cedric,
>
> Thanks for the response. I guess I'd figured out I couldn't put them
> under WEB-INF for the reasons you stated. So how can I implement
> a scollable region such as a frame might offer and still use Tiles and
> stay with some of the 'best practices' recommended for Struts
> development such as hiding your JSPs under WEB-INF? I suppose
> it gets off-topic, but surely there must be a way to have independently
> scrolled regions of a web page in a Struts environment without
> making every page publicly accessible?
>
> thanks, I'd sure like some insight as to how to proceed...
>
> -jeff
>
>>  Hi,
>>
>>  Each frame of a frameset is filled with a web page. Each one issue 
>> an independent http request to the web server. So each page 
>> corresponding to a frame should be publicly accessible on the web 
>> server, and can't be under WEB-INF.
>>
>>   Cedric
>
>
>
>> but I get Forbidden errors, presumably because my JSPs are beneath 
>> the WEB-INF directory and
>>
>>> therefore not accessible.
>>>
>>> Is there an alternate way to do this and still have my JSPs 
>>> underneath WEB-INF?
>>>
>>> (Basically, I have a frames-based layout with a scrollable panel, 
>>> and am trying
>>> to figure out how to best implement that feature using Struts/Tiles 
>>> without exposing all
>>> my JSPs.
>>>
>>> TIA,
>>>
>>> -jeff
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Re: A question on Tiles and Frames

Posted by Jeff Kyser <kt...@comcast.net>.
Hey Cedric,

Thanks for the response. I guess I'd figured out I couldn't put them
under WEB-INF for the reasons you stated. So how can I implement
a scollable region such as a frame might offer and still use Tiles and
stay with some of the 'best practices' recommended for Struts
development such as hiding your JSPs under WEB-INF? I suppose
it gets off-topic, but surely there must be a way to have independently
scrolled regions of a web page in a Struts environment without
making every page publicly accessible?

thanks, I'd sure like some insight as to how to proceed...

-jeff

>  Hi,
>
>  Each frame of a frameset is filled with a web page. Each one issue an 
> independent http request to the web server. So each page corresponding 
> to a frame should be publicly accessible on the web server, and can't 
> be under WEB-INF.
>
>   Cedric


> but I get Forbidden errors, presumably because my JSPs are beneath the 
> WEB-INF directory and
>> therefore not accessible.
>>
>> Is there an alternate way to do this and still have my JSPs 
>> underneath WEB-INF?
>>
>> (Basically, I have a frames-based layout with a scrollable panel, and 
>> am trying
>> to figure out how to best implement that feature using Struts/Tiles 
>> without exposing all
>> my JSPs.
>>
>> TIA,
>>
>> -jeff
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: A question on Tiles and Frames

Posted by Cedric Dumoulin <ce...@apache.org>.
  Hi,

  Each frame of a frameset is filled with a web page. Each one issue an 
independent http request to the web server. So each page corresponding 
to a frame should be publicly accessible on the web server, and can't be 
under WEB-INF.

   Cedric

Jeff Kyser wrote:

> Hello,
>
> I was trying to use a Tile Definition like:
>
>     <definition name="associator.masterPage"
>                 path="/WEB-INF/pages/tiles/framesetLayout.jsp">
>         <put name="title"   value="Associator" />
>         <put name="heading" value="/WEB-INF/pages/tiles/heading.jsp" />
>         <put name="code"    value="/WEB-INF/pages/tiles/emptyMenu.jsp" />
>         <put name="menu"    value="/WEB-INF/pages/menu.jsp" />
>         <put name="button"  value="/WEB-INF/pages/button.jsp"/>
>         <put name="text"    value="/WEB-INF/pages/categories.jsp"/>
>     </definition>
>
> with a framesetLayout.jsp that looks like:
>
> <frameset rows="137,*" frameborder="NO" border="0" framespacing="0">
>     <frame src="<%=request.getContextPath()%><tiles:getAsString 
> name="heading" />" name="heading" scrolling="NO" noresize>
>     <frameset cols="217,*" frameborder="NO" border="0" framespacing="0">
>         <frameset rows="0,*" frameborder="NO" border="0" 
> framespacing="0">
>             <frame 
> src="<%=request.getContextPath()%><tiles:getAsString name="code" />"   
> name="code">
>             <frame 
> src="<%=request.getContextPath()%><tiles:getAsString name="menu" />"   
> name="menu">
>         </frameset>
>         <frameset rows="26%,*" frameborder="0" border="0" 
> framespacing="5" cols="*">
>             <frame 
> src="<%=request.getContextPath()%><tiles:getAsString name="button" />" 
> name="button" noresize/>
>             <frame 
> src="<%=request.getContextPath()%><tiles:getAsString name="text" />"   
> name="text" noresize/>
>         </frameset>
>     </frameset>
> </frameset>
>
> but I get Forbidden errors, presumably because my JSPs are beneath the 
> WEB-INF directory and
> therefore not accessible.
>
> Is there an alternate way to do this and still have my JSPs underneath 
> WEB-INF?
>
> (Basically, I have a frames-based layout with a scrollable panel, and 
> am trying
> to figure out how to best implement that feature using Struts/Tiles 
> without exposing all
> my JSPs.
>
> TIA,
>
> -jeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Re: A question on Tiles and Frames

Posted by Jeff Kyser <kt...@comcast.net>.
Hey Jason,

Thanks for putting in the time on a great reply! At this point,
am cautiously optimistic that this will work, or rather that I
can get it to work.  I've got a few frames updating, so it looks
like that's just the ticket. Thanks again!

-jeff

On Friday, June 20, 2003, at 09:17  AM, Jason Lea wrote:

> If you want to use frames then each frame is going to issue it's own 
> request.  If you want to hide the JSPs under WEB-INF, then you have to 
> front each request with an action because you can't link to the JSP 
> directly.
>
> It probably means replacing your definition with:
>
> <definition name="associator.masterPage"
>          path="/WEB-INF/pages/tiles/framesetLayout.jsp">
>         <put name="title"   value="Associator" />
>         <put name="heading" value="/Heading.do" />
>         <put name="code"    value="/EmptyMenu.do" />
>         <put name="menu"    value="/Menu.do" />
>         <put name="button"  value="/Button.do"/>
>         <put name="text"    value="/Categories.do"/>
> </definition>
>
> and adding an action mapping to struts-config.xml for each of the 
> items:
>
> <action path="/Heading"
>         type="org.apache.struts.actions.ForwardAction"
>         parameter="associator.masterPage.heading"/>
>
> and then another definition in tiles-def.xml:
>
> <definition name="associator.masterPage.heading"
>         path="/WEB-INF/pages/tiles/heading.jsp">
>
> Have to repeat that for code, menu, button, text.  So then if a real 
> action wanted to change both code and menu frames, you can create a 
> definition that extends the first definition:
>
> <definition name="associator.masterPage.newpage"
>         extends="associator.masterPage">
>         <put name="title"   value="New Definition" />
>         <put name="code"    value="/NewCodePage.do" />
>         <put name="menu"    value="/NewMenu.do" />
> </definition>
>
>
> I'm not sure if this will work - as it is 2am here and I am about to 
> go to bed :)  But it looks ok to my half-closed eyes
>
>
> Jeff Kyser wrote:
>> Hello,
>> I was trying to use a Tile Definition like:
>>     <definition name="associator.masterPage"
>>                 path="/WEB-INF/pages/tiles/framesetLayout.jsp">
>>         <put name="title"   value="Associator" />
>>         <put name="heading" value="/WEB-INF/pages/tiles/heading.jsp" 
>> />
>>         <put name="code"    
>> value="/WEB-INF/pages/tiles/emptyMenu.jsp" />
>>         <put name="menu"    value="/WEB-INF/pages/menu.jsp" />
>>         <put name="button"  value="/WEB-INF/pages/button.jsp"/>
>>         <put name="text"    value="/WEB-INF/pages/categories.jsp"/>
>>     </definition>
>> with a framesetLayout.jsp that looks like:
>> <frameset rows="137,*" frameborder="NO" border="0" framespacing="0">
>>     <frame src="<%=request.getContextPath()%><tiles:getAsString 
>> name="heading" />" name="heading" scrolling="NO" noresize>
>>     <frameset cols="217,*" frameborder="NO" border="0" 
>> framespacing="0">
>>         <frameset rows="0,*" frameborder="NO" border="0" 
>> framespacing="0">
>>             <frame 
>> src="<%=request.getContextPath()%><tiles:getAsString name="code" />"  
>>  name="code">
>>             <frame 
>> src="<%=request.getContextPath()%><tiles:getAsString name="menu" />"  
>>  name="menu">
>>         </frameset>
>>         <frameset rows="26%,*" frameborder="0" border="0" 
>> framespacing="5" cols="*">
>>             <frame 
>> src="<%=request.getContextPath()%><tiles:getAsString name="button" 
>> />" name="button" noresize/>
>>             <frame 
>> src="<%=request.getContextPath()%><tiles:getAsString name="text" />"  
>>  name="text" noresize/>
>>         </frameset>
>>     </frameset>
>> </frameset>
>> but I get Forbidden errors, presumably because my JSPs are beneath 
>> the WEB-INF directory and
>> therefore not accessible.
>> Is there an alternate way to do this and still have my JSPs 
>> underneath WEB-INF?
>> (Basically, I have a frames-based layout with a scrollable panel, and 
>> am trying
>> to figure out how to best implement that feature using Struts/Tiles 
>> without exposing all
>> my JSPs.
>> TIA,
>> -jeff
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> -- 
> Jason Lea
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: A question on Tiles and Frames

Posted by Jason Lea <ja...@kumachan.net.nz>.
If you want to use frames then each frame is going to issue it's own 
request.  If you want to hide the JSPs under WEB-INF, then you have to 
front each request with an action because you can't link to the JSP 
directly.

It probably means replacing your definition with:

<definition name="associator.masterPage"
          path="/WEB-INF/pages/tiles/framesetLayout.jsp">
         <put name="title"   value="Associator" />
         <put name="heading" value="/Heading.do" />
         <put name="code"    value="/EmptyMenu.do" />
         <put name="menu"    value="/Menu.do" />
         <put name="button"  value="/Button.do"/>
         <put name="text"    value="/Categories.do"/>
</definition>

and adding an action mapping to struts-config.xml for each of the items:

<action path="/Heading"
         type="org.apache.struts.actions.ForwardAction"
         parameter="associator.masterPage.heading"/>

and then another definition in tiles-def.xml:

<definition name="associator.masterPage.heading"
         path="/WEB-INF/pages/tiles/heading.jsp">

Have to repeat that for code, menu, button, text.  So then if a real 
action wanted to change both code and menu frames, you can create a 
definition that extends the first definition:

<definition name="associator.masterPage.newpage"
         extends="associator.masterPage">
         <put name="title"   value="New Definition" />
         <put name="code"    value="/NewCodePage.do" />
         <put name="menu"    value="/NewMenu.do" />
</definition>


I'm not sure if this will work - as it is 2am here and I am about to go 
to bed :)  But it looks ok to my half-closed eyes


Jeff Kyser wrote:
> Hello,
> 
> I was trying to use a Tile Definition like:
> 
>     <definition name="associator.masterPage"
>                 path="/WEB-INF/pages/tiles/framesetLayout.jsp">
>         <put name="title"   value="Associator" />
>         <put name="heading" value="/WEB-INF/pages/tiles/heading.jsp" />
>         <put name="code"    value="/WEB-INF/pages/tiles/emptyMenu.jsp" />
>         <put name="menu"    value="/WEB-INF/pages/menu.jsp" />
>         <put name="button"  value="/WEB-INF/pages/button.jsp"/>
>         <put name="text"    value="/WEB-INF/pages/categories.jsp"/>
>     </definition>
> 
> with a framesetLayout.jsp that looks like:
> 
> <frameset rows="137,*" frameborder="NO" border="0" framespacing="0">
>     <frame src="<%=request.getContextPath()%><tiles:getAsString 
> name="heading" />" name="heading" scrolling="NO" noresize>
>     <frameset cols="217,*" frameborder="NO" border="0" framespacing="0">
>         <frameset rows="0,*" frameborder="NO" border="0" framespacing="0">
>             <frame src="<%=request.getContextPath()%><tiles:getAsString 
> name="code" />"   name="code">
>             <frame src="<%=request.getContextPath()%><tiles:getAsString 
> name="menu" />"   name="menu">
>         </frameset>
>         <frameset rows="26%,*" frameborder="0" border="0" 
> framespacing="5" cols="*">
>             <frame src="<%=request.getContextPath()%><tiles:getAsString 
> name="button" />" name="button" noresize/>
>             <frame src="<%=request.getContextPath()%><tiles:getAsString 
> name="text" />"   name="text" noresize/>
>         </frameset>
>     </frameset>
> </frameset>
> 
> but I get Forbidden errors, presumably because my JSPs are beneath the 
> WEB-INF directory and
> therefore not accessible.
> 
> Is there an alternate way to do this and still have my JSPs underneath 
> WEB-INF?
> 
> (Basically, I have a frames-based layout with a scrollable panel, and am 
> trying
> to figure out how to best implement that feature using Struts/Tiles 
> without exposing all
> my JSPs.
> 
> TIA,
> 
> -jeff
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


-- 
Jason Lea


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