[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

invoking one line of jsp from javascript

Posted on 2006-11-13
6
Medium Priority
?
256 Views
Last Modified: 2010-04-01

Hi all,

Im trying to call a piece of jsp code from within a javascript function like so:

function reset()
{
alert("change made");
<%
session.removeAttribute("value");
%>
}

<html:select property="process" onchange="reset()">

The alert gets called when its supposed to, in that every time I make a change the alert gets displayed. But everytime the user visits the page the line:
session.removeAttribute("value");
gets called when it should be just called when the function reset in invoked.

Any help is greatly appreciated.

Thanks


0
Comment
Question by:ip_packet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 16

Expert Comment

by:Peter Kwan
ID: 17929401
You cannot do that, since the scriptlet are evaluated on serverside before the page is presented to the client side.
0
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 552 total points
ID: 17929408
One way is to submit a form to the server side and process your statement and then return back to the input page.
0
 

Author Comment

by:ip_packet
ID: 17930180


>>process your statement and then return back to the input page

Do you mean use javascript to re-direct to a jsp page and then do the processing on that page?
0
 
LVL 11

Assisted Solution

by:Manish
Manish earned 548 total points
ID: 17930318
You are not using any servlet ? just submit the form to that servlet or jsp (if you are using jsp) ,remove whatever value you want to remove from session , come back to same page..with values.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question