Can I make a jsp custom tag to return a value in to a jsp variable.

Niko Schmuck

I'm afraid but this is not possible AFAIK, when i got you right you want to use a construction like:




<% boolean myResult = <jsp:test foo='bar'/> %>



and you cannot nest custom jsp tags in jsp expressions, but you could (though this is only an idea) access a parent custom tag with the help of
javax.servlet.jsp.tagext.TagSupport.findAncestorWithClass()
from your jsp code and with the tag object available call a specific method


<jsp:foo>


  <% FooTag ft = (FooTag) TagSupport.findAncestorWithClass([null?], FooTag.class);


  boolean res = ft.getResult();

%>
</jsp:foo>


0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact