Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
JSP
converting javascript string value to jsp string value and vice-versa
abhijeet srivastava
Greenhorn
Posts: 26
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all!
please tell how we can convert javascript
string
value to
jsp
string value and vice-versa
bye......
pradheesh manohar
Greenhorn
Posts: 10
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi abhijeet,
you would mostly require jsp variable to be passed in as string argument for JS functions like this
onClick(any event for that mattter)="javascriptFunction("<"%=jspVarName%>)"
function javascriptFunction(jspVar){
var temp=jspVar;
//
}
prashant kond
Greenhorn
Posts: 18
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
you can send jsp string to js as parameter.
ex: onClick()="javascript:temp('testString');
if you want to access js String in jsp you have to define by using
struts
of jstl.
<bean:define name="test" value="any" id="test"/>
or by <c:set />
Stefan Evans
Bartender
Posts: 1845
10
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sigh.
Java
is NOT javascript. The two do not communicate directly.
To get a value from javascript to java, you need to send it as a request parameter with a request. (Click a link, submit a form...)
There was an article in one of the javaranch journals that answered this question (though probably not how you want it answered)
http://www.javaranch.com/journal/200510/Journal200510.jsp#a1
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Passing Bean objects to JavaScript Objects....
JSP, JavaBean Coding with JavaScript
Java and Javascript intearaction
Java and Javascript intearaction
Java and Javascript intearaction
More...