• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically generating JSP

 
justin mooch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a JSP in which I need to render the results of a call to a search engine servlet.

However, I need to hide a particular field of each row of the results to users who aren't authenticated (logged in) and show it to those who are. I have been given a JSP custom tag to wrap content for authenticated and unauthenticated users.

I initially thought the search engine could generate something like:



But since the results are generated at request time, I'm struggling to understand if there is some feasible way of "injecting" the above results text (JSP tags included) back into the main JSP (that might have other content above and below that table) so that the JSP-to-Servlet compiling mechanism still catches those "mytags" tags.

Can anyone advise?

Thanks, Justin
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your best bet would be to filter the results prior to even sending them to the page.
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I initially thought the search engine could generate something like:

what do the actual search engine results look like? And what do the custom tags do? Assuming the search results are in a scoped list/array of objects and the tags just conditionally display information based on the login status, you might do something like:





But since the results are generated at request time, I'm struggling to understand if there is some feasible way of "injecting" the above results text (JSP tags included) back into the main JSP (that might have other content above and below that table) so that the JSP-to-Servlet compiling mechanism still catches those "mytags" tags.

Please tell me you don't want every request to the page to result in a JSP compile!!!

-Yuriy
[ August 02, 2005: Message edited by: Yuriy Zilbergleyt ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!