• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

jsp scriplet in javascript  RSS feed

 
Greenhorn
Posts: 29
Fedora Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi this coding is not working please help me

code=java]<%@page import="java.util.*" %>
<html>
<head></head>
<script>
var str =<%= "dfdf"%>;
document.write(str);
</script>

</html>[[/code]
 
Author and ninkuma
Marshal
Posts: 66797
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aside from the fact that you should no longer be using scriptlets, the next step to take is to look at the HTML that is sent to the browser.

Is the syntax correct?






Hint: it's not.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!