aspose file tools*
The moose likes JSP and the fly likes Problem with closing script tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with closing script tag" Watch "Problem with closing script tag" New topic
Author

Problem with closing script tag

Anup Srivastava
Greenhorn

Joined: Dec 21, 2005
Posts: 21
I am trying to perform following operation

<script>
function getValue(){
document.form1.brief.value = '<%=briefstr %>';
}
</script>

where "brief" is a hidden variable and "briefstr" is a Java String variable and consists of javascript contents. when javascript inside value closes, that script tag, closes script in my jsp file and gives javascript Error I need to assign these value onload of body for rest of the cose. How can i handle it?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You can not, simply.

JavaScript runs on client side, on the other hand JSP is a server-side technology.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61227
    
  66

and "briefstr" is a Java String variable and consists of javascript contents.


Do you not thing it might help to show us what that is?

I need to assign these value onload of body for rest of the cose.


"cose"? What's a "cose"?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
seby mathew
Greenhorn

Joined: Apr 19, 2006
Posts: 7
remember one thing 'briefstr' is a server side variable, means this is a java variable and it gets initialised in server side, so you have to write some method to manipulate the server side variable (like replace '>' with '>') so that it wont affect your html rendering of the jsp.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with closing script tag