You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tom Tibbetts <tt...@ecmc.org> on 2001/09/12 17:47:31 UTC

getting jsp:include to work behind WEB-INF wall

Hi All.  I know this may not be totally germain, but I bring it up because 
I'm keeping all my JSPs behind the WEB-INF wall which is a Struts best 
practice....


The problem I'm having is that I want to use a <jsp:include> and the page I 
want to include is not showing up in my HTML output from the servlet 
compiler.  I've tried putting copies of my include page everywhere with no 
good results.  Has anyone else done this with success?? Thanks in advance, Tom


Re: getting jsp:include to work behind WEB-INF wall

Posted by Tom Tibbetts <tt...@ecmc.org>.
I got it now....  I made sure that sidenav has a jsp extension, not an HTML 
one.  Thanks for your help.


At 01:27 PM 9/12/01 -0400, you wrote:
>I have pages like this that work just fine:
>
><%@ taglib uri="/tags/tiles" prefix="tiles" %>
><tiles:insert page="/WEB-INF/layouts/columns.jsp" flush="true">
>         <tiles:put name="numCols" value="2" />
>         <tiles:putList name="list0" >
>                 <tiles:add value="/WEB-INF/portlets/login.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/messages.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/newsFeed.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/advert2.jsp" />
>         </tiles:putList>
>         <tiles:putList name="list1" >
>                 <tiles:add value="/WEB-INF/portlets/stocks.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/whatsNew.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/personalLinks.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/search.jsp" />
>                 <tiles:add value="/WEB-INF/portlets/advert3.jsp" />
>         </tiles:putList>
></tiles:insert>
>
>What happens when you refer to a copy of sidenav.html that's at the
>root?
>
>
>Tom Tibbetts wrote:
> >
> > I'm now trying the <template:insert> with no success.  Here's what I'm 
> doing:
> >
> > <template:insert template="/WEB-INF/pages/admin/sidenav.html" >some more
> > text</template:insert>
> >
> > the content of sidenav.html is just static html with the typical links to
> > other pages
> >
> > is this all because I'm behind WEB-INF????


Re: getting jsp:include to work behind WEB-INF wall

Posted by Ted Husted <hu...@apache.org>.
Tiles will be distributed with Struts in the 1.1 timeframe. It is in the
contrib folder now, and also available here: 

http://www.lifl.fr/~dumoulin/tiles/

Tom Tibbetts wrote:
> 
> Same result.  Where can I get Tiles?  How does it compare with Struts taglib???
> 
> What happens when you refer to a copy of sidenav.html that's at the
> >root?

Re: getting jsp:include to work behind WEB-INF wall

Posted by Tom Tibbetts <tt...@ecmc.org>.
Same result.  Where can I get Tiles?  How does it compare with Struts taglib???

What happens when you refer to a copy of sidenav.html that's at the
>root?


Strut by Strut Example by Ted Husted

Posted by Nathan Anderson <na...@sum-ware.com>.
I am trying to learn Struts, and I am impressed by the collection of
material on www.husted.com.  I have been able to successfully install and
run the tutorial from www.jspinsider.com, but the Strut by Strut example
doesn't seem to work.  Here is the system I'm running Struts on:

Windows 2000 [sp2]
Tomcat 3.2.3
Struts 1.0
JCreator v2.0 is my IDE [basically a highlighting text editor].

Here is what happens.  I have downloaded and installed the struts-stub.war,
then started up Tomcat.  When I point my browser to
http://localhost:8080/struts-stub/ I properly get directed to
http://localhost:8080/struts-stub/index.jsp.  The page displays, but when I
click on the "Enter" button nothing happens.  A snippet of the HTML source
follows.

Thanks for any help in this matter.

Nathan Anderson

---

<form name="stubForm" method="POST"
action="/struts-stub/stub/Insert.do;jsessionid=67u3zh4l61" onsubmit="return
submitForm(this);">

... [form fields omitted] ...

<td align="right" colspan="3">&nbsp;<input type="hidden" name="validate"
value="0"><input type="submit" name="submit" value="ENTER"
onclick="this.form.validate.value='1';">&nbsp;<input type="submit"
name="org.apache.struts.taglib.html.CANCEL" value="CANCEL"
onclick="this.form.validate.value='0';"></td>
</tr>
</form>
<script language="JavaScript" type="text/javascript">
  <!--
    document.forms["stubForm"].elements["property0"].focus()
  // -->
</script>
<SCRIPT LANGUAGE="Javascript1.1">
<!-- Begin
	function validateStubForm(form) {
		return null;
	}
