| Author |
using html:button with scriptlets
|
Steve Levin
Greenhorn
Joined: Jul 23, 2004
Posts: 11
|
|
Hi, I'm trying to open a new browser window when a user clicks on an html:button Like the following: onclick purposely misspelled The scriptlet contained in the tag is a dynamic url decided at runtime. The problem I'm having is that the scriptlet within the javascript part of the tag isn't recognized as a scriptlet. Is there a different way to insert the dynamic url contained in the scriptlet into the javascript within the tag? Any help is appreciated Thanks
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26201
|
|
Steve, It looks right the way you have it. From JSP's point of view, there isn't any difference between a scriptlet in a Javascript or Struts tag. You can verify this by placing <%=pdfFile%> elsewhere on the page to see what happens.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
|
You can't use a scriptlet as just part of the attribute of a custom action. It must be all of the attribute, or none.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Steve Levin
Greenhorn
Joined: Jul 23, 2004
Posts: 11
|
|
|
If I can't use a scriptlet as just part of the attribute, then how can I pass in the url contained in the scriptlet to the javascript function. Is there another way?
|
 |
Steve Levin
Greenhorn
Joined: Jul 23, 2004
Posts: 11
|
|
|
Nevermind, I figured it out, I just created a String containing the javascript function with the url and then passed in the whole String as the arg to onclic
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
Bingo. This is yet another of the many problems with continuing to use scriptlets in JSP pages. [ October 22, 2006: Message edited by: Bear Bibeault ]
|
 |
 |
|
|
subject: using html:button with scriptlets
|
|
|