Home Tutorialhelp Comment How to refresh a jsp page using struts

 
 

Comment

Omar
How to refresh a jsp page using struts,
April 30, 2008 at 2:20 AM

Hi all,

I am trying to refresh the data that have been retrieved from database to a jsp page. The first action class is retrieving data from database and display them in the jsp page. In the same jsp page I want to create a button where a user can click to refresh the data that has been update in the database side. This is done by second action class. Please let me know as this problem is hitting my head.

The first action class

public class StateResultAction extends BaseAction{
private int year;
private int month;

public ActionForward process(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
String forwardPage = "";
Vector data = null;
Log log = getLogger();
StateForm stateForm = ((StateForm)form);


log.debug("in StateResultAction:"+stateForm);

try {
year = stateForm.getStartYear();
month = stateForm.getStartMonth();
StateBusLogic busLogic = new StateBusLogic(stateForm);


if(stateForm.getSt().startsWith("98")){
data = busLogic.getBalance2();
}else{
data = busLogic.getBalance();
}

log.debug("size of data:"+data.size());

request.getSession().setAttribute("data", data);

}catch (Exception e){
log.error("Exception occur while query the balance:"+e);
forwardPage = "error";
}

request.getSession().setAttribute("startDate", fmrsForm.getStartDate());
request.setAttribute("endDate",stateForm.getEndDate());
request.setAttribute("st", stateForm.getSt());
if (stateForm.getProgNum() == 0 )
forwardPage = "state";
else
forwardPage = "sub-state";

return mapping.findForward(forwardPage);
}
}



The second action class for Refreshing the same jsp page and getting the new data that just being entered in the database is

