| Author |
including content in jsp from action class ?
|
kamesh aru
Ranch Hand
Joined: Mar 16, 2002
Posts: 150
|
|
i need to include the content from two different action classes in a jsp page . <html> <head><title>An Include Test</title></head> <body bgcolor="white"> <font color="blue"> The current date and time are <%@ include file="http://host1:9080/example1.do" %> <%@ include file="http://host2:9080/example2.do" %> </font> </body> </html> can any one guide me in this regard thanks in advance
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
The include directive <%@ include...> tag results in a tranlation time merge of source code. Look into using the include action: <jsp:include...> See our FAQ for more information of the difference between the include action and directive. http://faq.javaranch.com/view?IncludesActionDirective
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
kamesh aru
Ranch Hand
Joined: Mar 16, 2002
Posts: 150
|
|
thanks for the responce following is the code i used it s giving error :- Error 500: Server caught unhandled exception from servlet [action]: Response already committed [ January 25, 2006: Message edited by: kamesh aru ]
|
 |
kamesh aru
Ranch Hand
Joined: Mar 16, 2002
Posts: 150
|
|
can any one help me out ? [ January 25, 2006: Message edited by: kamesh aru ]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
Without knowing what the action does, it's impossible to say for sure. But the usual suspects for this type of problem are trying to forward or redirect after some output has been emitted, or trying to emit output after a forward or redirect. Why are you doing things this way in the first place? It's rather messy. Rather, factor out the functionality you want for the action and put it in a custom tag rather than trying to include an entire servlet/action.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
kamesh aru
Ranch Hand
Joined: Mar 16, 2002
Posts: 150
|
|
|
i need the out put of action classes from two different servers and present it on the third server ?so i am getiing the error i would like to know can we call an action class in a jsp with url ?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
Originally posted by kamesh aru: i would like to know can we call an action class in a jsp with url ?
Well, that's pretty much already been answered: it depends what the calling JSP is doing and what the action does. See the previous responses about what can cause the illegal state exception.
|
 |
 |
|
|
subject: including content in jsp from action class ?
|
|
|