• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

including content in jsp from action class ?

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
kamesh aru
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can any one help me out ?
[ January 25, 2006: Message edited by: kamesh aru ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
kamesh aru
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic