/    Sign up×
Community /Pin to ProfileBookmark

Help … How to call servlet from mouseover attrbute

Hi,

I am trying to call a servlet when the onmouseover or onmouseout attribute is activated in the following jsp file:

<%
String tmp1 = “../servlet/test?text=bad”;
String tmp2 = “../servlet/test?text=good”;
%>

<form>
<input type=image name=img src=<%=tmp1%> onmouseout=<%=tmp1%> onmouseover=<%=tmp2%>
</form>

All this servlet does is create an image with the word ‘bad’ or ‘good’. The image is an encoded jpg outputstream.

I have tried all kinds of things but somehow this does not work on the onmouseout and onmouseover attribute. The src attribute works like a champ.

Anyone any idea how I can make this work?

Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63May 24.2003 — It sounds like a bad designe to me.

First of all you can not simply send and recieve an http request/response by only mouseover/out.

Second even if you could do it using some functions,sending an http request for onmouse over and out can really screw up the network,not to mention multiple requests in the same time frame for good and bad images.

That said,if you must implement this strange logic,then you will need to call amethod that will reload the page and forward the request to the servlet.
×

Success!

Help @tmunnich spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...