public class StateRefreshAction extends BaseAction {

public ActionForward process(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {

return mapping.findForward("state");
}
}


View All Comments
Advertisement
Related Tutorial and Articles
Programming Questions

Question-Answer Guidelines
Question-Answer Guidelines How to ask questions... Question-Answer Guidelines Disclaimer RoseIndia does... and rating the articles/ tutorials. Same like this, question-answer section 

JSP Servlet Questions

page refresh - JSP-Servlet
up window has to close and jsp page has to refresh. how can i solve...page refresh  Hi All, I've done a login application using Ajax. I wrote jsp page having sign in option. when i click the sign in,pop up window 

JSP Tutorials

How To Page Refresh Using JavaScript In JSP
How To Page Refresh Using JavaScript In JSP...; Step 1: Create a web page(sign.jsp) to show a button to Login user. <%@ page import="java.sql.*" %> <!DOCTYPE HTML PUBLIC " 

Struts Questions

Page Refresh - Struts
Page Refresh   Hi How Can we control the page does not go to refersh after its forward again from action class.in my form i have one dropdownlist... in same page and fwd the action to same page 

Struts Questions

Refresh the form - Struts
Refresh the form  Hi How Can i control the page that doesn't go to refresh when i am doing 1 or more action from same page and forward those action again to same page. how can i control the doesn't go to refresh in that page 

Programming Tutorials

Articles - Articles Submission Guidelines
tutorials to us. This page explains how you can submit your tutorials... Submission Formats The articles submission guidelines detailed in this page... Articles - Articles Submission Guidelines    

JSP Servlet Questions

Click on Page Refresh - JSP-Servlet
Click on Page Refresh  hi ,i am working on jsp with mysql. i m facing a problem whenever i click on page refresh or f5 button, the value on form....... use the following code in your jsp page but aftr adding this you 

Ajax Questions

refresh jsp page - Ajax
refresh jsp page  Code for refresh a web page in jsp.  Hi friend, function refreshpage() { window.location.reload 

Servlets

Refresh a Web Page Using In Servlet
.style1 { font-weight: bold; } Refresh a Web Page Using... example we develop an application to Refresh a web Page using Servlet. We...;) and refresh this web page and print the current Date and Time after 10 sec 

Ajax Questions

Part refresh without a page refresh
Part refresh without a page refresh  hello, How do I submit a form or a part of a form without a page refresh?   hii, Ajax can do... page 

Java Beginners

how to refresh my GUI page
how to refresh my GUI page  how to refresh a GUI in java 

Java Beginners

JSP Login Page Question
JSP Login Page Question  hey..i have a login page where different users first registered and then after they can login. my question is how a user... in database, plz...provide me answer its very urgent.   The given code accepts 

JDBC Questions

question
question  how to retreive data from database of a particular user after login using jsp+hiberante+struts configuration.   Please go through the following links: http://www.roseindia.net/struts/hibernate-spring 

JSP Servlet Questions

How to refresh Client only once by sending setHeader ("refresh" ,??? )
How to refresh Client only once by sending setHeader ("refresh" ,??? )  How can i send response from JSP that will make my client page to be refreshed ?? I just want to refresh my client page only once....! Not periodically 

Struts Questions

Page is not getting loaded when I refresh the webpage???
Page is not getting loaded when I refresh the webpage???  **I am loading an image section(image,demo link,Zoom) in a webpage by using javascript... when I refresh the page.* Note: Header section is getting loaded always Could 

Java Beginners

question
question  Hi good morning sir, how to send an error message to an html page after checking the database for different users.for eg:your user name or password is incorrect.reply me with code, without using bean.using servlet,html 

Programming Questions

Question Answer
? Browse Latest Questions Question-Answer Guidelines... website. If you found the question you can read the answer if it solves your... Here, you can post your desired question. For posting any question / query 

Java Beginners

question
in Jdbc -jsp page . that's it. chandu...question  good afternoon, how to get user name and password according to current date,using mysql and jsp.please give me the code immediately.   

Ajax Questions

how to refresh google map using ajax by fetching lat long from database
how to refresh google map using ajax by fetching lat long from database  i have a jsp page where we select the object and by submitting the form... long from db. Now, i need to refresh the map using ajax.Pls help me how to do 

JSP Servlet Questions

jsp drop down without refresh - JSP-Servlet
jsp dropdown in jsp page,But the probleam is when i select first drop down its... jsp same probleam also arise. Please tell me how to use the drop down without refresh and what change's is made in jsp of javascript to make proper data 

Mobile Applications Questions

UIBarButtonItem Refresh
, refresh button using code in iPhone application?? If yes then how?   ... the refresh button... i'm providing you the example of Navigation Refresh UIBarbuttonItem...] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh 

Blog

Servlet refresh page
Servlet refresh page In this example we will show you how you can refresh your page from setting the refresh attribute from a servlet. response.setHeader... the browser to refresh the page after 10 seconds. In this will you can develop 

Framework Questions

struts
struts   Hi how struts flows from jsp page to databae and also using validation ? Thanks Kalins Naik 

Development process Questions

how to forward select query result to jsp page using struts action class
how to forward select query result to jsp page using struts action class  how to forward select query result to jsp page using struts action class 

JSP Servlet Questions

refresh - JSP-Servlet
JSP project. In home page i like to logged members count dynamically.... Is there any other way to refresh that particular place instead of refreshing whole page... the whole page instead of refreshing the particular page. Logged member's 

Struts Examples

Struts Interview Questions
and optimize. Question: What is Struts Flow? Answer: Struts Flow is a port of Cocoon's...). Question: What are the components of Struts? Answer: Struts is based on the MVC design...;    Question: Can I setup Apache Struts to use multiple 

Struts Questions

question
question  I am doing a project using struts framework and spring jdbc .I have a issue that when data is inserted into database if we click the refresh button then the same data is again inserted in to the database.What 

Ajax Questions

share your answer to this question
share your answer to this question  i need to know what is the TELERIK CONTROL? what is the map suite? what is dunda chart? Also i have to know what are the websites available which give infor regarding this. Let me know how 

JSP Servlet Questions

jsp question
jsp question  I have to create a jsp page with 40 labels and 40... and the remaining should be in 2nd column....how can i seperate the two columns using a line....can u help me????   Hi Friend, You can use the following 

Struts Questions

using ajax and jsp (struts) to login and remain on same page.
using ajax and jsp (struts) to login and remain on same page.  I am a fresher... I can forward my login page to success page using struts, but I... know how to use struts to remain on same page. What about config file:- < 

Struts Questions

how to set time in jsp page
how to set time in jsp page   I need code for set the time in jsp code .iam using struts frame work back end oracle 10g ide is eclipse 6.0 

JavaScript Questions

How to prevent the page refresh while submitting the form??
How to prevent the page refresh while submitting the form??  Hi... to the select of Dropdown1. Im hitting a db for this every time.Hence the page loads... this page loading??? Thanks much 

Ajax Questions

Table refresh with ajax - Ajax
Table refresh with ajax  I am using jsp/html in my code. Is it compulsory that i have to use a servlet to implement table refresh using ajax? Or jsp also would work? Rajatha 

Java Beginners

to know my answer
to know my answer  hi, this is pinki, i can't solve my question "how to change rupee to dollar,pound and viceversa using wrapper class in java." will u help me 

Java Beginners

question
question  how to insert data in to table using bean + jsp 

Java Beginners

question
question  how to use or call log out and disable browser back page functions in all jsp 

Ajax Questions

refresh rate in ajax
refresh rate in ajax  my data is in table which is generated dynamically. i want to refresh that perticular table after some time using ajax and with jsp 

Java Beginners

question
question  i used the following code to disable browser back page javascript:window.history.forward(1); but not worked .please give the correct code to disable back page using jsp or javascript 

Java Beginners

question
question  how to put every data base connections (selection,insertion ,updation and so on) in one jsp page and how to import that in other pages of one project 

Java Beginners

question
question  how to list images from a file and how to display that images as four different images in each row using jsp / javascript 

Struts Questions

struts interview Question - Struts
struts interview question and answer java  struts interview question and answer java 

Struts Questions

reading data using struts and jsp java
reading data using struts and jsp java  how can i read data entered by user into a textbox (jsp page) into struts action class ex emp id,so that after reading emp_id it can be read into struts action class for retrieving other 

JSP Servlet Questions

datasource in jsp using struts
datasource in jsp using struts  how to get the datasource object in jsp.datasource is configured in struts-config.xml 

Java Beginners

question
question  Hi how to send an error message to an html page after checking the database for different users.for eg:your user name or password is incorrect.reply me with code, without using bean 

Struts Questions

struts - Struts
struts  we are using Struts framework for mobile applications,but we are not using jsps for views instead of jsps we planning to use xhtmls.In struts ,we writing the action ="action class name"in jsp,here in xhtml what we have 

JSP Servlet Questions

send answer
send answer  For online exam project,i want single question on single page and on that page there are three buttons previous,submit,next.If i click on next button it show next question from database 

Java Beginners

question
question  i have a jsp project ATS-HR ,i am using eclipse for back.../) is not available.** how tdo i solve this.please help me to run my project please give me one demo of how to create and run a jsp project in eclipse 