//  End -->
</SCRIPT>
<script language="javascript">
<!--
function submitForm(form) {
  if (form.validate.value == "0") {
    return true;
  }
  if (validateStubForm(form)) {
    form.submit.value=" ...";
    return true;
  }
  else return false;
};
// -->
</script>


Re: getting jsp:include to work behind WEB-INF wall

Posted by Ted Husted <hu...@apache.org>.
I have pages like this that work just fine:

<%@ taglib uri="/tags/tiles" prefix="tiles" %>
<tiles:insert page="/WEB-INF/layouts/columns.jsp" flush="true">
	<tiles:put name="numCols" value="2" />
	<tiles:putList name="list0" >
		<tiles:add value="/WEB-INF/portlets/login.jsp" />
		<tiles:add value="/WEB-INF/portlets/messages.jsp" />
		<tiles:add value="/WEB-INF/portlets/newsFeed.jsp" />
		<tiles:add value="/WEB-INF/portlets/advert2.jsp" />
	</tiles:putList>
	<tiles:putList name="list1" >
		<tiles:add value="/WEB-INF/portlets/stocks.jsp" />
		<tiles:add value="/WEB-INF/portlets/whatsNew.jsp" />
		<tiles:add value="/WEB-INF/portlets/personalLinks.jsp" />
		<tiles:add value="/WEB-INF/portlets/search.jsp" />
		<tiles:add value="/WEB-INF/portlets/advert3.jsp" />
	</tiles:putList>
</tiles:insert>

What happens when you refer to a copy of sidenav.html that's at the
root?


Tom Tibbetts wrote:
> 
> I'm now trying the <template:insert> with no success.  Here's what I'm doing:
> 
> <template:insert template="/WEB-INF/pages/admin/sidenav.html" >some more
> text</template:insert>
> 
> the content of sidenav.html is just static html with the typical links to
> other pages
> 
> is this all because I'm behind WEB-INF????

Re: getting jsp:include to work behind WEB-INF wall

Posted by Tom Tibbetts <tt...@ecmc.org>.
I'm now trying the <template:insert> with no success.  Here's what I'm doing:

<template:insert template="/WEB-INF/pages/admin/sidenav.html" >some more 
text</template:insert>

the content of sidenav.html is just static html with the typical links to 
other pages

is this all because I'm behind WEB-INF????

At 12:16 PM 9/12/01 -0400, you wrote:
>I haven't worked much with the jsp:include tag myself, but I do know
>that the Tiles tags can assemble pages stored under WEB-INF.
>
>-- Ted Husted, Husted dot Com, Fairport NY USA.
>-- Custom Software ~ Technical Services.
>-- Tel +1 716 737-3463
>-- http://www.husted.com/about/struts/
>
>
>Tom Tibbetts wrote:
> >
> > Hi All.  I know this may not be totally germain, but I bring it up because
> > I'm keeping all my JSPs behind the WEB-INF wall which is a Struts best
> > practice....
> >
> > The problem I'm having is that I want to use a <jsp:include> and the page I
> > want to include is not showing up in my HTML output from the servlet
> > compiler.  I've tried putting copies of my include page everywhere with no
> > good results.  Has anyone else done this with success?? Thanks in 
> advance, Tom


Re: getting jsp:include to work behind WEB-INF wall

Posted by Ted Husted <hu...@apache.org>.
I haven't worked much with the jsp:include tag myself, but I do know
that the Tiles tags can assemble pages stored under WEB-INF. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/


Tom Tibbetts wrote:
> 
> Hi All.  I know this may not be totally germain, but I bring it up because
> I'm keeping all my JSPs behind the WEB-INF wall which is a Struts best
> practice....
> 
> The problem I'm having is that I want to use a <jsp:include> and the page I
> want to include is not showing up in my HTML output from the servlet
> compiler.  I've tried putting copies of my include page everywhere with no
> good results.  Has anyone else done this with success?? Thanks in advance, Tom

Re: getting jsp:include to work behind WEB-INF wall

Posted by Cedric Dumoulin <ce...@lifl.fr>.
  Hi,

  Url of page to include should be "/WEB-INF/pageToInclude.jsp". This work well
with tiles or templates insert tag on Tomcat. I have never try it with
<jsp:include ...>. Also, I have read a mail about a jsp container that doesn't
work with such practice.

  Cedric

Tom Tibbetts wrote:

> Hi All.  I know this may not be totally germain, but I bring it up because
> I'm keeping all my JSPs behind the WEB-INF wall which is a Struts best
> practice....
>
> The problem I'm having is that I want to use a <jsp:include> and the page I
> want to include is not showing up in my HTML output from the servlet
> compiler.  I've tried putting copies of my include page everywhere with no
> good results.  Has anyone else done this with success?? Thanks in advance, Tom