: > <jsp:include page="mypage.htm" flush="true"> where mypage.htm ..
:
[quoted text clipped - 6 lines]
: you want to include it in other pages. It should be a page
: fragment, a 'snippet' of HTML or JSP/HTML.
isam,
you would have to take the string and use the request/response objects
inside your tag implementation and dynamically invoke them on the page.
the jsp engine should take care of the rest.
the point is, use the existing mechansims to include the page instead
of trying to do it in your tag.
http://groups.google.com/group/EtoE
> : > <jsp:include page="mypage.htm" flush="true"> where mypage.htm ..
> :
[quoted text clipped - 3 lines]
> :
> : Try renaming it to mypage.jsp, ...
...
> I was not asking on how to use the jsp:include tag, but rather how to emulate its tag compiling
> behavior in my custom tag.
And that is what I was answering.
>...I should have specify the following instead:
>
> <myjsp:myInclude page="mypage.htm" />
No!
<myjsp:myInclude page="mypage.htm" />
..will not be 'compiled' because your server is being told (by you)
that it does not contain any compilable statements. If the name of
'mypage.htm' was instead 'mypage.jsp' - the Java container would
recognise it as a compilable piece of Java and treat it as such.
So, back to what I originally suggested..
<myjsp:myInclude page="mypage.jsp" />
> Any ideas?
<wrily>
..try the advice offered by someone who uses JSP (successfully)
for all his sites.
</wrily>
isamura - 31 Oct 2005 18:37 GMT
"Andrew Thompson" wrote...
: > : > <jsp:include page="mypage.htm" flush="true"> where mypage.htm ..
: > :
[quoted text clipped - 8 lines]
:
: And that is what I was answering.
My mistake...
: >...I should have specify the following instead:
: >
[quoted text clipped - 12 lines]
:
: <myjsp:myInclude page="mypage.jsp" />
Actually I did try as you have suggested but the result was the same. Tags contained within
'mypage.jsp' did not get translated.
In my custom tag code, I use a BufferedReader to "include" mypage.jsp. Once the custom tag returns,
the outter page (index.jsp) is immediately sent to the browser. This leaves all "included" tags
unresolved.
The content that I am including is dynamic and needs to be resolved at runtime (on-demand), so the
container doesn't know if additional compiles are needed.
It seems as though I need to be able to compile the resulting output (perhaps repeatedly) before
sending the final output back to the browser. Perhaps there is a better solution...
: > Any ideas?
:
: <wrily>
: ..try the advice offered by someone who uses JSP (successfully)
: for all his sites.
: </wrily>
Perhaps you do have such a solution and would be willing to share it.
.K
Andrew Thompson - 01 Nov 2005 04:37 GMT
> Perhaps you do have such a solution and would be willing to share it.
This is rather odd. I use JSP's and regurlarly use the include element
for fragments that are also .JSP (contain Java statements).
It works for me..
I'll think about it some more, but must admit that I am
stumped as to why it is not working for you. :-(
isamura - 01 Nov 2005 06:21 GMT
: > Perhaps you do have such a solution and would be willing to share it.
:
: This is rather odd. I use JSP's and regurlarly use the include element
: for fragments that are also .JSP (contain Java statements).
By 'use' do you mean use of the standard jsp action tags such as jsp:include? If that is the case
then yes the included fragments will resolve even if it contains Java statements.
What I am doing is writing my own custom tags to add a slightly different behavior than the
jsp:include tag. However am finding that the included fragments do not resolve the same way.
Thanks for the suggestions though,
.K