Java Beginners

question
question  simple jsp code for login and validation using jsp and simple java script   // login.jsp <%@ page language="java" contentType...; // validation.jsp <%@ page language="java" contentType="text/html; charset=UTF-8 

JSP Servlet Questions

jsp question
jsp question   sir plz tell me how can I create a page which is similar to feedback form in which if one option is empty then other option is inaccessible. for example it consists of name address etc. if name field is not filled 

JSP Servlet Questions

jsp question
jsp question   sir plz tell me how can I create a page which is similar to feedback form in which if one option is empty then other option is inaccessible. for example it consists of name address etc. if name field is not filled 

JSP Interview Questions

question - JSP-Interview Questions
directives, a portion of JSP directives control how the JSP compiler generates... description of answer at http://www.roseindia.net/jsp... Certifications  JavaServer Pages (JSP) is a Java technology that allows 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Struts Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Development process Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Development process Questions

How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp code college.jsp page <HTML> <head> </head> <body>... using this jsp,but i want to CollegeAction class and CollegeForm class how to do 

Java Beginners

jsp question
jsp question  how to use security lier in our project using with jsp 

JSP Tutorials

JSP Meta refresh
JSP Meta refresh          In this section, you will learn how to use... associated with  the session, the jsp starts a new count using session.putValue 

Struts Questions

Struts - Struts
Struts  hi can anyone tell me how can i implement session tracking in struts? please it,s urgent...........  session tracking? you mean session management? we can maintain using class HttpSession. the code follows 

JSP Servlet Questions

Please , can any one answer this Question?
Please , can any one answer this Question?  How to cummunicate one web application to another web application in different places 

Struts-Tutorials

Struts Articles
straightforward by building a simple Page Flow model on top of Struts. Using... a sample Struts application to demonstrate how to extend Struts using each... security principle and discuss how Struts can be leveraged to address 

Struts Questions

How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts...="java.util.Iterator"%> <%@page import="java.util.List"%> <jsp...;jsp:forward page="index.jsp"/> <% } else 

Struts Questions

How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts...; <jsp:forward page="index.jsp"/> <% } else { // Session Login...("")) { %> <jsp:forward page 

Struts Examples

Interview Questions - Struts Interview Questions
).     Question: How Struts relates to J2EE? Answer: ...;  Question: Is struts threadsafe?Give an example? AnswerStruts... of specifying an actual JSP page in the code, you can declaratively associate 

Ajax Questions

Hoe to refresh a table row dynamically
Hoe to refresh a table row dynamically  Want to refresh a table data when a particular link is clicked. How can i do using ajax ?   Hello... will able to refresh a particular table row? Please clarify this. Thanks 

Struts Questions

How to use an object properties in jsp page
How to use an object properties in jsp page  I have a arraylist of objects 'User' populated using struts 2 action class while loading that jsp page. In that JSP I have included another jsp using following tag: Here instead 

Programming Tutorials

Core Java Interview Question, Interview Question
and are laid out using the squares of a grid. Question: What an I/O filter? Answer: An I... as an object. Question: How are this and super used? Answer: this is used to refer... Core Java Interview Question Page 21   

Framework Questions

struts
struts  Hi what is struts flow of 1.2 version struts? i have struts applicatin then from jsp page how struts application flows Thanks Kalins Naik   Please visit the following link: Struts Tutorial 

JSP Servlet Questions

How to browse and upload the file in same page using jsp.
How to browse and upload the file in same page using jsp.  Hi Sir, I am doing a project in jsp servlets and i want to browse and upload the file in cell if a table in same page, post answer as soon as possible.thanks 

JSP Servlet Questions

How to browse and upload the file in same page using jsp.
How to browse and upload the file in same page using jsp.  Hi, I am doing a project and i want to browse and upload the file in same page inside grid view of table,post the answer as soon as possible, thanks in advance 

JSP Servlet Questions

How to design https connection page using JSP
How to design https connection page using JSP  Hi, I have a project in which a page requires https secure design to process the payment. Since... a secure page. Please kindly provide me a solution on how to design a https page using 

JSP Servlet Questions

jsp question
jsp question  i send the request one jsp page to another jsp than how i access the first jsp variable in the servlet? i m able to access only the second jsp page variable but not first jsp page?   Hi Friend, Follow 

Programming Tutorials

Core Java Interview Question, Interview Question
. Question: How are Observer and Observable used? Answer: Objects that subclass... Core Java Interview Question Page 12       Question: What is a transient variable? Answer 

JSP Servlet Questions

servelt refresh page
servelt refresh page   write a program in servlet that display the cricket score.the page should automatically refresh on every 5 seconds.the score... should fall down.the page should not refresh after 5 overs is completed 

Interview Questions

Difficult Interview Questions Page -10
using your current job as a reference point. Question 92:  How to do measure... or sporting event you attended? How did it affect you? Answer: This question...;    Question 91: Are you a leader? Answer: Absolutely! I've 

Struts Questions

Struts
Struts  Am newly developed struts applipcation,I want to know how to logout the page using the strus   Please visit the following link: Struts Login Logout Application 

Programming Tutorials

