I need to navigate on my Jsp page. Have to use buttons like (Next, Previous,First and last).

Do you mean that you have multiple JSPs and on each JSP you have buttons like Next ,previous , first , last ? And on each button click , you need to open another JSP ?

I would like to mention that calling in a JSP directly will not trigger the Action processing of struts , thus not letting the Dispatcher to initialize the request processing cycle and create needed value stack. Opening JSP pages directly in struts is bad practice.

Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)

raka oscr
Greenhorn

Joined: Mar 02, 2013
Posts: 26

posted Mar 09, 2013 04:46:36

0

Thanks Saif,

I actually mean that, I am showing a form format as a parent and a child as a table format. I need to navigate to different record using First, Last, Next, Previous buttons on the parent form.

So you are implementing pagination concept via JSPs and struts. Well you can accomplish this via multiple ways. One way may be to trigger an Ajax requests on each button click and replace the current JSP with the html of the response .

raka oscr
Greenhorn

Joined: Mar 02, 2013
Posts: 26

posted Mar 09, 2013 06:25:32

0

I am very new to struts, and ajax. Really it sounds strange to me, can you please give an example to implement this concept.

Well if your new at struts and all , I suggest you first acquaint yourself with the basics of struts first as to how we actualy get a particular JSP to display based on some result obtained from an action class. You should be able to navigate from one jsp to another via struts Action ( either by form submits or button clicks ). Next , look at how you can work with AJAX to trigger these struts actions asynchronously. I will recommend using Jquery to trigger ajax events. ( relatively easy )

Take it one step at a time. First, get to know struts.

Do post back for any queries and questions. We will surely help you along the way.