File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Creating of dynamic jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Creating of dynamic jsp" Watch "Creating of dynamic jsp" New topic
Author

Creating of dynamic jsp

Venkat Aditya
Greenhorn

Joined: Jul 13, 2007
Posts: 6
Is there any way to create dynamic jsp pages. jsp page constructs at runtime which can be included in struts
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Yes, it's possible to do this. One possibility would be to use the classes in the java.io package to physically write the JSP to a file somewhere in your Web Context directory or one of its subdirectories. You could then create an ActionForward that forwards to that JSP. Example code in your Action class:


Merrill
Consultant, Sima Solutions
Venkat Aditya
Greenhorn

Joined: Jul 13, 2007
Posts: 6
Thak you for you suggestion . can you post the steps for the same.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This link contains sample code for writing to a file using the java.io package. I've already given you sample code for dynamically forwarding to a JSP.
Nick Williamson
Ranch Hand

Joined: Jan 06, 2007
Posts: 73
you could just use the response object from your action and create your web pages within your actions and write them out (returning null).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating of dynamic jsp