Core Java Interview Question, Interview Question
? Answer: setBounds() Question: How many bits are used to represent Unicode... Core Java Interview Question Page 13       Question: What is an Iterator interface? Answer 

Programming Tutorials

Core Java Interview Question, Interview Question
Core Java Interview Question Page 30  ... Answer: Yes constructors can be overloaded Question: What happens when... in the constructor Question: What is an inner class Answer: An inner class is same 

Struts-Tutorials

Struts Tutorials
. how to build a simple Struts HTML page using taglibs 6. how to code... Tutorial This complete reference of Jakarta Struts shows you how to develop Struts... multiple Struts configuration files This tutorial shows Java Web developers how to set 

Struts Questions

jsp to struts 2 action conversion problem - Struts
jsp to struts 2 action conversion problem  i have one jsp page that includes 3 other jsp pages(using RequestDispactcher).how to convert that jsp page to a struts2 action?among that one jsp page is wrritten using jpivot,wct tags 

Struts Questions

STRUTS QUESTION
STRUTS QUESTION  can two Action classes communicate each other using RequestDispatcher 

JSP Servlet Questions

Please answer me - JSP-Servlet
Please answer me  Hello Guys, this is the third time I'm sending this question. But I've not got the right answer from you. The again is: I need java servlet or jsp codes that I can use to insert and retrieve image from MSSQL 

Struts Questions

struts
technologies like servlets, jsp,and struts. i am doing one struts application where i doing validations by using DynaVAlidatorForm in that have different fields...struts   hi Before asking question, i would like to thank you 

JSP Servlet Questions

title and keywords don't refresh in webpage - JSP-Servlet
title and keywords don't refresh in webpage  Hi, I changed the title and keywords on my main jsp page that is the entry point into my web... and keywords. If I change anything else on the jsp page it refreshes 

JSP Servlet Questions

Doubt in using combination of JSP page and Java class. - JSP-Servlet
be disabled from clicking. How to go about doing this in a "JSP Page using...Doubt in using combination of JSP page and Java class.   I've got... will be really appreciated.  if u r using struts framework u can put 

Programming Tutorials

Core Java Interview Question, Interview Question
Core Java Interview Question Page 24  ... it to byte stream Question: What are the rules of serialization Answer: Rules.... Question: What is the difference between parameters and arguments Answer 

Struts Questions

Struts
Struts  I want to get the data from database into text box in a jsp page by using struts and javascript If I click on go button it will display all the values and from that i need to select the required value and i should store 

Programming Tutorials

Core Java Interview Question, Interview Question
Core Java Interview Question Page 29  ... of a class called java.lang.Throwable Question: How do you intercept and thereby control exceptions Answer: We can do this by using try/catch 

Struts Questions

jsp and struts
jsp and struts  What is the difference between jsp and struts? Does struts use jsp?   Java Server Pages (JSP) is a server-side technology... code for a web-page (although this JSP code runs on the server) to produce dynamic 

Struts Questions

struts
struts  how to make one jsp page with two actions..ie i need to provide two buttons in one jsp page with two different actions without redirecting to any other page 

Struts Questions

struts - Struts
struts get records in Tabular format  How do i get result in tabular format using JSP in struts 

Programming Tutorials

Core Java Interview Question, Interview Question
locl before it can proceed Question: Using notify () method how you can... Core Java Interview Question Page 31  ... Question: When the thread gets to execute, what does it execute Answer 

Java Beginners

Refresh JFrame
Refresh JFrame  How to refersh a JFrame and its componets 

Struts Questions

struts
struts   how to display data from database on jsp using struts1.0 

Java Beginners

Clarify my last question's answer - Java Beginners
Clarify my last question's answer  Dear expert, I've tried out... how your solution is giving me the matching that I hope to do. Netbean Ide... did not specify my question too clearly. Here's my 2 database 

Servlets

Servlet Interview Questions - Page 2
method. Question: What are the type of protocols supported by HttpServlet? Answer.... Question: What are the directory Structure of Web Application? Answer: Web component... Question: What is ServletContext? Answer: ServletContext is an Interface 

Advertisements Advertisements
 

 

 

DMCA.com