aspose file tools*
The moose likes JSP and the fly likes Is there a way to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Is there a way to "Include" an action result or Servlet result in a base JSP page?" Watch "Is there a way to "Include" an action result or Servlet result in a base JSP page?" New topic
Author

Is there a way to "Include" an action result or Servlet result in a base JSP page?

Nagesh Rachakonda
Ranch Hand

Joined: Dec 04, 2003
Posts: 34
I have a base JSP in which I need to include the content from the result of an action/servlet...

How I can accomplish this?

This is similar to the portal home (like my yahoo home page) where different gadgets sit in one home page... (is our goal)....

Thanks in advance for your help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Sure. The include action (not directive) can reference any active resource in your web app.

But.... that's not a great way to do things in a JSP. A custom action (tag) would be much better suited.

What I do in cases like these is to factor out the common processing into a separat class that can be used either from a servlet or from a custom tag in a JSP without having to repeat any code.
[ September 29, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nagesh Rachakonda
Ranch Hand

Joined: Dec 04, 2003
Posts: 34
You are right!

Using JSTL's custom tags, we can achive this!

In the JSP place:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<c:import url="Action_NAME" context="WEB_CONTEXT"/>

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to "Include" an action result or Servlet result in a base JSP page?