Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

including content in jsp from action class ?

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
can any one help me out ?
[ January 25, 2006: Message edited by: kamesh aru ]
 
Marshal
Posts: 67313
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
Marshal
Posts: 67313
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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.
 
Water! People swim in water! Even tiny ads swim in water:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!