This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Navigating on jsp page. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Navigating on jsp page." Watch "Navigating on jsp page." New topic
Author

Navigating on jsp page.

raka oscr
Greenhorn

Joined: Mar 02, 2013
Posts: 25
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

Joined: Aug 11, 2011
Posts: 440

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.

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

Joined: Mar 02, 2013
Posts: 25
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

Joined: Aug 11, 2011
Posts: 440

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: 25
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

Joined: Aug 11, 2011
Posts: 440

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

Joined: Mar 02, 2013
Posts: 25
Thanks a lot saif. Sure I do.


-raka
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Navigating on jsp page.
 
Similar Threads
struts newbie needs help with autocompleter
how to download file from server?
eror in the jsp custom tags
Redirect to another page after inserting
Subtotals