• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jstl with Struts Html tags

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to get jstl tags work with struts html tags.
I am trying to do something like this, I am not able to assign the proprty of the radio butto.



Is there a way I can get the "id" variable's property out using a scriptlet?
like <html:radio property='<%=<c ut value="${id.property}"/>%>' ???

Thank you very much.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When mixing JSTL tags with Struts tags, your best bet is to use the struts-el version of the tags.

To do this, put the following line in your jsp:

<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html-el"%>

Also, make sure that struts-el.jar is in your WEB-INF/lib directory.

Then you can just do this:
 
J Bhatt
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much,,
I was just trying to get this thing working without using the html-el tags because we have a custom implementation of struts tags ,and html-el tags might not work well with it.
This is something that I tried to do :

I am thinking that <%=question.property%> should be able to get the property out of the question , and set it in the html radio.,like below

This doesn't seem to work either, is there a way to get this working ?
Thanks Again.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember that anything you put between <%= %> brackets must be a java expression.

Try:

<%=((com.vo.Question)pageContext.getAttribute("question")).getProperty()%>

the <jsp:useBean> is unnecessary because the default scope for any JSTL variable is page.
 
J Bhatt
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You ,
That worked.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic