This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nesting of tags in struts?

 
Adwait Patankar
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to call a javascript function in the href of my <html:link>. The javascript function needs to be passed a property in my form.
I'm trying with the following code :

<html:link href="javascript:test('<bean:write name="LoginForm" property="ename"/>')">

I'm getting the following exception:

[1/30/06 18:51:51:336 IST] 64d7befc WebGroup E SRVE0026E: [Servlet Error]-[/pages/details.jsp(32,66) Attribute LoginForm has no value]: org.apache.jasper.compiler.ParseException: /pages/details.jsp(32,66) Attribute LoginForm has no value.

Is it possible to include a struts tag inside another. The exception is because of mismatch of quotes. Can anybody suggest a solution for the same.

Thanks in advance.
Adwait
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it is not possible to inclue one Struts tag inside another. You can include a scriptlet, however.

In this particular case, I'd recommend using the <a> tag. The html:link tag doesn't offer you any advantages in this case.

Just write:

<a href="javascript:test('<bean:write name="LoginForm" property="ename"/>')">
 
Adwait Patankar
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Merrill,
Thanks for the prompt reply. I had already tried using with <a> and it works fine. I just wanted to know whether we can use <html:link> struts tag for the same.
Regards,
Adwait
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic