Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet JSP - Update displayed content & session variables when user clicks on a button

Have Programming Question? Ask it here!
 
 
 


Joel
JSP - Update displayed content & session variables when user clicks on a button
2 Answer(s)      5 years and 6 months ago
Posted in : JSP-Servlet



Advertisement
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...;  primary key(user_id) ); Now create the JSP page
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
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
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
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
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
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 : 1. Cookies 2. URL
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
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 variables server side
session variables server side  how to hold session variable for server side..?   request.getSession().setAttribute("wellSelection", uid
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
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... Button in HTML: The use of a radio button is to allow a user to make one
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
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
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
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
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
JSP Session Object
in a application where variables are stored for the entire user session. Methods...JSP Session Object  JSP Session Object?   Session Object denotes the data associated with a specific session of user. The class
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
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. Methods to work with session : 1. Cookies 2. URL
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
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
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
button to accept user input
button to accept user input  private void jButton1ActionPerformed... the radiobutton and spinner.The user input does not show on my Studentinfo.mdb... that accepts firstname, lastname and gender from user and insert to database
Action Submit Html
an user enter some text in the text field User name) and clicks the submit button...;  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 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 Back Button
JSP Back Button          Jsp Back Button enables the user back... and displayed in text area. The Back button takes the user back to the page they just
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
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
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 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
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
jsp - session - JSP-Servlet
JSP - Session  How to manage session in JSP
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
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
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
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
using session variable determine the no of pages viewd by the user
using session variable determine the no of pages viewd by the user  using session variable determine the no of pages viewd by the user   Hi.../java/jsp/trackuserSession.html Thanks
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
print form information when click on print button
print form information when click on print button   Sir,I desingn institute webside using jsp and strut by using platform netbean 7.2.So request you please help for printing form information by clickin print button after submit
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
ID using get the databse latest value and displayed in jsp
ID using get the databse latest value and displayed in jsp   I have some text box like name address city ,I have submit button and preview button ... once click the submit button the data will be stored in mysql database
sorting and filtering the displayed table data using jsp and xml
sorting and filtering the displayed table data using jsp and xml  I have created a xml file and a jsp file, which uses DOM parser to display the content of xml file in web page. Now I would like to sort and filter those data
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
Login Box appears when a button on the webpage is clicked
Login Box appears when a button on the webpage is clicked  How to create a Login Box on a web page that appears only when a button that is already present on the page is clicked
Login Box appears when a button on the webpage is clicked
Login Box appears when a button on the webpage is clicked  How to create a Login Box on a web page that appears only when a button that is already present on the page is clicked
 

 

 

DMCA.com