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

dynamic jsp page (can't include %>)  RSS feed

 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I try to write a jsp page to create a new jsp page dynamically which allow to Add a new record to the specified table.Its sucess.But when I try to write edit page for the same, i want to include request.getParamer(..) statement.But i can't put the %> tag at the end.
Statement
outerpage is a BufferWriter object

outerpage.write("<%String showmsg=request.getParameter(\"msg\");\n");
outerpage.write("String ref_id=request.getParameter(\"id\");\n");
outerpage.write("%>");// this line create error

Is there any option include the %> as a constant
Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, I wouldn't take this approach.

JSPs that write JSP code are bound to get ugly and inefficient.
Remember that, unlike with most interpreted scripting languages, JSPs are actually compiled into servlet code and then compiled before being loaded into the JVM.

That being said, did you try breaking the closing tag up?
 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks

My approach is to provide user ADD,Edit and List pages if they input a table.
This won't work from the creation point.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can't you accomplish this with jsp:include tags?
 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works.
Is this approach of creating ADD,Edit,List page dynamically is not good?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way: One headache, in particular, that I can see coming from this approach is running out of permgen space on your server. The permgen section of JVM memory holds, among other things, the class and method definitions. These things don't get flushed the same way that other types of memory do during garbage collection.
Since there is no upper limit on the number of classes that will be created/compiled and loaded into the JVM, no permgen setting will be high enough for this to run continuously without hitting the limit.
 
dkumar kizhakkel
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the jsp program creating only the new pages and copy to the required directory.Its not compiling or do any other activities. IF we want to run this page, the user call the specific page(Addcustomer.jsp).[There is an option to enter name of the page].

Thanks for your valuable reply
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!