Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Navigating on jsp page.

 
raka oscr
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am using struts 1.3(myeclipse 6.0.1),

I need to navigate on my Jsp page. Have to use buttons like (Next, Previous,First and last). I am very new to this environment. Please guide me.

-raka
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings raka,

What do you mean by

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.
 
raka oscr
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


regards,
-raka
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am very new to struts, and ajax. Really it sounds strange to me, can you please give an example to implement this concept.

Thanks & regards,
-raka
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
raka oscr
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot saif. Sure I do.


-raka
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic