JSP - Update displayed content & session variables when user clicks on a button

JSP - Update displayed content & session variables when user clicks on a button

View Answers

February 2, 2009 at 12:54 AM

Hi joel

i could help better, if you can show your code to me.



Thanks...

February 2, 2009 at 4:27 PM

Thanks for the reply!

I've been trying to figure out what the best way/quickest way is to do this. I've been hoping that some combination of JSP and javascript would work since my knowledge base is in Java. Here is something like what I am trying to do using excerpts from my code:

<SCRIPT type="text/javascript">
function addPerception() {
// What to put here?
}
</SCRIPT>

<%
Player player = (Player)session.getValue("player");
java.text.DecimalFormat formatter = new java.text.DecimalFormat("#0.00");
%>

<td style="background-image: url(images/HitterMod/smalltopbg.jpg); background-repeat: repeat; font-family: Calibri; text-align: center;"><big><big><div id="perceptionValue"><%= formatter.format(player.getPerception()) %></div></big></big></td>

<td><input src="images/HitterMod/add.jpg"
clickimage="images/HitterMod/test.jpg" height="25" type="image" width="51" id="addPerception" onclick="addPerception()"></td>

My hope is that when the user clicks on the add.jpg image, that the perception value displayed will incremented if certain requirement are met. A simple working example would be amazing!

Many thanks!

Joel









