This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to include Dynamic tag lib in the jsp  RSS feed

 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends
I am trying to display dynamic data from DB in a table and also display a cewolf chart using the data.

I am building a String containing HTML code in the view helper and in that i include both Table and chart cewolf tab library code.
This is how it is data is presented to the jsp
Action calls --->>>>> View Helper (Builds HTML String) ---->>>>> and Action sets the string as a request attrscope and forwards to JSP --->
In jsp it displays the request String attribute.

PROBLEM:
Table data is displayed as built by the view helper when I view the HTML page properly but the CEWOLF tag library is not invoked when the JSP loads and no chart is appears on the HTML Page except i can seee the following lines when I View Source of the HTML displayed.



Experts please tell me hojw to invoke the Tag library inside in the string to be loaded by the JSP rather than just thrown to the screens as string.
Really Struck..
Regards
Mohamed Farouk
[ February 16, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, you can;t build up JSP markup in a string at execution time and expect it to get evaluated. The opportunity for evaluation passed long ago during the translation phase.

The question is, why are you building up JSP inside Java code rather than just using a JSP mechanism?
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
I am using the View helper pattern to make the view developed inside a Javaclass and set as a request attribute in action and then jsp just shows the attribute from request/session scope.
I am using View helper any wrong in what i am doing?
Regards
Mohamed Farouk
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, without doing some really complicated gyrations, you're not going be able to generate JSP markup on-the-fly in some sort of view helper and expect to pass it the page for evaluation. JSP markup gets evaluated at translation time, not execution time.

Why are you trying to generate JSP in a Java class at execution time rather than just using a JSP or a custom tag or some other normal mechanism?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!