Hi All!

I'm working on a web application, JSP, where a user selects the text with the mouse in html. I want this text to be inserted in a MySQL database as a java string using prepareStatement in Java and executeupdate.

Example:
String querystring = "INSERT INTO mySelectedTextTable(selectedTextWithMouse) VALUES (?)";

selectedTextWithMouse would be a java String, but the selected text is kept on a javascriptvariable.

Any clues on how to convert the javascript variable into a java String?


Thanks in advance.

Recommended Answers

All 2 Replies

well .. on my previous projects one of my co workers had to do something similar, and he called the webservice from within his javascript, passing the value as a parameter.
maybe you could google it? by googling 'call a java webservice from javascript' I got a lot of responses, one of them is bound to work for what you try to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.