Related Tutorials/Questions & Answers:
forwarding request to a jsp when user clicks on back button in ie
forwarding request to a jsp when user clicks on back button in ie  Hi all, I have developed a web based application. After user log out... we forward request to a jsp page whenever user clicks on back button
Submit comments in database when user clicks on submit button
Submit comments in database when user clicks on submit button... database when user clicks the submit button of the page. Create a database: First...) ); Now create the JSP page for the user to place the comment and submit the comment
Advertisements
jsp :how to edit table of data displayed using jsp when clicked on edit button
jsp :how to edit table of data displayed using jsp when clicked on edit... want to delete this information in table when click on delete button and save the data when clicked on save button.. how can i do
set cookieless session variables in jsp
set cookieless session variables in jsp  I want to know how to set cookieless session variables in jsp, because when I run my application multiple... that . So, please tell is it possible in jsp to use cookieless session variables
Display an textbox when user Clicks checbox in struts Tags - Struts
Display an textbox when user Clicks checbox in struts Tags  Hi Friend. I need an code for to Display text box when the user clicks checkbox in struts.Pls hekp me.. Note:,... using this kind of tags alone.. Thanks
Save the content in my wysiwyg editor into specified location of user when clicked on save button in my web page
Save the content in my wysiwyg editor into specified location of user when clicked on save button in my web page  I am using wysiwyg editor to display some static content.My requirement is that This static content can be edited
How to implement session variables - JSP-Servlet
How to implement session variables  Hi, I have a servlet which gets parameter from a jsp page(x). it is stored in a variable in servlet as shown below. the servlet response is another jsp page(y). I should put the value of amp
change database values when click next button on jsp page
change database values when click next button on jsp page  How to retrive database values rondomly and display jsp page ,when user click next and previous bottons change the values on jsp page
Session expire and back button in jsp and servlet .
Session expire and back button in jsp and servlet .  Hii Sir... to invalidate the session after a certain interval of time and after clicking logout button.Means that after session expiry time and logout action no one can access
Track user's session using 'session' object in JSP
Track user's session using 'session' object in JSP This section is about tracking user identity across different JSP pages using 'session... of that user's session. Methods to work with session : ADS_TO_REPLACE_1 1. Cookies
how to disable submit button after login in jsp
an application and when user logs in welcome page is displayed. When user clicks... to disable submit button after login in jsp? Thanks   Hi, You can use the http session variable in the login.jsp page. When use logs in create
jsp :how to edit table of data displayed using jsp when clicked on edit button
, there is a button which consists of that particular id. When the user clicks...jsp :how to edit table of data displayed using jsp when clicked on edit... want to edit this information in table when clicked on edit button and save
Remove attribute in user defined session - JSP-Servlet
Remove attribute in user defined session  Hi, How we can set remove attribute for user defined session. I am appreciating if you are sending solution as soon as possible? Thanks, Sanat Kumar
JSP Session Object
JSP Session Object  JSP Session Object?   Session Object denotes the data associated with a specific session of user. The class... of Session Objects is to maintain states when there are multiple page requests
How to prevent from navigating to ck buttonnext page when user reaches login page using back button
How to prevent from navigating to ck buttonnext page when user reaches login... goback to user login page using back button and agin click browser forward button,the 2nd page session gets expired but on next click on forward button,the pdf
session variables server side
session variables server side  how to hold session variable for server side..?   request.getSession().setAttribute("wellSelection", uid
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  sorry sir my actual probs is that 1st i m callig a jsp in that i m displaying a table where i used a radio button to access a value(also used u r code),then in this jsp i m having a forms
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  Here is my code sir please...; //System.out.println("******* id in jsp login Is ******" +id); f.submit..., IOException { HttpSession session; session = request.getSession
when radio button is selected corresponding jsp page should open
when radio button is selected corresponding jsp page should open  how to write code in HTML & jsp, when we click on radio buttons the corresponding jsp page should open..!   <html> <script> function
Clearing session in jsp
Clearing session in jsp  i have developed a web appilcation using jsp and when user try to logout, session is not clearing even though i have used..."); session.removeAttribute("type"); When i press back button of browser it redirects to previous page
Radio Button in HTML
Radio Button in HTML is a type of input form that allows a user to select one button from a group of button. When a user clicks on a radio button, it becomes checked, while all other button remains unchecked. <input type>
Scripting Variables in JSP Custom Tag
are variables that are available to the JSP page when any JSP page is called. Scripting variables may be any scripting variables but when we are dealing in reference... Scripting Variables in JSP Custom Tag   
how to disable submit button in jsp using servlet when some condition is satisfied
how to disable submit button in jsp using servlet when some condition is satisfied  how to disable submit button in jsp using servlet when some condition is satisfied
list to be displayed in jsp page.
list to be displayed in jsp page.  Can any one help me? Am developing the code in struts.I have a list in action class that has to be printed in the dropdownlist in another jsp page.Please help me in the code.. Thank u
Jsp Scope Variables - Java Interview Questions
Jsp Scope Variables  what is the importance of page,session,request n application scope variables in JSP?Am not understanding where which scope... in advance.  Hi Friend, JSP Scope Variables: Page scope-It makes
Session Tracking JSP - JSP-Servlet
Session Tracking JSP  Respected sir/madam, I am R.Ragavendran.. I Immediately need a coding for session tracking in JSP. Actually when the admin clicks "View Users logon status" Yiour coding must display the User Login
jsp scope variables - JSP-Interview Questions
jsp scope variables  what is the importance of page,session,request n application scope variables in JSP?Am not understanding where which scope..., the jsp object is accessible from pages that belong to the same session from
JSP Back Button
JSP Back Button          Jsp Back Button enables the user back... button and displayed in text area. The Back button takes the user back
Use Session to Track User in JSP
Use Session to Track User in JSP   .... A session id is a unique token number assigned to a specific user for the duration of that user's session.ADS_TO_REPLACE_1 Methods to work with session : 1
Session Problem in JSP - JSP-Servlet
Session Problem in JSP  I have developed a online feedback form in JSP platform. I have created normal session in JSP page. It is running in my machine properly, but when I am trying to access it from another machine
Jsp Scope Variables - JSP-Interview Questions
Jsp Scope Variables  what is the importance of page,session,request n application scope variables in JSP?Am not understanding where which scope variable we have to use in programs..let me know when we have to use them seperately
jsp - session - JSP-Servlet
JSP - Session  How to manage session in JSP
How can we register the variables into a session?
How can we register the variables into a session?  How can we register the variables into a session
session in jsp
session in jsp In this section you will learn about session in JSP. Here you will learn about how to use the HttpSession in JSP. session in JSP is defined... of its Servlet. Session specifies the single interactive user. An implicit
how to initialise variables in jsp?
how to initialise variables in jsp?   1. what is the problem in the folloing jsp <%@ page import..." %> <html:html> <head> <meta http-equiv="Content
insert user session into other oracle database table
insert user session into other oracle database table   hello i am a doing my project in jsp-servlet. i have doubt that when a user login to his account after that i store his name into session and when the user write any
Variables in a Servlet - JSP-Servlet
Variables in a Servlet   Hi, I'm using some variables in a servlet1 (which i get from a jsp, like "String x = request.getParameter("xyz");"). the servlet response is a jsp page which after taking some more parameters gets
Session In JSP
; Cookies in JSP When cookie based session management is used, a token...Session In JSP      ... of World Wide Web (WWW).    Session Management in JSP
Session timeout message need to be displayed - Java Beginners
Session timeout message need to be displayed  Hi, I want to display a session timeout on website. i want to find session - remaining time set in web.xml. Thanks Manu
session in jsp - Java Beginners
let me know how to create a session in jsp. Session for jsp with two side...   Hi friend, session is implicit object in jsp. using session oject in jsp. first u set using following methods String name
assignment of variables - JSP-Servlet
value here: Then click the button to Check you use that to transfer... page on the server. The loginPage,jsp should something like.../jsp/ Thanks
Programming Error - JSP-Servlet
Programming Error  Image: I want that when user clicks on browse button then a folder of images should get open and when user clicks one image from it (only one not more than that)then it should get displayed on next page
get a session object - JSP-Servlet
get a session object  how to do in a table when i click on a radio button i should get the id value which is in the same row and store it in the session this is in jsp when in the servlet if i call a get session i have to get
Duplicated Session Variables
Duplicated Session Variables     ... a new session variable because it has been created by the JSP container for you... name. Consider we have declared a session variable true in jsp page <%@ page
pasing variables in jsp file - JSP-Servlet
pasing variables in jsp file  How can more than one pages of jsp files share variables and how can one pass local variables from one jsp file to another jsp file?  Hi Friend, To pass variables from JSP file
session value not get in many jsp page.
)session.getAttribute("user"); this is work but when this code is use in other jsp page its give...session value not get in many jsp page.  I am using servlet to set...,response); and get session value on jsp page by follwing:- (adsbygoogle
Session Management in JSP
Session Management in JSP     ... will be considered as a new user. It is not reliable when we are doing any type... explicitly as we do in Servlets. In Jsp the session is by default true. The session
Action Submit Html
button. When an user enter some text in the text field User name) and clicks...;  Action Submit in Html is used to submit a form, When a user clicks on a submit button, the form is sent to the specific address
Session tracking in login jsp program - JSP-Interview Questions
Session tracking in login jsp program  I have using jsp technology in my project.I want to do session tracking in my login form.After logout when i press back button it should be show session is expired.Please help me. Send
How do servlets work? Instantiation, session variables and multithreading
How do servlets work? Instantiation, session variables and multithreading  How do servlets work? Instantiation, session variables and multithreading

Ads