Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating of dynamic jsp  RSS feed

 
Venkat Aditya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to create dynamic jsp pages. jsp page constructs at runtime which can be included in struts
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Venkat Aditya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thak you for you suggestion . can you post the steps for the same.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you could just use the response object from your action and create your web pages within your actions and write them out (returning null).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!